File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes drop down menu in form editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "drop down menu in form editor" Watch "drop down menu in form editor" New topic
Author

drop down menu in form editor

Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
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.


chaithu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drop down menu in form editor