Eclipse RCP: org.eclipse.ui.views.showView Parameters

…衆ロ難τιáo~ 提交于 2020-01-01 15:34:14

问题


I want to show a specific view in my RCP application using a command. Using showView opens a dialog to select view. Is there any way to do without selection dialog? I tried parameters but didn't help. Related part of plugin.xml is below. com.dbtek.hyperbola.views.contactsView is my view ID


回答1:


You need to add a command parameter with the id of the view to show. E.g.

<extension
      point="org.eclipse.ui.menus">
   <menuContribution
         locationURI="menu:org.eclipse.ui.main.menu">
      <menu
            id="window"
            label="Window">
         <command
               commandId="org.eclipse.ui.views.showView"
               label="Show Progress"
               style="push">
            <parameter
                  name="org.eclipse.ui.views.showView.viewId"
                  value="org.eclipse.ui.views.ProgressView">
            </parameter>
         </command>
      </menu>
   </menuContribution>
</extension>


来源:https://stackoverflow.com/questions/6490157/eclipse-rcp-org-eclipse-ui-views-showview-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!