How to Open Open a View Using Id in Eclipse Rcp
1.) Create a new HelloWorld RCP project 2.) Open the plugin.xml file and click the Extension tab 3.) Add the extension org.eclipse.ui.comman...
https://www.czetsuyatech.com/2021/07/java-eclipse-rcp-open-a-view-by-id.html
1.) Create a new HelloWorld RCP project
2.) Open the plugin.xml file and click the Extension tab
3.) Add the extension org.eclipse.ui.commands
a.) right click and select New->command
b.) set the command's id to command.showView
c.) set the defaultHandler to org.eclipse.ui.handlers.ShowViewHandler
4.) Add a parameter to the command
a.) right click the command.showView
b.) select New->commandParameter
c.) set its id to org.eclipse.ui.views.showView.viewId
d.) name=viewId
e.) values=org.eclipse.ui.internal.registry.ViewParameterValues
5.) Now we need to create the menu
a.) add the extension org.eclipse.ui.menus
b.) right click and select New->menuContribution
c.) sets the locationURI=menu:org.eclipse.ui.main.menu
6.) Attach the command to the menu
a.) right click the menuContribution select New->command
b.) sets the commandId=org.irri.jicis.administration.command.showView
c.) label=Show View
7.) Add a parameter to the menu
a.) right click the "Show View" command, select New->parameter
b.) set the name=org.eclipse.ui.views.showView.viewId
c.) value=an existing view id (I assume you already know how to create a view with a view id)
hint: add an extension org.eclipse.ui.views


Post a Comment