• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

drop down menu in form editor

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

By using below extension point I am able to get drop down menu in views.
But I need to get a drop down menu in form editor and toolbar.

<extension point="org.eclipse.ui.viewActions">
<viewContribution
id="com.aa.bb.cc.dd.views.contribution"
targetID="com.aa.bb.cc.dd.gui.views.AnnotationView">
<action
class="com.aa.bb.cc.dd.gui.actions.HintButtonAction"
icon="icons/help_view.gif"
id="com.aa.bb.cc.dd.gui.actions.HintButtonAction"
label="AnnotationHints"
state="true"
style="pulldown"
toolbarPath="additions"
tooltip="Hints for Compilation View" />
</viewContribution>
</extension>

HintButtonAction
================

public void selectionChanged(IAction action, ISelection selection) {
// Do whatever else you need to do.

// Hook up a menu creator
if (!menuCreatorSet) {
action.setMenuCreator(new IMenuCreator() { // for view menu
public Menu getMenu(Menu parent) {
Menu menu = new Menu(parent);
MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Monkey");
return menu;
}

public Menu getMenu(Control parent) { // for tool bar
Menu menu = new Menu(parent);
MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Monkey");
return menu;
}

public void dispose() {
// Do nothing
}
});
menuCreatorSet = true;
}
}


Please let me know how to add drop down menu in form editor and tool bar.

Thanks,
Sarayu.
 
I'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic