2013-03-21 55 views
0

在Eclipse IDE中,我們可以看到某些視圖不能移動到另一個文件夾,例如,視圖「包」不能移動到編輯器選項卡。那麼,我怎樣才能防止移動視圖到另一個文件夾?Eclipse RCP - 阻止將視圖移動到另一個文件夾(或僅阻止移動)

我試圖阻止移動視圖所有,但我需要能夠關閉的標籤,所以

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

不起作用。有沒有人有任何想法嗎?

回答

0

嘗試在plugin.xml中定義它。

移動 - 指定閹視圖可選屬性應該是可移動的。如果沒有,它將是可移動的。

例子:

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

謝謝,但由於某種原因它不工作,仍然意見可以移動。它也不適用於任何其他視圖 – Anatoly 2013-03-28 07:40:25