【问题标题】:Eclipse RCP - prevent moving views to another folder (or just prevent moving)Eclipse RCP - 防止将视图移动到另一个文件夹(或只是防止移动)
【发布时间】:2013-03-10 20:13:27
【问题描述】:

在 Eclipse IDE 中,我们可以看到某些视图无法移动到另一个文件夹,例如查看“包”不能移动到编辑器选项卡。那么,如何防止将视图移动到另一个文件夹?

我试图完全阻止移动视图,但我需要能够关闭标签,所以

layout.setFixed(true);

不是解决方案。我的文件夹中有多个视图,并关注

folder = layout.createFolder(FOLDER_ID, IPageLayout.TOP,
    ratio, editorArea);
folder.addPlaceholder(View.ID + ":viewSecondaryID*");

String id = View.ID;
String secondaryId = Integer.toString(View.getCurrentId());
folder.addView(id + ":" + secondaryId); 

IViewLayout view = layout.getViewLayout(id + ":" + secondaryId);
view.setMoveable(false);

不起作用。有人在这里有什么想法吗?

【问题讨论】:

    标签: view eclipse-rcp


    【解决方案1】:

    尝试在plugin.xml中定义。

    moveable - 指定视图是否应可移动的可选属性。如果不存在,它将是可移动的。

    例子:

      <view
      class="org.eclipsercp.hyperbola.ContactsView"
      icon="icons/groups.gif"
      moveable="false"
      id="org.eclipsercp.hyperbola.views.contacts"
      name="Contacts"/>
    

    【讨论】:

    • 谢谢,但由于某种原因它不起作用,视图仍然可以移动。它也不适用于任何其他视图
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-15
    相关资源
    最近更新 更多