Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] JFace & MenuManager

There are in fact a few examples in the platform were static context menus 
are used. So this seems to work in general.
There's a comment in BookmarkNavigator:
"// Create dynamic menu mgr.  Dynamic is currently required to
// support action contributions.
MenuManager mgr = new MenuManager();
mgr.setRemoveAllWhenShown(true);"

What does that refer to? Was this a limitation in previous versions?

Knut




"Nick Edgar" <Nick_Edgar@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
04/23/2003 11:30 AM
Please respond to platform-swt-dev

 
        To:     platform-swt-dev@xxxxxxxxxxx
        cc: 
        Subject:        Re: [platform-swt-dev] JFace & MenuManager



There should be no such limitations when using a MenuManager for a context 

menu.
It should be able to populate the context menu just once with the items in 

the menu manager (this would happen when the menu was first popped up).
If this doesn't work for you, please file a bug report against Platform 
UI, with some example code.

Nick





Knut Radloff/Raleigh/IBM@IBMUS
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
04/22/2003 10:36 AM
Please respond to platform-swt-dev

 
        To:     platform-swt-dev@xxxxxxxxxxx
        cc: 
        Subject:        Re: [platform-swt-dev] JFace & MenuManager



Questions about how to use JFace and other plugins should be posted to the 


eclipse.platform newsgroup (eclipse.platform.swt for SWT questions). The 
mailing lists are intended for discussing the development of the plugins 
themselves.
To answer your question, you have to create a dynamic menu if you want to 
use it as a context menu. Search for references to setRemoveAllWhenShown 
for examples. Here's one:
                MenuManager mgr = new MenuManager();
                mgr.setRemoveAllWhenShown(true);
                mgr.addMenuListener(new IMenuListener() {
                        public void menuAboutToShow(IMenuManager mgr) {
                                fillContextMenu(mgr);
                        }
                });

I entered a doc bug to get this added to the doc.

Knut





"Christian Eugster" <christian.eugster@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
04/22/2003 08:37 AM
Please respond to platform-swt-dev

 
        To:     <platform-swt-dev@xxxxxxxxxxx>
        cc: 
        Subject:        [platform-swt-dev] JFace & MenuManager



Hello

I am trying to create a popup-menu in a jface treeView using the jface
menumanager. i did not find enough docs to understand what steps i have to
follow to get it right.

1. I create a treeView and populate it
2. I create a menumanager and populate it with items
3. I use the
tree.getControl().setMenu(menuManager.createContextMenu(tree.getControl()));

but there is no popup visible.

Can anyone help me? thank you!

Christian

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top