2016-08-26 33 views
0

我使用org.eclipse.ui.menus擴展點在plugin.xml中的我的RCP應用程序的coolbar上添加了命令。當我啓動它,我得到一個空格開頭如下圖所示的畫面:使用命令在Eclipse coolbar RCP中啓動空間

enter image description here

如何調試呢?我試圖添加插件間諜,但它沒有顯示任何內容。有趣的是,當我添加行動貢獻時,沒有空間。

plugin.xml的代碼片段添加此命令COOLBAR:

<extension 
     point="org.eclipse.ui.menus"> 
     <menuContribution 
      allPopups="false" 
      locationURI="toolbar:org.eclipse.ui.main.toolbar"> 
     <toolbar 
       id="myapp.application.toolbar3"> 
      <command 
        commandId="myapp.application.setttings.id" 
        icon="icons/3.png" 
        label="Settings" 
        style="push"> 
      </command> 
     </toolbar> 
     <toolbar 
       id="myapp.application.toolbar1"> 
      <command 
        commandId="myapp.application.openWizards" 
        icon="icons/5.png" 
        id="myapp.application.openWizards.dropdown" 
        label="Open" 
        mode="FORCE_TEXT" 
        style="pulldown"> 
      </command> 
     </toolbar> 

    </menuContribution> 
    </extension> 

回答

0

我有一個類似的問題 Gap between search menu and its previous menu on addition of search plugin

我修改ApplicationWorkbenchWindowAdvisor類我的RCP應用程序的postWindowCreate方法

我在哪裏調試,哪些IContributionItem項目正在被添加。

IWorkbenchPage page = this.getWindowConfigurer().getWindow().getActivePage(); 
    MenuManager menuBarManager = ((ApplicationWindow)page.getWorkbenchWindow()).getMenuBarManager(); 
    IContributionItem[] items = menuBarManager.getItems(); 
    // iterate on items and its children and see which contribution item is getting added 
    // if any unwanted items are present the remove it