setting ContextMenu for TreeViewer [message #173621] |
Fri, 25 March 2005 11:21  |
Eclipse User |
|
|
|
Originally posted by: gunjan_sir.yahoo.com
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
|
|
|
Re: setting ContextMenu for TreeViewer [message #173641 is a reply to message #173621] |
Fri, 25 March 2005 11:29  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
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@yahoo.com> wrote in message
news:6a8d1a28d2195c774fc3d50a5c052aaf$1@www.eclipse.org...
>
> 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
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03351 seconds