我突然在我的RCP應用程序的菜單欄中有「運行」和「搜索」。無論如何刪除它們?運行和搜索出現在RCP Menubar
6
A
回答
8
首先,檢查this thread(和this thread使用的文章 「Contributing Actions to the Eclipse Workbench」):
訣竅是 「
check the launcher config
」 - 即使在一個完全新的安裝Eclipse 3.1.1的,具有精確除了我自己的插件外,沒有別的東西在我的WS中,煩人的額外菜單和惱人的錯誤「編輯最後的位置」仍然存在。然後我去啓動程序配置爲你的建議,其中有克魯夫特的負載(用Eclipse中自動地創建) - 所以我取消全部選擇我的插件,並點擊「
Add Required
」;用WS跑出來 - 太棒了!
請參閱卸下「平臺」功能,修復了這一切 - 一個非常簡單的修復,這是非常難得!
也就是說,在一般情況下,隱藏某些行動的貢獻,你可以嘗試,比如在this thread到:
1 /隱藏通過ActionSet擴展點定義的菜單/酷工具欄。
IWorkbenchPage.hideActionSet(actionSetId)
IWorkbenchPage.hideActionSet("org.eclipse.search.menu");
2 /隱藏的菜單:
MenuManager mbManager = ((ApplicationWindow)page.getWorkbenchWindow()).getMenuBarManager();
for (int i=0; i<mbManager.getItems().length; i++){
IContributionItem item=mbManager.getItems()[i];
if (item.getId().equals("org.eclipse.search.menu")){
item.setVisible(false);
}
}
或者你可以嘗試this thread,隱藏它的任何角度通過PerspectiveListener
:
個的動作ID我從通過瀏覽了我的依賴eclipse插件..搜索
ActionSets
package ch.post.pf.gui.prototyp.sesam.pstonline;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IPerspectiveListener;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
public class ActionWiper implements IStartup, IPerspectiveListener {
private static final String[] ACTIONS_2_WIPE = new String[] {
"org.eclipse.search.searchActionSet",
"org.eclipse.ui.edit.text.actionSet.presentation",
"org.eclipse.ui.edit.text.actionSet.openExternalFile",
"org.eclipse.ui.edit.text.actionSet.annotationNavigation",
"org.eclipse.ui.edit.text.actionSet.navigation",
"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo",
"org.eclipse.update.ui.softwareUpdates" };
public void earlyStartup() {
IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
.getWorkbenchWindows();
for (int i = 0; i < windows.length; i++) {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null) {
wipeActions(page);
}
windows[i].addPerspectiveListener(this);
}
}
private void wipeActions(IWorkbenchPage page) {
for (int i = 0; i < ACTIONS_2_WIPE.length; i++) {
wipeAction(page, ACTIONS_2_WIPE[i]);
}
}
private void wipeAction(final IWorkbenchPage page, final String actionsetId) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
page.hideActionSet(actionsetId);
}
});
}
public void perspectiveActivated(IWorkbenchPage page,
IPerspectiveDescriptor perspective) {
wipeActions(page);
}
public void perspectiveChanged(IWorkbenchPage page,
IPerspectiveDescriptor perspective, String changeId) {
}
}
,並刪除喜好:
隨着
PreferenceManager
我甚至去掉不必要的首選項.. :)
凡PREFERENCES_2_WIPE
字符串必須是你想要得到的主要類別的ID擺脫。像 「org.eclipse.ui.preferencePages.Workbench」 - >顯示爲一般
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
for (int i = 0; i < PREFERENCES_2_WIPE.length; i++) {
pm.remove(PREFERENCES_2_WIPE[i]);
}
3
對我來說,這個工作(希望它可以幫助你):
<extension
point="org.eclipse.ui.activities">
<activity
id="someid.remove"
name="RemoveSearchMenu">
<enabledWhen>
<with
variable="activePartId">
<equals
value="someidr.RemoveSearchMenu1">
</equals>
</with></enabledWhen>
</activity>
<activityPatternBinding
activityId="someid.remove"
pattern="org.eclipse.search.*">
</activityPatternBinding>
相關問題
- 1. 在hadoop上運行lucene搜索出錯
- 2. PyQt4 menubar沒有出現在Ubuntu
- 3. 搜索時出現搜索欄錯誤
- 4. IDA搜索和替換所有出現
- 5. 搜索圖標不會出現在自動完成搜索
- 6. 搜索欄不出現在ios
- 7. 在Drupal中搜索框出現問題
- 8. Zend_Ldap在搜索CN時出現異常
- 9. 圖像滑塊出現在搜索
- 10. jwordster項目出現在搜索引擎
- 11. PowerShell的 - 搜索和輸出逐行
- 12. AJAX搜索不會運行
- 13. 在搜索欄中實現Google搜索
- 14. 搜索包含X,但表現出比這個更行發現
- 15. Substance和MacOS MenuBar
- 16. 運行rcp應用程序
- 17. 如何找出在heroku上運行的彈性搜索版本?
- 18. 在gridview中運行搜索Visual Studio C#
- 19. Ajax搜索未在引號上運行
- 20. 在整個表格中運行搜索
- 21. 在Vim的搜索中運行AWK
- 22. 搜索沒有在分頁上運行
- 23. 自定義Google搜索未出現在IE8和IE9上
- 24. 和運營商在休眠(lucene)搜索
- 25. 等待在eclipse rcp應用程序退出時運行作業
- 26. 運行Google網站搜索時出現500內部服務器錯誤
- 27. 搜索焦點和出
- 28. 使用搜索欄搜索tableview時出現NCFString錯誤
- 29. Expression Engine高級搜索 - 搜索關鍵字時出現問題
- 30. 從命令行運行Eclipse RCP應用程序時出錯
非常感謝你。事實證明,我所要做的就是在我的運行配置插件選項卡中選擇「需要的插件」。 – 2010-03-16 23:35:00