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

2019-04-11 00:17发布

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条回答
Juvenile、少年°
2楼-- · 2019-04-11 01:02

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>
查看更多
登录 后发表回答