Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Content outline context menu
Content outline context menu [message #484219] Fri, 04 September 2009 15:55 Go to next message
Fabio M is currently offline Fabio MFriend
Messages: 25
Registered: July 2009
Junior Member
Hi everybody,

I am trying to add a context (popup) menu to the outline view associated
to an editor.

The outline is created in the standard way using the getAdapter() method
in the editor.

Now the question is what is the standard and suggested way to add a
context menu to the displayed outline in order to perform custom action
on the items shown in the outline?

Thanks,
Fabio
Re: Content outline context menu [message #486297 is a reply to message #484219] Thu, 17 September 2009 08:08 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Fabio Mancinelli wrote:
> Hi everybody,
>
> I am trying to add a context (popup) menu to the outline view
> associated to an editor.
>
> The outline is created in the standard way using the getAdapter()
> method in the editor.
>
> Now the question is what is the standard and suggested way to add a
> context menu to the displayed outline in order to perform custom
> action on the items shown in the outline?
Simply create the menu on your widget(s) and register it with the site.
Here's some sample code taken from the Java outline page:

MenuManager manager= new MenuManager(fContextMenuID,
fContextMenuID);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager m) {
contextMenuAboutToShow(m);
}
});
fMenu= manager.createContextMenu(tree);
tree.setMenu(fMenu);

IPageSite site= getSite();
site.registerContextMenu(JavaPlugin.getPluginId() + ".outline",
manager, fOutlineViewer); //$NON-NLS-1$

Dani
>
> Thanks,
> Fabio
Previous Topic:ComboBox Editor toolbar contribution Problems
Next Topic:duplicate menu item 'open file...'
Goto Forum:
  


Current Time: Thu Apr 25 14:21:04 GMT 2024

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

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

Back to the top