[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] setting ContextMenu for TreeViewer


hi!
This is with the reference of my previous post " Getting menu on right click".
I have a SolutionExplorer view in my application which uses JFace TreeViewer.
I want to register actions on the view (when the right click on it he/she sholud get menu drop down).
I will have to do something like this...i guess
ContextMenuProvider provider = new LogicContextMenuProvider(getViewer(), getActionRegistry());
getViewer().setContextMenu(provider);
getSite().registerContextMenu("org.eclipse.gef.examples.logic.outline.contextmenu", //$NON-NLS-1$
provider, getSite().getSelectionProvider());
getViewer().setKeyHandler(getCommonKeyHandler())
viewer.setContextMenu(provider)


The above viewer is an EditPartViewer,but i have a TreeViewer of JFace.
So how can i do setContextMenu() on a TreeViewer.

Hope im able to convey my situation properly.
Thanking in advance for the suggestions.
Regards
Ved