[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: setting ContextMenu for TreeViewer
|
Look at what other JFace TreeViewer clients do.
I think you have to get the SWT control, and set the Menu as its context
menu.
You may have to be concerned with disposing the contextmenu
"Ved Gunjan" <gunjan_sir@xxxxxxxxx> wrote in message
news:6a8d1a28d2195c774fc3d50a5c052aaf$1@xxxxxxxxxxxxxxxxxx
>
> 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
>
>
>
>