NextApp Echo3
v3.0.b4

nextapp.echo.app.button
Class ToggleButton

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by nextapp.echo.app.button.AbstractButton
          extended by nextapp.echo.app.button.ToggleButton
All Implemented Interfaces:
java.io.Serializable, RenderIdSupport
Direct Known Subclasses:
CheckBox, RadioButton

public abstract class ToggleButton
extends AbstractButton

An abstract base class for on/off toggle button components.

See Also:
Serialized Form

Field Summary
static java.lang.String PROPERTY_DISABLED_SELECTED_STATE_ICON
           
static java.lang.String PROPERTY_DISABLED_STATE_ICON
           
static java.lang.String PROPERTY_PRESSED_SELECTED_STATE_ICON
           
static java.lang.String PROPERTY_PRESSED_STATE_ICON
           
static java.lang.String PROPERTY_ROLLOVER_SELECTED_STATE_ICON
           
static java.lang.String PROPERTY_ROLLOVER_STATE_ICON
           
static java.lang.String PROPERTY_SELECTED_STATE_ICON
           
static java.lang.String PROPERTY_STATE_ALIGNMENT
           
static java.lang.String PROPERTY_STATE_ICON
           
static java.lang.String PROPERTY_STATE_MARGIN
           
static java.lang.String PROPERTY_STATE_POSITION
           
static java.lang.String SELECTED_CHANGED_PROPERTY
           
 
Fields inherited from class nextapp.echo.app.button.AbstractButton
ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_DISABLED_BACKGROUND, PROPERTY_DISABLED_BACKGROUND_IMAGE, PROPERTY_DISABLED_BORDER, PROPERTY_DISABLED_FONT, PROPERTY_DISABLED_FOREGROUND, PROPERTY_DISABLED_ICON, PROPERTY_FOCUSED_BACKGROUND, PROPERTY_FOCUSED_BACKGROUND_IMAGE, PROPERTY_FOCUSED_BORDER, PROPERTY_FOCUSED_ENABLED, PROPERTY_FOCUSED_FONT, PROPERTY_FOCUSED_FOREGROUND, PROPERTY_FOCUSED_ICON, PROPERTY_HEIGHT, PROPERTY_ICON, PROPERTY_ICON_TEXT_MARGIN, PROPERTY_INSETS, PROPERTY_LINE_WRAP, PROPERTY_MODEL, PROPERTY_PRESSED_BACKGROUND, PROPERTY_PRESSED_BACKGROUND_IMAGE, PROPERTY_PRESSED_BORDER, PROPERTY_PRESSED_ENABLED, PROPERTY_PRESSED_FONT, PROPERTY_PRESSED_FOREGROUND, PROPERTY_PRESSED_ICON, PROPERTY_ROLLOVER_BACKGROUND, PROPERTY_ROLLOVER_BACKGROUND_IMAGE, PROPERTY_ROLLOVER_BORDER, PROPERTY_ROLLOVER_ENABLED, PROPERTY_ROLLOVER_FONT, PROPERTY_ROLLOVER_FOREGROUND, PROPERTY_ROLLOVER_ICON, PROPERTY_TEXT, PROPERTY_TEXT_ALIGNMENT, PROPERTY_TEXT_POSITION, PROPERTY_TOOL_TIP_TEXT, PROPERTY_WIDTH
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ToggleButton()
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener to receive notification of state changes, i.e., to the selected state of a ToggleButton.
 void fireStateChanged()
          Notifies all listeners that have registered for this event type.
 ImageReference getDisabledSelectedStateIcon()
          Returns the selected state icon when the button is disabled.
 ImageReference getDisabledStateIcon()
          Returns the default (non-selected) state icon when the button is disabled.
 ImageReference getPressedSelectedStateIcon()
          Returns the selected state icon displayed when the button is being pressed.
 ImageReference getPressedStateIcon()
          Returns the default (non-selected) state icon displayed when the button is being pressed.
 ImageReference getRolloverSelectedStateIcon()
          Returns the selected state icon displayed when the mouse cursor is inside the bounds of the button.
 ImageReference getRolloverStateIcon()
          Returns the default (non-selected) state icon displayed when the mouse cursor is inside the bounds of the button.
 ImageReference getSelectedStateIcon()
          Returns the selected state icon.
 Alignment getStateAlignment()
          Returns the alignment of the state icon relative to the button's text/icon.
 ImageReference getStateIcon()
          Returns the default (non-selected) state icon.
 Extent getStateMargin()
          Returns the margin size between the state icon and the toggle button's icon and/or text.
 Alignment getStatePosition()
          Returns the position of the state icon relative to the button's text/icon.
 boolean isSelected()
          Determines the selection state.
 void processInput(java.lang.String name, java.lang.Object value)
          Processes client input specific to the Component received from the UpdateManager.
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener from being notified of state changes, i.e., to the selected state of a ToggleButton.
 void setDisabledSelectedStateIcon(ImageReference newValue)
          Sets the selected state icon when the button is disabled.
 void setDisabledStateIcon(ImageReference newValue)
          Sets the default (non-selected) state icon when the button is disabled.
 void setModel(ButtonModel newValue)
          Sets the model that this button represents.
 void setPressedSelectedStateIcon(ImageReference newValue)
          Sets the selected state icon displayed when the button is being pressed.
 void setPressedStateIcon(ImageReference newValue)
          Sets the default (non-selected) state icon displayed when the button is being pressed.
 void setRolloverSelectedStateIcon(ImageReference newValue)
          Sets the selected state icon displayed when the mouse cursor is inside the bounds of the button.
 void setRolloverStateIcon(ImageReference newValue)
          Sets the default (non-selected) state icon displayed when the mouse cursor is inside the bounds of the button.
 void setSelected(boolean newValue)
          Sets the selection state.
 void setSelectedStateIcon(ImageReference newValue)
          Sets the selected state icon.
 void setStateAlignment(Alignment newValue)
          Sets the alignment of the state icon relative to the text/icon of the button.
 void setStateIcon(ImageReference newValue)
          Sets the default (non-selected) state icon.
 void setStateMargin(Extent newValue)
          Sets the margin size between the state icon and the toggle button's icon and/or text.
 void setStatePosition(Alignment newValue)
          Sets the position of the state icon relative to the text/icon of the button.
 
