Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tigerstripe-dev] Re: Menus

Hey Richard,

Thanks for the run through! The export menu has been added and this code has been checked in.

Thanks,
Jim


On Mar 10, 2009, at 6:35 AM, Richard Craddock (rcraddoc) wrote:

Jim,
 
I mentioned about the menus the other day.
 
You need to look at org.eclipse.tigerstripe.workbench.ui.base plugin.
 
In the plugin.xml it uses the following extension points:
 
org.eclipse.ui.menus
org.eclipse.ui.commands
org.eclipse.ui.handlers
 
It also makes use of
org.eclipse.ui._expression_.xxx
 
 
I will assume that you are adding an entry from within the ui.base plugin
 
To add a new "Export" menu entry you will need to :
 
1. add a *menu* item to the xxx.menus extension point and give it the Label "Export...". Set the Id to "org.eclipse.tigerstripe.workbench.ui.menu.export" ( This is so that other Export plugins can contribute here).
 
2. add a *command* to the above menu, and give it the label "Facet Based Export" or whatever you thing is called.
 
3. Create a *command* in the xxx.commands extension point, and make sure the above command and this one have the SAME ID. (Basically copy the concepts from the Generate command).
 
4. Create a *handler* for your command in the handlers extension point.  You have two choices here :
A simple handler ( as is used for patternBasedProjectCreate) will always be active
A more specific one (as is used for generate) will only be active if a TS project is selected, or a TS editor is selected. (This is where the _expression_ stuff is used)
 
In your case I think the simple version is needed as you will be selecting the projects once the dialog is open.
 
5. You then need to update the handler class to open your wizard!
 
 
 
JUST FOR INFO....
 
If you were adding a menu entry from outside of the base plugin,
You still need to do item 1 above in the ui.base plugin.
 
Before Line 2 above you need to create a menuContribution, and set the locationURI to:
 
"menu:org.eclipse.tigerstripe.workbench.ui.menu.export"
 
Then carry on with lines 3 to 5 in your plugin.
 
The UML2 Import plugin would be a useful model to copy form in this scenario.
 
 
 
Hope that helps...
 
Richard
 
 
 
 
"This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message."
"Cisco Systems Limited (Company Number: 02558939), is registered in England and Wales with its registered office at 1 Callaghan Square, Cardiff, South Glamorgan CF10 5BT"
 


Back to the top