Here’s an example of adding a plugin to the toolbar as a button:
workbenchFrame.getToolBar().addPlugIn(outputWindowPlugIn.getIcon(), outputWindowPlugIn, new MultiEnableCheck(), workbenchContext)
Another way to do it is to use WorkbenchToolBar#add(AbstractButton button, String tooltip, Icon icon, ActionListener actionListener, EnableCheck enableCheck)
Still another way is to use WorkbenchToolBar#add(Component)
Hei XXX,
to add a button you need:WorkbenchFrame frame = workbenchContext.getWorkbench().getFrame(); frame.getToolBar().addPlugIn(zoomToSelectedItemsPlugIn.getIcon(), zoomToSelectedItemsPlugIn, ZoomToSelectedItemsPlugIn.createEnableCheck(workbenchContext), workbenchContext);
If you have access to the openjump c-v-s repository you can see an example in the NewTaskPlugIn.java in package com.vividsolutions.jump.workbench.ui.plugin; (which i added on the weekend to the toolbar of OpenJump)
another example .. if you use original JUMP .. may be look on ZoomToSelectedItemsPlugIn.java in package workbench.ui.zoom
stefan