|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.AbstractButton
nextapp.echo.ToggleButton
public abstract class ToggleButton
A base class for stateful buttons, such as radio buttons and checkboxes.
Nested Class Summary | |
---|---|
static class |
ToggleButton.ToggleButtonModel
A ButtonModel for buttons that may be selected. |
Field Summary | |
---|---|
static java.lang.String |
HORIZONTAL_STATE_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String |
HORIZONTAL_STATE_POSITION_CHANGED_PROPERTY
|
static java.lang.String |
STATE_MARGIN_CHANGED_PROPERTY
|
static java.lang.String |
STYLE_HORIZONTAL_STATE_ALIGNMENT
A style constant for the Horizontal State Alignment property. |
static java.lang.String |
STYLE_HORIZONTAL_STATE_POSITION
A style constant for the Horizontal State Position property. |
static java.lang.String |
STYLE_STATE_MARGIN
A style constant for the State Margin property. |
static java.lang.String |
STYLE_VERTICAL_STATE_ALIGNMENT
A style constant for the Vertical State Alignment property. |
static java.lang.String |
STYLE_VERTICAL_STATE_POSITION
A style constant for the Vertical State Position property. |
static java.lang.String |
VERTICAL_STATE_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String |
VERTICAL_STATE_POSITION_CHANGED_PROPERTY
|
Fields inherited from interface nextapp.echo.ToolTipSupport |
---|
TOOL_TIP_TEXT_CHANGED_PROPERTY |
Constructor Summary | |
---|---|
ToggleButton()
Creates an initially unselected toggle button with no text or image. |
|
ToggleButton(ImageReference icon)
Creates a initially unselected toggle button with the specified icon. |
|
ToggleButton(ImageReference icon,
boolean selected)
Creates a toggle button with the specified icon and selection state. |
|
ToggleButton(java.lang.String text)
Creates an initially unselected toggle button with the specified text. |
|
ToggleButton(java.lang.String text,
boolean selected)
Creates a toggle button with the specified text and selection state. |
|
ToggleButton(java.lang.String text,
ImageReference icon,
boolean selected)
Creates a toggle button with the specified text, icon and selection state. |
Method Summary | |
---|---|
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style
object. |
int |
getHorizontalStateAlignment()
Returns the horizontal alignment of the state indicator (check box or radio button) relative to the button. |
int |
getHorizontalStatePosition()
Returns the horizontal position of the state indicator (check box or radio button) relative to the button. |
int |
getStateMargin()
Returns the size of the margin to be displayed between the state indicator of the toggle button and its icon and text. |
int |
getVerticalStateAlignment()
Returns the vertical alignment of the state indicator (check box or radio button) relative to the button. |
int |
getVerticalStatePosition()
Returns the vertical position of the state indicator (check box or radio button) relative to the button. |
void |
setHorizontalStateAlignment(int newValue)
Sets the horizontal alignment of the state indicator relative to the button. |
void |
setHorizontalStatePosition(int newValue)
Sets the horizontal position of the state indicator relative to the button. |
void |
setStateMargin(int newValue)
Sets the size of the margin to be displayed between the state indicator of the toggle button and its icon and text. |
void |
setVerticalStateAlignment(int newValue)
Sets the vertical alignment of the state indicator relative to the button. |
void |
setVerticalStatePosition(int newValue)
Sets the vertical position of the state indicator relative to the button. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STYLE_HORIZONTAL_STATE_ALIGNMENT
public static final java.lang.String STYLE_HORIZONTAL_STATE_POSITION
public static final java.lang.String STYLE_STATE_MARGIN
public static final java.lang.String STYLE_VERTICAL_STATE_ALIGNMENT
public static final java.lang.String STYLE_VERTICAL_STATE_POSITION
public static final java.lang.String HORIZONTAL_STATE_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String HORIZONTAL_STATE_POSITION_CHANGED_PROPERTY
public static final java.lang.String STATE_MARGIN_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_STATE_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_STATE_POSITION_CHANGED_PROPERTY
Constructor Detail |
---|
public ToggleButton()
public ToggleButton(java.lang.String text)
text
- The text to be displayed in the button.public ToggleButton(java.lang.String text, boolean selected)
text
- The text to be displayed in the button.selected
- The selection state of the toggle button.public ToggleButton(ImageReference icon)
icon
- The icon to be displayed in the button.public ToggleButton(ImageReference icon, boolean selected)
icon
- The icon to be displayed in the button.selected
- The selection state of the toggle button.public ToggleButton(java.lang.String text, ImageReference icon, boolean selected)
text
- The text to be displayed in the button.icon
- The icon to be displayed in the button.selected
- The selection state of the toggle button.Method Detail |
---|
public void applyStyle(Style style)
Component
Style
object. The version of this method in Component
will set
foreground and background colors and the font from the style if they are
present. Components should override this method if they allow more
properties to be set from a style object, and should call
super.applyStyle() if necessary.
applyStyle
in interface Component
applyStyle
in class AbstractButton
style
- The style object from which to retrieve properties for this
Component
.Component.applyStyle(Style)
public int getHorizontalStateAlignment()
public int getHorizontalStatePosition()
public int getStateMargin()
public int getVerticalStateAlignment()
public int getVerticalStatePosition()
public void setHorizontalStateAlignment(int newValue)
newValue
- The horizontal alignment of the state indicator
relative to the button, one of the following values.
public void setHorizontalStatePosition(int newValue)
newValue
- The horizontal position of the state indicator
relative to the button, one of the following values.
public void setStateMargin(int newValue)
newValue
- The size of the margin between the state indicator and
the toggle button's icon and text, in pixels.public void setVerticalStateAlignment(int newValue)
newValue
- The vertical alignment of the state indicator
relative to the button, one of the following values.
public void setVerticalStatePosition(int newValue)
newValue
- The vertical position of the state indicator
relative to the button, one of the following values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |