Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » dynamic context menu
dynamic context menu [message #249138] Thu, 03 June 2004 21:21 Go to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
We have a set of dynamic actions that are created in code when a new
selection is chosen from our view. The actions are displayed in the
context menu when you right click the selected item.

Here is a typical entry:

ContextMenuAction createNewMap = new ContextMenuAction(object);

createNewMap.setText("create map");
createNewMap.setImageDescriptor(WorkbenchImages.getImageDesc riptor(IWorkbenchGraphicConstants.IMG_CTOOL_HOME_NAV));
createNewMap.setHoverImageDescriptor(WorkbenchImages.getImag eDescriptor(IWorkbenchGraphicConstants.IMG_CTOOL_HOME_NAV_HO VER));

actionList.add(createNewMap);

I want to create a context menu that has a sub menu so it might look like
this:

create->map
object
list

How do you go about displaying the text to have a nested menu on the right
context menu?
Re: dynamic context menu [message #249179 is a reply to message #249138] Fri, 04 June 2004 01:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paull.NOSPAMcodetelligence.com

Something like:
MenuManager menuInsertCharacters = new MenuManager("Insert", "idInsert");
parentMenu.add(menuInsertCharacters);
menuInsertCharacters.add(actionInsertXMLComment);

Paul
www.codetelligence.com
"NG" <neilg@avaya.com> wrote in message news:c9o4o3$ebl$1@eclipse.org...
> We have a set of dynamic actions that are created in code when a new
> selection is chosen from our view. The actions are displayed in the
> context menu when you right click the selected item.
>
> Here is a typical entry:
>
> ContextMenuAction createNewMap = new ContextMenuAction(object);
>
> createNewMap.setText("create map");
>
createNewMap.setImageDescriptor(WorkbenchImages.getImageDesc riptor(IWorkbenc
hGraphicConstants.IMG_CTOOL_HOME_NAV));
>
createNewMap.setHoverImageDescriptor(WorkbenchImages.getImag eDescriptor(IWor
kbenchGraphicConstants.IMG_CTOOL_HOME_NAV_HOVER));
>
> actionList.add(createNewMap);
>
> I want to create a context menu that has a sub menu so it might look like
> this:
>
> create->map
> object
> list
>
> How do you go about displaying the text to have a nested menu on the right
> context menu?
>
>
>
Re: dynamic context menu [message #249502 is a reply to message #249179] Fri, 04 June 2004 14:20 Go to previous message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
Great! Worked like a charm.

thanks


Paul L wrote:

> Something like:
> MenuManager menuInsertCharacters = new MenuManager("Insert", "idInsert");
> parentMenu.add(menuInsertCharacters);
> menuInsertCharacters.add(actionInsertXMLComment);

> Paul
> www.codetelligence.com
> "NG" <neilg@avaya.com> wrote in message news:c9o4o3$ebl$1@eclipse.org...
> > We have a set of dynamic actions that are created in code when a new
> > selection is chosen from our view. The actions are displayed in the
> > context menu when you right click the selected item.
> >
> > Here is a typical entry:
> >
> > ContextMenuAction createNewMap = new ContextMenuAction(object);
> >
> > createNewMap.setText("create map");
> >
> createNewMap.setImageDescriptor(WorkbenchImages.getImageDesc riptor(IWorkbenc
> hGraphicConstants.IMG_CTOOL_HOME_NAV));
> >
> createNewMap.setHoverImageDescriptor(WorkbenchImages.getImag eDescriptor(IWor
> kbenchGraphicConstants.IMG_CTOOL_HOME_NAV_HOVER));
> >
> > actionList.add(createNewMap);
> >
> > I want to create a context menu that has a sub menu so it might look like
> > this:
> >
> > create->map
> > object
> > list
> >
> > How do you go about displaying the text to have a nested menu on the right
> > context menu?
> >
> >
> >
Previous Topic:Changing Eclipse window title
Next Topic:install/update proxy connection needs password
Goto Forum:
  


Current Time: Tue Jul 16 13:23:54 GMT 2024

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

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

Back to the top