Reuse the save, new, print toolbar set [message #532224] |
Fri, 07 May 2010 11:30  |
Eclipse User |
|
|
|
Hello there,
I wanted to reuse the toolbar that has the New Project drop-down, the save icon and the print icon in the standard Eclipse install (I am working with 3,5).
Plug-in spy says that it is contributed by org.eclipse.ui.workbench (
org.eclipse.ui.workbench (3.5.1.M20090826-0800a).
How do I go about adding this functionality?
Thanks
Greg
|
|
|
|
|
Re: Reuse the save, new, print toolbar set [message #532751 is a reply to message #532549] |
Tue, 11 May 2010 03:01  |
Eclipse User |
|
|
|
Thanks guys. I was wondering if I could actually define these actions (and the toolbar) as extensions (in the XML)?
FYI I actually used something like this:
protected void makeActions(final IWorkbenchWindow window) {
newWizard = ActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
save = ActionFactory.SAVE.create(window);
print = ActionFactory.PRINT.create(window);
register(newWizard);
register(save);
register(print);
}
protected void fillCoolBar(ICoolBarManager cbManager) {
IToolBarManager fileToolBar = new ToolBarManager(cbManager.getStyle());
fileToolBar.add(newWizard);
fileToolBar.add(save);
fileToolBar.add(print);
cbManager.add(new ToolBarContributionItem(fileToolBar,IWorkbenchActionConstant s.TOOLBAR_FILE));
}
|
|
|
Powered by
FUDForum. Page generated in 0.02869 seconds