【发布时间】:2019-06-02 23:43:06
【问题描述】:
我正在试验 Eclipse RCP 应用程序处理其插件的方式。在 Eclipse IDE 中,我创建了一个 Eclipse RCP 3.x 项目,其视图生成了所有必要的文件并且工作正常。
假设我可以通过删除 plugin.xml 文件的各个部分将这个应用程序转换为只保留一个空透视图的应用程序,我将所有处理视图的行注释掉,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="application"
point="org.eclipse.core.runtime.applications">
<application>
<run
class="pluginwithview.Application">
</run>
</application>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
name="Perspective"
class="pluginwithview.Perspective"
id="PluginWithView.perspective">
</perspective>
</extension>
<!--
even without these lines
there's an Exception thrown saying:
"Could not create the view: PluginWithView.view
-->
<!-- <extension
point="org.eclipse.ui.views">
<view
name="View"
inject="true"
class="pluginwithview.View"
id="PluginWithView.view">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="*">
<view
standalone="true"
minimized="false"
relative="org.eclipse.ui.editorss"
relationship="left"
id="PluginWithView.view">
</view>
</perspectiveExtension>
</extension> -->
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu">
<menu
label="File">
<command
commandId="org.eclipse.ui.file.exit"
label="Exit">
</command>
</menu>
</menuContribution>
</extension>
</plugin>
但应用程序现在看起来像这样,而不是显示一个空的透视图:
我必须怎么做才能让应用程序不搜索视图?是否有我缺少的配置文件? (我知道没有视图有几个原因,但现在我主要对 Eclipse RCP 应用程序的内部工作感兴趣)
【问题讨论】:
标签: eclipse-plugin eclipse-rcp