问题
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