Methods inherited from class nextapp.echo.app.button.AbstractButton
addActionListener, doAction, fireActionPerformed, getActionCommand, getAlignment, getBackgroundImage, getBorder, getDisabledBackground, getDisabledBackgroundImage, getDisabledBorder, getDisabledFont, getDisabledForeground, getDisabledIcon, getFocusedBackground, getFocusedBackgroundImage, getFocusedBorder, getFocusedFont, getFocusedForeground, getFocusedIcon, getHeight, getIcon, getIconTextMargin, getInsets, getModel, getPressedBackground, getPressedBackgroundImage, getPressedBorder, getPressedFont, getPressedForeground, getPressedIcon, getRolloverBackground, getRolloverBackgroundImage, getRolloverBorder, getRolloverFont, getRolloverForeground, getRolloverIcon, getText, getTextAlignment, getTextPosition, getToolTipText, getWidth, hasActionListeners, isFocusedEnabled, isLineWrap, isPressedEnabled, isRolloverEnabled, isValidChild, removeActionListener, setActionCommand, setAlignment, setBackgroundImage, setBorder, setDisabledBackground, setDisabledBackgroundImage, setDisabledBorder, setDisabledFont, setDisabledForeground, setDisabledIcon, setFocusedBackground, setFocusedBackgroundImage, setFocusedBorder, setFocusedEnabled, setFocusedFont, setFocusedForeground, setFocusedIcon, setHeight, setIcon, setIconTextMargin, setInsets, setLineWrap, setPressedBackground, setPressedBackgroundImage, setPressedBorder, setPressedEnabled, setPressedFont, setPressedForeground, setPressedIcon, setRolloverBackground, setRolloverBackgroundImage, setRolloverBorder, setRolloverEnabled, setRolloverFont, setRolloverForeground, setRolloverIcon, setText, setTextAlignment, setTextPosition, setToolTipText, setWidth
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_DISABLED_STATE_ICON

public static final java.lang.String PROPERTY_DISABLED_STATE_ICON
See Also:
Constant Field Values

PROPERTY_DISABLED_SELECTED_STATE_ICON

public static final java.lang.String PROPERTY_DISABLED_SELECTED_STATE_ICON
See Also:
Constant Field Values

PROPERTY_PRESSED_STATE_ICON

public static final java.lang.String PROPERTY_PRESSED_STATE_ICON
See Also:
Constant Field Values

PROPERTY_PRESSED_SELECTED_STATE_ICON

public static final java.lang.String PROPERTY_PRESSED_SELECTED_STATE_ICON
See Also:
Constant Field Values

PROPERTY_ROLLOVER_STATE_ICON

public static final java.lang.String PROPERTY_ROLLOVER_STATE_ICON
See Also:
Constant Field Values

PROPERTY_ROLLOVER_SELECTED_STATE_ICON

public static final java.lang.String PROPERTY_ROLLOVER_SELECTED_STATE_ICON
See Also:
Constant Field Values

PROPERTY_STATE_ALIGNMENT

public static final java.lang.String PROPERTY_STATE_ALIGNMENT
See Also:
Constant Field Values

PROPERTY_STATE_ICON

public static final java.lang.String PROPERTY_STATE_ICON
See Also:
Constant Field Values

PROPERTY_STATE_MARGIN

public static final java.lang.String PROPERTY_STATE_MARGIN
See Also:
Constant Field Values

PROPERTY_STATE_POSITION

public static final java.lang.String PROPERTY_STATE_POSITION
See Also:
Constant Field Values

PROPERTY_SELECTED_STATE_ICON

public static final java.lang.String PROPERTY_SELECTED_STATE_ICON
See Also:
Constant Field Values

SELECTED_CHANGED_PROPERTY

public static final java.lang.String SELECTED_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

ToggleButton

public ToggleButton()
Method Detail

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener to receive notification of state changes, i.e., to the selected state of a ToggleButton.

Parameters:
l - the listener to add

fireStateChanged

public void fireStateChanged()
Notifies all listeners that have registered for this event type.


getDisabledSelectedStateIcon

public ImageReference getDisabledSelectedStateIcon()
Returns the selected state icon when the button is disabled.

Returns:
the icon

getDisabledStateIcon

public ImageReference getDisabledStateIcon()
Returns the default (non-selected) state icon when the button is disabled.

Returns:
the icon

getPressedSelectedStateIcon

public ImageReference getPressedSelectedStateIcon()
Returns the selected state icon displayed when the button is being pressed.

Returns:
the icon

getPressedStateIcon

public ImageReference getPressedStateIcon()
Returns the default (non-selected) state icon displayed when the button is being pressed.

Returns:
the icon

getRolloverSelectedStateIcon

public ImageReference getRolloverSelectedStateIcon()
Returns the selected state icon displayed when the mouse cursor is inside the bounds of the button.

Returns:
the icon

getRolloverStateIcon

public ImageReference getRolloverStateIcon()
Returns the default (non-selected) state icon displayed when the mouse cursor is inside the bounds of the button.

Returns:
the icon

getSelectedStateIcon

public ImageReference getSelectedStateIcon()
Returns the selected state icon.

Returns:
the icon

getStateAlignment

public Alignment getStateAlignment()
Returns the alignment of the state icon relative to the button's text/icon.

Returns:
the state alignment

getStateIcon

