|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
com.jgoodies.uif.component.ToolBarButton
public class ToolBarButton
A JButton subclass intended for use in tool bars. Adds a special configuration to its superclass.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JButton |
---|
JButton.AccessibleJButton |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ToolBarButton()
Constructs a tool bar button without icon. |
|
ToolBarButton(Action action)
Constructs tool bar button and sets properties as described by the given action. |
|
ToolBarButton(Icon icon)
Constructs a tool bar button with the specified icon. |
Method Summary | |
---|---|
static void |
configureButton(AbstractButton button,
boolean borderPainted,
boolean wideMargin)
Configures an AbstractButton for use in a tool bar. |
protected void |
configurePropertiesFromAction(Action a)
Configures the button's properties from the given action. |
Mode |
getBorderPaintedMode()
Returns this button's border painted mode that can be used to change the borderPainted property if the UI changes. |
Mode |
getWideMarginMode()
Returns this button's wide margin mode that can be used to change the button's margin during the configuration. |
void |
setBorderPaintedMode(Mode newMode)
Sets a new border painted mode that can be used to change the borderPainted property if the UI changes. |
void |
setText(String text)
|
void |
setWideMarginMode(Mode newMode)
Sets a new border painted mode that can be used to change the borderPainted property if the UI changes. |
void |
updateUI()
In addition to the superclass behavior that updates the UI this method configures several button properties. |
Methods inherited from class javax.swing.JButton |
---|
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ToolBarButton()
public ToolBarButton(Icon icon)
icon
- the icon for the buttonpublic ToolBarButton(Action action)
action
- provides the properties for this buttonMethod Detail |
---|
public Mode getBorderPaintedMode()
public void setBorderPaintedMode(Mode newMode)
newMode
- the mode to be set
NullPointerException
- if the new mode is null
public Mode getWideMarginMode()
public void setWideMarginMode(Mode newMode)
newMode
- the mode to be set
NullPointerException
- if the new mode is null
public void updateUI()
configureButton(AbstractButton, boolean, boolean)
.
This configuration honors the border painted mode
and the wide margin mode.This method is invoked during the superclass construction and therefore we check for an uninitialized field.
updateUI
in class JButton
public static void configureButton(AbstractButton button, boolean borderPainted, boolean wideMargin)
button
- the button to configureborderPainted
- true to paint a border, false to not paint itwideMargin
- true for a wide margin, false for narrowprotected void configurePropertiesFromAction(Action a)
configurePropertiesFromAction
in class AbstractButton
public void setText(String text)
setText
in class AbstractButton
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |