|
Re: [RCP] WorkbenchAdvisor vs plugin.xml (menus) [message #256698 is a reply to message #256590] |
Tue, 29 June 2004 15:15 |
Eclipse User |
|
|
|
Originally posted by: eclipse.removeMe.guide.andRemoveMe.earthlink.andMeToo.com
They are equivalent but not interchangeable. Looking at your extract, the
QuitAction class your example wishes to contribute doesn't appear to
implement IWorkbenchWindowActionDelegate as expected by the <action> tag
(ergo "ClassCastException"). Take a look at IDEWorkbenchAdvisor. It
creates the standard menus and has a lot of the code you can emulate for
your own menus and those contributed by Eclipse plug-ins that you may wish
to reuse (e.g., text editor plug-in assumes you've created the standard Edit
pulldown).
-- Dan
-----------------------------------------
co-author, "The Java Developer's Guide to Eclipse"
"Michal Tkacz" <mehow@neurosoft.net> wrote in message
news:cbr852$6vo$1@eclipse.org...
> I'm starting to learn RCP and wondered whether declaring things in
plugin.xml is
> equivalent to creating them in my subclass of WorkbenchAdvisor. In
particular,
> I'd prefer to declare all my menus using actionSets extension point
instead of
> overriding fillActionBars method. However, it seems that if I don't create
my
> menu there it won't appear in the workbench. Here is a part of my
plugin.xml
> file (suppose fillActionBars is not overriden):
>
> <extension
> point="org.eclipse.ui.actionSets">
> <actionSet
> label="%actionSet"
> id="actionSet">
> <menu
> label="%fileMenu"
> id="file">
> <groupMarker name="fileStart"/>
> <separator name="fileEnd"/>
> </menu>
> <action
> label="%quitAction"
> class="org.eclipse.ui.internal.QuitAction"
> menubarPath="file/fileEnd"
> id="quitAction"/>
> </actionSet>
> </extension>
>
> Note also that the same plugin declares extensions to
> org.eclipse.core.runtime.applications and
org.eclipse.core.runtime.products (if
> this makes any difference).
>
> Any help would be appreciated
>
> Michal Tkacz
|
|
|
|
Powered by
FUDForum. Page generated in 0.03857 seconds