public ImageReference getStateIcon()
Returns the default (non-selected) state icon.

Returns:
the icon

getStateMargin

public Extent getStateMargin()
Returns the margin size between the state icon and the toggle button's icon and/or text. The margin will only be displayed in the case where icon and/or text are present. This property only supports Extents with fixed (i.e., not percent) units.

Returns:
the margin size

getStatePosition

public Alignment getStatePosition()
Returns the position of the state icon relative to the button's text/icon.

Returns:
the state position

isSelected

public boolean isSelected()
Determines the selection state.

Returns:
the selection state

processInput

public void processInput(java.lang.String name,
                         java.lang.Object value)
Description copied from class: Component
Processes client input specific to the Component received from the UpdateManager. Derivative implementations should take care to invoke super.processInput(). Security note: Because input to this method is likely from a remote client, it should be treated as potentially hostile. All input to this method should be carefully verified. For example, directly invoking set() method with the provided input would constitute a security hole.

Overrides:
processInput in class AbstractButton
Parameters:
name - the name of the input
value - the value of the input
See Also:
Component.processInput(java.lang.String, java.lang.Object)

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from being notified of state changes, i.e., to the selected state of a ToggleButton.

Parameters:
l - the listener to remove

setDisabledSelectedStateIcon

public void setDisabledSelectedStateIcon(ImageReference newValue)
Sets the selected state icon when the button is disabled.

Parameters:
newValue - the new icon

setDisabledStateIcon

public void setDisabledStateIcon(ImageReference newValue)
Sets the default (non-selected) state icon when the button is disabled.

Parameters:
newValue - the new icon

setModel

public void setModel(ButtonModel newValue)
Description copied from class: AbstractButton
Sets the model that this button represents. The model may not be null.

Overrides:
setModel in class AbstractButton
Parameters:
newValue - the new ButtonModel
See Also:
AbstractButton.setModel(nextapp.echo.app.button.ButtonModel)

setPressedSelectedStateIcon

public void setPressedSelectedStateIcon(ImageReference newValue)
Sets the selected state icon displayed when the button is being pressed.

Parameters:
newValue - the new icon

setPressedStateIcon

public void setPressedStateIcon(ImageReference newValue)
Sets the default (non-selected) state icon displayed when the button is being pressed.

Parameters:
newValue - the new icon

setRolloverSelectedStateIcon

public void setRolloverSelectedStateIcon(ImageReference newValue)
Sets the selected state icon displayed when the mouse cursor is inside the bounds of the button.

Parameters:
newValue - the new icon

setRolloverStateIcon

public void setRolloverStateIcon(ImageReference newValue)
Sets the default (non-selected) state icon displayed when the mouse cursor is inside the bounds of the button.

Parameters:
newValue - the new icon

setSelectedStateIcon

public void setSelectedStateIcon(ImageReference newValue)
Sets the selected state icon.

Parameters:
newValue - the new icon

setSelected

public void setSelected(boolean newValue)
Sets the selection state.

Parameters:
newValue - the new selection state

setStateAlignment

public void setStateAlignment(Alignment newValue)
Sets the alignment of the state icon relative to the text/icon of the button. Note that only one of the provided Alignment's settings should be non-default.

Parameters:
newValue - the new state alignment

setStateIcon

public void setStateIcon(ImageReference newValue)
Sets the default (non-selected) state icon.

Parameters:
newValue - the new icon

setStateMargin

public void setStateMargin(Extent newValue)
Sets the margin size between the state icon and the toggle button's icon and/or text. The margin will only be displayed in the case where icon and/or text are present. This property only supports Extents with fixed (i.e., not percent) units.

Parameters:
newValue - the new margin size

setStatePosition

public void setStatePosition(Alignment newValue)
Sets the position of the state icon relative to the text/icon of the button. Note that only one of the provided Alignment's settings should be non-default.

Parameters:
newValue - the new state position

NextApp Echo3
v3.0.b4