howto provide context menu actions in a tree in a formeditor [message #333340] |
Thu, 04 December 2008 14:07  |
Eclipse User |
|
|
|
Hi,
I've got a formeditor setup that has an swt Tree (using TreeViewer) embedded
in it. I'd like to provide a context menu with standard actions such
as "cut","copy","paste" for this. I tried to do this using something like:
MenuManager contextMenu = new MenuManager();
contextMenu.setRemoveAllWhenShown( true );
contextMenu
.add( new CopyMapEntriesAction( map, viewer ) );
Menu m = contextMenu.createContextMenu( viewer.getControl() );
viewer.getControl().setMenu( m );
editor.getSite().registerContextMenu( contextMenu, viewer );
However all I do get is a contex menu that contains stuff like "Run A..".
I've tried to look into how the PDE form editor does this, but couldn't see
anything I'm doing wrong.
Do I have to register the action somehow via plugin.xml? I didn't think this
would be necessary as I'm using a
setActionDefinitionId("org.eclipse.ui.edit.copy").
Anybody has a sample for a simple formeditor that provides the standard
copy/paste action on a tree view?
Andreas
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04748 seconds