|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.Button
public abstract class Button
Abstract base class for button components.
Nested Class Summary | |
---|---|
static interface |
Button.DataRenderer
Button data renderer interface. |
static interface |
Button.SelectedBindMapping
Translates between selection state and context data during data binding. |
static class |
Button.State
Enumeration representing a button's selection state. |
static interface |
Button.StateBindMapping
Translates between button state and context data during data binding. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Constructor Summary | |
---|---|
Button()
|
|
Button(Object buttonData)
|
Method Summary | |
---|---|
void |
clear()
Clears any bound values in the component. |
Action |
getAction()
Returns the action associated with this button. |
ListenerList<ButtonBindingListener> |
getButtonBindingListeners()
|
Object |
getButtonData()
|
ButtonGroup |
getButtonGroup()
Returns the button's button group. |
ListenerList<ButtonListener> |
getButtonListeners()
|
ListenerList<ButtonPressListener> |
getButtonPressListeners()
|
ListenerList<ButtonStateListener> |
getButtonStateListeners()
|
Button.DataRenderer |
getDataRenderer()
|
Button.SelectedBindMapping |
getSelectedBindMapping()
|
BindType |
getSelectedBindType()
|
String |
getSelectedKey()
|
Button.State |
getState()
Returns the button's selection state. |
Button.StateBindMapping |
getStateBindMapping()
|
BindType |
getStateBindType()
|
String |
getStateKey()
|
boolean |
isSelected()
Returns the button's selected state. |
boolean |
isToggleButton()
Returns the button's toggle state. |
boolean |
isTriState()
Returns the button's tri-state state. |
void |
load(Object context)
Copies bound values from the bind context to the component. |
void |
press()
"Presses" the button. |
void |
setAction(Action action)
Sets this button's action. |
void |
setAction(String actionID)
Sets this button's action. |
void |
setButtonData(Object buttonData)
|
void |
setButtonGroup(ButtonGroup buttonGroup)
Sets the button's button group. |
void |
setDataRenderer(Button.DataRenderer dataRenderer)
|
void |
setEnabled(boolean enabled)
Sets the component's enabled state. |
void |
setSelected(boolean selected)
Sets the button's selected state. |
void |
setSelectedBindMapping(Button.SelectedBindMapping selectedBindMapping)
|
void |
setSelectedBindType(BindType selectedBindType)
|
void |
setSelectedBindType(String selectedBindType)
|
void |
setSelectedKey(String selectedKey)
|
void |
setState(Button.State state)
Sets the button's selection state. |
void |
setState(String state)
|
void |
setStateBindMapping(Button.StateBindMapping stateBindMapping)
|
void |
setStateBindType(BindType stateBindType)
|
void |
setStateBindType(String stateBindType)
|
void |
setStateKey(String stateKey)
|
void |
setToggleButton(boolean toggleButton)
Sets the button's toggle state. |
void |
setTriState(boolean triState)
Sets the button's tri-state state. |
void |
store(Object context)
Copies bound values from the component to the bind context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Button()
public Button(Object buttonData)
Method Detail |
---|
public Object getButtonData()
public void setButtonData(Object buttonData)
public Button.DataRenderer getDataRenderer()
public void setDataRenderer(Button.DataRenderer dataRenderer)
public Action getAction()
public void setAction(Action action)
action
- The action to be triggered when this button is pressed, or null
for no action.public void setAction(String actionID)
actionID
- The ID of the action to be triggered when this button is pressed.
IllegalArgumentException
- If an action with the given ID does not exist.public void setEnabled(boolean enabled)
Component
setEnabled
in class Component
enabled
- true if the component is enabled; false, otherwise.public void press()
public boolean isSelected()
public void setSelected(boolean selected)
selected
- public Button.State getState()
public void setState(Button.State state)
state
- public void setState(String state)
public boolean isToggleButton()
public void setToggleButton(boolean toggleButton)
toggleButton
- public boolean isTriState()
public void setTriState(boolean triState)
triState
- public ButtonGroup getButtonGroup()
public void setButtonGroup(ButtonGroup buttonGroup)
buttonGroup
- The group to which the button will belong, or null if the button
will not belong to a group.public String getSelectedKey()
public void setSelectedKey(String selectedKey)
public BindType getSelectedBindType()
public void setSelectedBindType(BindType selectedBindType)
public final void setSelectedBindType(String selectedBindType)
public Button.SelectedBindMapping getSelectedBindMapping()
public void setSelectedBindMapping(Button.SelectedBindMapping selectedBindMapping)
public String getStateKey()
public void setStateKey(String stateKey)
public BindType getStateBindType()
public void setStateBindType(BindType stateBindType)
public final void setStateBindType(String stateBindType)
public Button.StateBindMapping getStateBindMapping()
public void setStateBindMapping(Button.StateBindMapping stateBindMapping)
public void load(Object context)
Component
load
in class Component
public void store(Object context)
Component
store
in class Component
public void clear()
Component
clear
in class Component
public ListenerList<ButtonListener> getButtonListeners()
public ListenerList<ButtonStateListener> getButtonStateListeners()
public ListenerList<ButtonPressListener> getButtonPressListeners()
public ListenerList<ButtonBindingListener> getButtonBindingListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |