|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.uif.builder.ToolBarBuilder
public class ToolBarBuilder
A builder that reduces the effort required to build, configure and fill a JToolBar with buttons and gaps. Provides several convenience methods that implicitly create buttons specialized for toolbars or implicitly configure buttons to automatically handle typical platforms differences.
Subclasses can override the default toolbar configuration in
#configureToolBar
and can override the creation methods
#add*
.
Action
,
ToggleAction
,
ToolBarButton
,
ToolBarToggleButton
,
MenuBuilder
Constructor Summary | |
---|---|
ToolBarBuilder()
Constructs a tool bar builder for a tool bar without name. |
|
ToolBarBuilder(JToolBar toolBar)
Constructs a tool bar builder for the given tool bar. |
|
ToolBarBuilder(String name)
Constructs a tool bar builder for a tool bar with the given name. |
|
ToolBarBuilder(String name,
Object headerStyleOrName)
Constructs a tool bar builder for tool bar with the given name and header style. |
Method Summary | |
---|---|
JButton |
add(Action action)
Creates, adds and returns a ToolBarButton that is configured using the given Action . |
Component |
add(Component component)
Adds a component to this builder's tool bar and returns the component. |
void |
add(PopupButton button)
Adds a popup button to this builder's tool bar. |
void |
addGap()
Adds a gap to the tool bar. |
void |
addGap(int size)
Adds a gap to the tool bar. |
void |
addGlue()
Adds a glue component to this builder's tool bar. |
void |
addLargeGap()
Adds a large gap to the tool bar. |
void |
addSeparator()
Adds a separator to this builder's tool bar. |
JToggleButton |
addToggle(ToggleAction toggleAction)
Creates, adds and returns a ToolBarToggleButton that is configured using the given ToggleAction . |
protected void |
configureToolBar()
Sets default settings for the tool bar's rollover and floatable properties: rollover and non-floatable. |
static Mode |
getBorderPaintedDefaultMode()
Returns the border painted default mode that is used to initialize the borderPaintedMode property. |
Mode |
getBorderPaintedMode()
Returns this builder's border painted mode that is used to set the border painted mode in implicitly created tool bar buttons. |
JToolBar |
getToolBar()
Returns the tool bar that is built by this builder. |
static Mode |
getWideMarginDefaultMode()
Returns the wide margin default mode that is used to initialize the wideMarginMode property. |
Mode |
getWideMarginMode()
Returns this builder's wide margin mode that is used to set the wide margin mode in implicitly created tool bar buttons. |
static void |
setBorderPaintedDefaultMode(Mode newDefaultMode)
Sets a new border painted default mode that is used to initialize the borderPaintedMode property. |
void |
setBorderPaintedMode(Mode newMode)
Sets a new border painted mode that is used to set the border painted mode in implicitly created tool bar buttons. |
void |
setBorderStyle(Object borderStyleOrName)
Sets the JGoodies Looks border style as object or by name. |
void |
setHeaderStyle(Object headerStyleOrName)
Sets the JGoodies Looks header style as object or by name. |
static void |
setWideMarginDefaultMode(Mode newDefaultMode)
Sets a new wide margin default mode that is used to initialize the wideMarginMode property. |
void |
setWideMarginMode(Mode newMode)
Sets a new wide margin mode that is used to set the border painted mode in implicitly created tool bar buttons. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolBarBuilder()
public ToolBarBuilder(String name)
name
- the name for the built tool barpublic ToolBarBuilder(String name, Object headerStyleOrName)
name
- the name for the built tool barheaderStyleOrName
- the style applied to the built tool barpublic ToolBarBuilder(JToolBar toolBar)
#configureToolBar
.
toolBar
- the toolbar used to buildMethod Detail |
---|
public static Mode getBorderPaintedDefaultMode()
public static void setBorderPaintedDefaultMode(Mode newDefaultMode)
newDefaultMode
- the border painted default mode to be setpublic static Mode getWideMarginDefaultMode()
public static void setWideMarginDefaultMode(Mode newDefaultMode)
newDefaultMode
- the wide margin default mode to be setpublic final Mode getBorderPaintedMode()
public final void setBorderPaintedMode(Mode newMode)
newMode
- the border painted mode to be setpublic final Mode getWideMarginMode()
public final void setWideMarginMode(Mode newMode)
newMode
- the wide margin mode to be setpublic final JToolBar getToolBar()
protected void configureToolBar()
Subclasses may override to implement a different default configuration.
public final void setBorderStyle(Object borderStyleOrName)
borderStyleOrName
- a com.jgoodies.looks.BorderStyle or its namepublic final void setHeaderStyle(Object headerStyleOrName)
headerStyleOrName
- a com.jgoodies.looks.HeaderStyle or its namepublic void addGap()
public void addLargeGap()
public void addGap(int size)
size
- the gap size in pixelpublic void addGlue()
public void addSeparator()
public void add(PopupButton button)
button
- the popup button to be addedpublic Component add(Component component)
component
- the component to be added
public JButton add(Action action)
Action
.
action
- an action that describes a button
IllegalArgumentException
- if the action is an instance
of ToggleAction
public JToggleButton addToggle(ToggleAction toggleAction)
ToggleAction
.
toggleAction
- an action that describes a toggle and provides a model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |