Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Context Menus on Dialogs
Context Menus on Dialogs [message #331963] Tue, 30 September 2008 16:41 Go to next message
stuart pond is currently offline stuart pondFriend
Messages: 11
Registered: July 2009
Junior Member
All,

I have a dialog that contains a JFace TreeViewer, based on selection it is
desired to allow popup context menu on the selected node in the TreeViewer
in the Dialog.

Not surprising, the content of the context menu is dependent on what is
selected. I have various menu contributions and handlers that contribute to
any popup menu and control visiblility, enablement based Selection.

Is it possible
1) Put context popup menus on Trees, Tables, that are parented by Dialog?
2) How do you make the dialog's Tree SelectionProvider participate with the
workbench SelectionService (for menus and handlers controled by expressions)
when the dialog is NOT a ViewPart. It seems that selection mechanism really
wants to work only with WorkbenchParts and when you go outside that box your
out of luck. Or am I missing something?

-Stu
Re: Context Menus on Dialogs [message #332017 is a reply to message #331963] Wed, 01 October 2008 13:58 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can have your dialog context menu participate in the menu
contributions by using IMenuService to populate and release any
contributions needed.

But ... while in a dialog, only some of the variables are available
(i.e. selection and/or activeMenuSelection might not be available).

If launched from one of your parts, you might be able to have the part
"host" that context menu (but that ties it to a specific selection
provider, i.e. a viewer that needs to continue to provide selection events).

Other possibilities include submitting your own ISelectionProvider to
the window selection service while your dialog is active.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:What is a IWorkbenchPage object stands for in RCP or Eclipse
Next Topic:Eclipse Ganymede on HPUX (Itanium)
Goto Forum:
  


Current Time: Wed Jul 17 13:24:29 GMT 2024

Powered by FUDForum. Page generated in 0.03553 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top