[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: How to add Popup menu to a new view.
|
Trevor,
Look at the method ResourceNavigator#fillContextMenu for an example of what you want to do. Look also at the reference to this
method to understand how the menu is created and popuplated.
You should remember to register this context menu and give it an ID (typically, the id is the same as the view id). Also, include
the IWorkbenchActionConstants.MB_ADDITIONS group. All of this will allow other plugin developers to extend your context menu. Look
at the method ResourceNavigator#createPartControl to see how the context menu is being registered.
Simon :-)
"Trevor" <trevor_campbell@xxxxxxxxxx> wrote in message news:9njckh$h6m$1@xxxxxxxxxxxxxxxx
> I'm new to eclipse and am developing a plugin using the PDE. I have a new
> view containing a tree viewer and would like to add a popup menu that shows
> different options/actions depending on the type of tree node selected. Can
> I add the menu just be adding entries to plugin.xml and if so what entries
> do I need? I have tried adding an object contribution but have not been
> able to get a popup menu to show.
>
> Are there any good examples of how to use the TreeViewer classes. I have
> been looking at the navigator code, but it is very complex and does much
> more thatn my farily simple task requires.
>
> Trevor Campbell
> Kaz Computer Services
>
>