【发布时间】:2012-07-03 04:55:12
【问题描述】:
我正在尝试使用 Eclipse 4 API。我尝试使用插件贡献一个新视图。到目前为止我所拥有的是:
org.eclipse.e4.workbench.model 的扩展
<plugin>
<extension id="id1" point="org.eclipse.e4.workbench.model">
<fragment uri="fragment.e4xmi"></fragment>
</extension>
</plugin>
fragment.e4xmi
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_r_EgIEXDEeGuDquXwerIpw">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_rC_ngEXFEeGuDquXwerIpw">
<elements xsi:type="basic:Part" xmi:id="_sQq7kEXFEeGuDquXwerIpw" elementId="test.TestView2" contributionURI="platform:/plugin/test/test.TestView2" label="TestView2" tooltip="Test Test Test" closeable="true"/>
</fragments>
</fragment:ModelFragments>
我的视图实现:
package test;
import javax.inject.Inject;
import org.eclipse.e4.ui.di.Focus;
public class TestView2 {
@Inject
public TestView2() {
}
@Focus
public void onFocus() {
}
}
由于某种原因,该视图似乎没有被贡献。我错过了什么吗?我需要其他东西来完成这个谜题吗?如何调试问题?
编辑:
我想问题是,我的 String Model Fragment 没有 Element Id 也没有 Featurename。我想我必须插入 PartStack 和 children 的 ID 作为 Featurename。问题:编辑器没有在向导中显示任何元素来选择Element Id ...
【问题讨论】:
标签: java eclipse eclipse-plugin