Popup menus in RCP application [message #448430] |
Mon, 24 April 2006 14:34 |
Eclipse User |
|
|
|
Originally posted by: fredrik.ferm.se.ibm.com
Hello
I am developing an RCP application to learn more about EMF, RCP & various
user interface technologies such as JFace & SWT.
I now have the problem of creating a popup menu.
I have a view that shows EMF objects of my own defined type Person. I also
have an action that is supposed to add a new person to the list. When I run
this action from a menu it works fine. Now I want to create a popup menu so
that new persons can be created easily directly from the view.
I have used the exension point org.eclipse.ui.popupMenus to do this. I have
tried to add the action both as an objectContribution and as a
viewerContribution, but nothing works. When I run the example and
right-click in the view nothing happens, no popup menu appears. I have no
idea how to move further. I suspect that the menu has to be initialized
somewhere, but how and where ?
If anybody has some insights into this, I would be grateful for some
pointers.
Regards
Fredrik Ferm
P.S. here is the part of my plugin.xml-file that defines the
org.eclipse.ui.popupMenus extension.
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="net.sofft.recept.emf.recept.Person"
adaptable="false"
nameFilter="*"
id="net.sofft.recept.popup.Person">
<action
label="RCPProject.action3"
class="net.sofft.recept.rcp.actions.AddPersonAction"
menubarPath="additions"
id="RCPProject.action3"/>
</objectContribution>
<viewerContribution
targetID="net.sofft.recept.rcp.views.PersonList"
id="net.sofft.recept.popup.PersonViewerContribution">
<action
label="RCPProject.action4"
class="net.sofft.recept.rcp.actions.AddPersonAction"
menubarPath="additions"
id="RCPProject.action4"/>
</viewerContribution>
</extension>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02964 seconds