<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ojwiki.soldin.de/index.php?action=history&amp;feed=atom&amp;title=Adding_A_Toolbar_Button</id>
	<title>Adding A Toolbar Button - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ojwiki.soldin.de/index.php?action=history&amp;feed=atom&amp;title=Adding_A_Toolbar_Button"/>
	<link rel="alternate" type="text/html" href="https://ojwiki.soldin.de/index.php?title=Adding_A_Toolbar_Button&amp;action=history"/>
	<updated>2026-06-21T14:55:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://ojwiki.soldin.de/index.php?title=Adding_A_Toolbar_Button&amp;diff=328&amp;oldid=prev</id>
		<title>Mentaer: Created page with &#039;Here&#039;s an example of adding a plugin to the toolbar as a button:   workbenchFrame.getToolBar().addPlugIn(outputWindowPlugIn.getIcon(), outputWindowPlugIn, new MultiEnableCheck(),…&#039;</title>
		<link rel="alternate" type="text/html" href="https://ojwiki.soldin.de/index.php?title=Adding_A_Toolbar_Button&amp;diff=328&amp;oldid=prev"/>
		<updated>2009-10-18T21:55:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;Here&amp;#039;s an example of adding a plugin to the toolbar as a button:   workbenchFrame.getToolBar().addPlugIn(outputWindowPlugIn.getIcon(), outputWindowPlugIn, new MultiEnableCheck(),…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here&amp;#039;s an example of adding a plugin to the toolbar as a button:&lt;br /&gt;
&lt;br /&gt;
 workbenchFrame.getToolBar().addPlugIn(outputWindowPlugIn.getIcon(), outputWindowPlugIn, new MultiEnableCheck(), workbenchContext)&lt;br /&gt;
&lt;br /&gt;
Another way to do it is to use &lt;br /&gt;
 WorkbenchToolBar#add(AbstractButton button, String tooltip, Icon icon, ActionListener actionListener, EnableCheck enableCheck)&lt;br /&gt;
&lt;br /&gt;
Still another way is to use &amp;#039;&amp;#039;WorkbenchToolBar#add(Component)&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[31. Aug 2006]&lt;br /&gt;
&lt;br /&gt;
Hei,&lt;br /&gt;
&lt;br /&gt;
to add a button you need:&lt;br /&gt;
* to specify an icon for you plugin =&amp;gt; xxxPlugIn.getIcon();&lt;br /&gt;
* to add it to the toolbar. For Jump own plugins this is done in &amp;#039;&amp;#039;JumpConfiguration.configureToolBar(final WorkbenchContext workbenchContext, EnableCheckFactory checkFactory)&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WorkbenchFrame frame = workbenchContext.getWorkbench().getFrame();&lt;br /&gt;
    frame.getToolBar().addPlugIn(zoomToSelectedItemsPlugIn.getIcon(),&lt;br /&gt;
               zoomToSelectedItemsPlugIn,&lt;br /&gt;
               ZoomToSelectedItemsPlugIn.createEnableCheck(workbenchContext),&lt;br /&gt;
               workbenchContext);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have access to the OpenJUMP SVN repository you can see an example in the NewTaskPlugIn.java in package com.vividsolutions.jump.workbench.ui.plugin;&lt;br /&gt;
another example .. if you use original JUMP .. may be look on &amp;#039;&amp;#039;ZoomToSelectedItemsPlugIn.java&amp;#039;&amp;#039; in package workbench.ui.zoom&lt;br /&gt;
&lt;br /&gt;
stefan&lt;/div&gt;</summary>
		<author><name>Mentaer</name></author>
	</entry>
</feed>