public final class Controls
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Controls.ToggleControl
A Control for toggling a button model
|
Modifier and Type | Method and Description |
---|---|
static Control |
control(Control.Command command)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
javax.swing.Icon icon)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
javax.swing.Icon icon,
StateObserver enabledState)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name,
StateObserver enabledState)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name,
StateObserver enabledState,
java.lang.String description)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name,
StateObserver enabledState,
java.lang.String description,
int mnemonic)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name,
StateObserver enabledState,
java.lang.String description,
int mnemonic,
javax.swing.KeyStroke keyStroke)
Creates a control based on a
Control.Command |
static Control |
control(Control.Command command,
java.lang.String name,
StateObserver enabledState,
java.lang.String description,
int mnemonic,
javax.swing.KeyStroke keyStroke,
javax.swing.Icon icon)
Creates a control based on a
Control.Command |
static Control |
eventControl(Event<java.awt.event.ActionEvent> event)
Creates a Control which fires the given event on action performed
|
static Controls.ToggleControl |
toggleControl(java.lang.Object owner,
java.lang.String beanPropertyName,
java.lang.String caption)
Creates a toggle control based on the boolean property
beanPropertyName in the owner object |
static Controls.ToggleControl |
toggleControl(java.lang.Object owner,
java.lang.String beanPropertyName,
java.lang.String caption,
EventObserver<java.lang.Boolean> changeEvent)
Creates a toggle control based on the boolean property
beanPropertyName in the owner object |
static Controls.ToggleControl |
toggleControl(java.lang.Object owner,
java.lang.String beanPropertyName,
java.lang.String caption,
EventObserver<java.lang.Boolean> changeEvent,
StateObserver enabledState)
Creates a toggle control based on the boolean property
beanPropertyName in the owner object |
static Controls.ToggleControl |
toggleControl(java.lang.Object owner,
java.lang.String beanPropertyName,
java.lang.String caption,
EventObserver<java.lang.Boolean> changeEvent,
StateObserver enabledState,
boolean tristate)
Creates a toggle control based on the boolean property
beanPropertyName in the owner object |
static Controls.ToggleControl |
toggleControl(State state)
Creates a ToggleControl based on the given
State |
static Controls.ToggleControl |
toggleControl(State state,
java.lang.String name)
Creates a ToggleControl based on the given
State |
static Controls.ToggleControl |
toggleControl(State state,
java.lang.String name,
StateObserver enabledState)
Creates a ToggleControl based on the given
State |
static Controls.ToggleControl |
toggleControl(State state,
java.lang.String name,
StateObserver enabledState,
javax.swing.Icon icon)
Creates a ToggleControl based on the given
State |
static Controls.ToggleControl |
toggleControl(Value<java.lang.Boolean> value)
Creates a ToggleControl based on the given boolean
Value . |
static Controls.ToggleControl |
toggleControl(Value<java.lang.Boolean> value,
java.lang.String name)
Creates a ToggleControl based on the given boolean
Value
If the value is nullable then a TristateButtonModel is used. |
static Controls.ToggleControl |
toggleControl(Value<java.lang.Boolean> value,
java.lang.String name,
StateObserver enabledState)
Creates a ToggleControl based on the given boolean
Value
If the value is nullable then a TristateButtonModel is used. |
static Controls.ToggleControl |
toggleControl(Value<java.lang.Boolean> value,
java.lang.String name,
StateObserver enabledState,
javax.swing.Icon icon)
Creates a ToggleControl based on the given boolean
Value
If the value is nullable then a TristateButtonModel is used. |
public static Control control(Control.Command command)
Control.Command
command
- the Control.Command
on which to base this controlControl.Command
public static Control control(Control.Command command, javax.swing.Icon icon)
Control.Command
command
- the Control.Command
on which to base this controlicon
- the iconControl.Command
public static Control control(Control.Command command, javax.swing.Icon icon, StateObserver enabledState)
Control.Command
command
- the Control.Command
on which to base this controlicon
- the iconenabledState
- the state which controls the enabled state of the controlControl.Command
public static Control control(Control.Command command, java.lang.String name)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlControl.Command
public static Control control(Control.Command command, java.lang.String name, StateObserver enabledState)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlenabledState
- the state which controls the enabled state of the controlControl.Command
public static Control control(Control.Command command, java.lang.String name, StateObserver enabledState, java.lang.String description)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlenabledState
- the state which controls the enabled state of the controldescription
- a string describing the controlControl.Command
public static Control control(Control.Command command, java.lang.String name, StateObserver enabledState, java.lang.String description, int mnemonic)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlenabledState
- the state which controls the enabled state of the controldescription
- a string describing the controlmnemonic
- the control mnemonicControl.Command
public static Control control(Control.Command command, java.lang.String name, StateObserver enabledState, java.lang.String description, int mnemonic, javax.swing.KeyStroke keyStroke)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlenabledState
- the state which controls the enabled state of the controldescription
- a string describing the controlmnemonic
- the control mnemonickeyStroke
- the keystroke to associate with the controlControl.Command
public static Control control(Control.Command command, java.lang.String name, StateObserver enabledState, java.lang.String description, int mnemonic, javax.swing.KeyStroke keyStroke, javax.swing.Icon icon)
Control.Command
command
- the Control.Command
on which to base this controlname
- the name of the controlenabledState
- the state which controls the enabled state of the controldescription
- a string describing the controlmnemonic
- the control mnemonickeyStroke
- the keystroke to associate with the controlicon
- the control iconControl.Command
public static Controls.ToggleControl toggleControl(java.lang.Object owner, java.lang.String beanPropertyName, java.lang.String caption)
beanPropertyName
in the owner objectowner
- the owner objectbeanPropertyName
- the name of the boolean bean property, must have a public setter and gettercaption
- the control captionpublic static Controls.ToggleControl toggleControl(java.lang.Object owner, java.lang.String beanPropertyName, java.lang.String caption, EventObserver<java.lang.Boolean> changeEvent)
beanPropertyName
in the owner objectowner
- the owner objectbeanPropertyName
- the name of the boolean bean property, must have a public setter and gettercaption
- the control captionchangeEvent
- an event fired each time the property value changes in the underlying objectpublic static Controls.ToggleControl toggleControl(java.lang.Object owner, java.lang.String beanPropertyName, java.lang.String caption, EventObserver<java.lang.Boolean> changeEvent, StateObserver enabledState)
beanPropertyName
in the owner objectowner
- the owner objectbeanPropertyName
- the name of the boolean bean property, must have a public setter and gettercaption
- the control captionchangeEvent
- an event fired each time the property value changes in the underlying objectenabledState
- the state which controls the enabled state of the controlpublic static Controls.ToggleControl toggleControl(java.lang.Object owner, java.lang.String beanPropertyName, java.lang.String caption, EventObserver<java.lang.Boolean> changeEvent, StateObserver enabledState, boolean tristate)
beanPropertyName
in the owner objectowner
- the owner objectbeanPropertyName
- the name of the boolean bean property, must have a public setter and gettercaption
- the control captionchangeEvent
- an event fired each time the property value changes in the underlying objectenabledState
- the state which controls the enabled state of the controltristate
- if true then a tristate (false, true, null) button model is usedpublic static Controls.ToggleControl toggleControl(State state)
State
state
- the state to togglepublic static Controls.ToggleControl toggleControl(State state, java.lang.String name)
State
state
- the state to togglename
- the name of this controlpublic static Controls.ToggleControl toggleControl(State state, java.lang.String name, StateObserver enabledState)
State
state
- the state to togglename
- the name of this controlenabledState
- the state which controls the enabled state of the controlpublic static Controls.ToggleControl toggleControl(State state, java.lang.String name, StateObserver enabledState, javax.swing.Icon icon)
State
state
- the state to togglename
- the name of this controlenabledState
- the state which controls the enabled state of the controlicon
- the iconpublic static Controls.ToggleControl toggleControl(Value<java.lang.Boolean> value)
Value
.
If the value is nullable then a TristateButtonModel is used.value
- the value to toggleValueObserver.isNullable()
public static Controls.ToggleControl toggleControl(Value<java.lang.Boolean> value, java.lang.String name)
Value
If the value is nullable then a TristateButtonModel is used.value
- the value to togglename
- the name of this controlValueObserver.isNullable()
public static Controls.ToggleControl toggleControl(Value<java.lang.Boolean> value, java.lang.String name, StateObserver enabledState)
Value
If the value is nullable then a TristateButtonModel is used.value
- the value to togglename
- the name of this controlenabledState
- the state which controls the enabled state of the controlValueObserver.isNullable()
public static Controls.ToggleControl toggleControl(Value<java.lang.Boolean> value, java.lang.String name, StateObserver enabledState, javax.swing.Icon icon)
Value
If the value is nullable then a TristateButtonModel is used.value
- the value to togglename
- the name of this controlenabledState
- the state which controls the enabled state of the controlicon
- the iconValueObserver.isNullable()