0

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

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

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);

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

4

1 回答 1

0

尝试在 plugin.xml 中定义它。

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

例子:

  <view
  class="org.eclipsercp.hyperbola.ContactsView"
  icon="icons/groups.gif"
  moveable="false"
  id="org.eclipsercp.hyperbola.views.contacts"
  name="Contacts"/>
于 2013-03-25T13:49:10.920 回答