Contributing to Text & Combo Widget Context Menus [message #197814] |
Thu, 19 February 2004 15:30 |
Eclipse User |
|
|
|
Originally posted by: djrobd.aol.com
I have a simple ViewPart which is made up of Label, Text and Combo widgets.
I would like to add a custom action to the default context menu of Text
and Combo widgets. If I create the menu and set it to the widget it
appears behind the default context menu (See example below). How can I
contribute to the existing one or override it?
Text text = new Text(parent, SWT.SINGLE);
MenuManager menuManager = new MenuManager();
menuManager.add(new Action("Test Action") {
public void run() {
System.out.println("***TEST ACTION***");
}
});
Menu menu = menuManager.createContextMenu(text);
text.setMenu(menu);
Thanks for any help you may be able to provide.
Roberto
|
|
|
Powered by
FUDForum. Page generated in 0.04483 seconds