|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.swingui.WabitToolBarBuilder
public class WabitToolBarBuilder
A lot of the JToolBars that were being added to Wabit were coded with a lot of boilerplate code. In particular, buttons were having their text set to be at the bottom and centred, and having a client property set to that they would render without button borders on OS X (Leopard and later (hopefully)) Also, each toolbar was being placed with a 'Wabit Logo' button on the right that opens to the support forum. This class is intended to centralize most of the boilerplate code so that making a JToolBar that looks like all the other JToolBars in the Wabit application doesn't require so much repeated code.
| Constructor Summary | |
|---|---|
WabitToolBarBuilder()
Creates a WabitToolBarBuilder with a 'Wabit' button on the end of the toolbar that takes you to the support forum when clicked. |
|
WabitToolBarBuilder(boolean addForumButton)
Creates a WabitToolBarBuilder with the option to add a 'Wabit' button on the end of the toolbar that takes you to the support forum when clicked. |
|
| Method Summary | |
|---|---|
void |
add(javax.swing.Action action)
Adds an Action as a button to the toolbar. |
void |
add(javax.swing.Action a,
java.lang.String text)
Adds an Action as a button to the toolbar. |
void |
add(javax.swing.Action a,
java.lang.String text,
javax.swing.Icon icon)
Add an Action that will be added as a button to the toolbar. |
void |
add(java.awt.Component component)
Add a component to the toolbar. |
void |
add(javax.swing.JButton button)
Add a button to the tool bar. |
void |
add(javax.swing.JButton button,
java.lang.String text,
javax.swing.Icon icon)
Add a button that will be added as a button to the toolbar. |
void |
addSeparator()
Add a separatot to the toolbar. |
void |
clear()
This will remove all of the buttons from the button bar of this tool bar. |
javax.swing.JToolBar |
getToolbar()
Get the final JToolBar component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WabitToolBarBuilder()
public WabitToolBarBuilder(boolean addForumButton)
addForumButton - Set to true to include the Wabit forum button. Set to false to
not include the Wabit forum button.| Method Detail |
|---|
public javax.swing.JToolBar getToolbar()
public void add(javax.swing.Action action)
action - The Action to add to the toolbar. Its name will be the button's label
public void add(javax.swing.Action a,
java.lang.String text)
a - The Action to add to the toolbartext - The text to set as the button's label
If text is null, toolbar button will get name from a
public void add(javax.swing.Action a,
java.lang.String text,
javax.swing.Icon icon)
a - The Action which to add to the ToolBartext - The text to set as the button's label.
If text is null, ToolBar button will get name from aicon - The icon that will be placed on the button. If this is null
then the icon defined in the action will be used.
public void add(javax.swing.JButton button,
java.lang.String text,
javax.swing.Icon icon)
button - The button which to add to the ToolBartext - The text to set as the button's label.
If null, the button's text will not be changed.icon - The icon that will be placed on the button. If this is null
then the icon defined in the action will be used.public void add(javax.swing.JButton button)
public void add(java.awt.Component component)
public void addSeparator()
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||