Adding a predefined popup menu to a TreeViewer without an id [message #631686] |
Fri, 08 October 2010 09:30  |
Eclipse User |
|
|
|
Hi again,
I have unfortunately another problem that I'm at the moment not able to solve.
An already existing plugin provides a view (extension point: org.eclipse.ui.views). There are also extension points for
org.eclipse.ui.commands, org.eclipse.ui.handlers and org.eclipse.ui.menus. To add a popup menu to the view isn't a big deal.
It is possible to define a menuContribution and the locationURI points to the view id. - so far everything is fine and understood.
In addition to that view, I have another use case and I need to open a dialog. This dialog should look and behave almost as the view. The only difference is that only a subset of the context menu entries should be visible.
The dialog contains of a TreeViewer. To this TreeViewer I set the already a ContentProvider, LabelProvider, and Input. The only missing part is the context menu.
As mentioned commands and handlers exist. I need to define my own menu, but my TreeView does not have an id so I can't use: "popup:<view-id>?before=additions".
What would you do to get these already defined handlers to you own view?
Thank you in advance. I look forward to your ideas.
Adrian
|
|
|
|
|
|
Re: Adding a predefined popup menu to a TreeViewer without an id [message #734211 is a reply to message #633570] |
Fri, 07 October 2011 00:50  |
Eclipse User |
|
|
|
Paul Webster wrote on Mon, 18 October 2010 08:46Adrian wrote:
> Thank you that worked fine.
> Can I provide a SelectionProvider for a org.eclipse.jface.dialogs.Dialog?
> Or is there another solution to get the context menu working?
By default no, dialog is not integrated into the window/part based
variables provides.
You could either 1) use property testers in the dialog, which could
query the dialog selection or 2) provide a DialogSelectionSourceProvider
through org.eclipse.ui.services. Then use that as a variable in your
context menu.
PW
Would you be able to expand a little bit on option 2 please?
|
|
|
Powered by
FUDForum. Page generated in 0.03563 seconds