我在目前的世界E4标准E3编辑:请编辑不可合
public class ProjectEditor extends EditorPart {
// implement
}
注册这样的:
<extension point="org.eclipse.ui.editors">
<editor
class="com.qualitype.gpm.project.rcp.ProjectEditor"
icon="icons/obj16/project.gif"
id="com.qualitype.gpm.project.rcp.ProjectEditor"
name="%view.project" >
</editor>
</extension>
我想要的编辑器始终打开。但是扩展点中缺少像视图这样的参数。
而且,景色这会工作:
public class ProjectPerspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
final IViewLayout projectLayout = layout.getViewLayout(ProjectEditor.ID);
projectLayout.setCloseable(false);
}
}
不过,当然不是为编辑。由于编辑器和视图在技术上都是相同的东西(工作台部件),所以它应该是可能的。
如何防止用户关闭我的编辑器?
如何在e3 ui模型上做同样的事情? – Raghu
@Raghu这个答案适用于e3编辑器(但仅限于使用Eclipse 4.x版本时)。 –
我试过这个,但它不工作。我正在使用开普勒。这里是我的代码Object mPart = getSite()。getService(MPart.class);如果(MPart的实例实例)MPart part =(MPart)mPart; part.setCloseable(false); } 它执行得很好,但我仍然可以看到编辑器上的关闭按钮 – Raghu