|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.model.ui.AbstractPresentationModel
com.guiseframework.component.AbstractComponent
com.guiseframework.component.AbstractControl
com.guiseframework.component.AbstractValueControl<V>
V - The type of value to represent.public abstract class AbstractValueControl<V>
Abstract implementation of a control to accept input from the user.
The component valid status is updated before a change in the ValueModel.VALUE_PROPERTY or the ValueModel.VALIDATOR_PROPERTY is fired.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent |
|---|
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Control |
|---|
Control.Status |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.component.ValueControl |
|---|
CONVERTER_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Control |
|---|
STATUS_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Component |
|---|
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Displayable |
|---|
DISPLAYED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.InfoModel |
|---|
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY |
| Fields inherited from interface com.guiseframework.model.LabelModel |
|---|
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Fields inherited from interface com.guiseframework.model.Enableable |
|---|
ENABLED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.ValueModel |
|---|
VALIDATOR_PROPERTY, VALUE_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractValueControl(InfoModel infoModel,
ValueModel<V> valueModel,
Enableable enableable)
Info model, value model, and enableable constructor. |
|
| Method Summary | |
|---|---|
void |
clearValue()
Clears the value by setting the value to null, which may be invalid according to any installed validators. |
protected boolean |
determineValid()
Checks the state of the component for validity. |
V |
getDefaultValue()
|
Validator<V> |
getValidator()
|
V |
getValue()
|
java.lang.Class<V> |
getValueClass()
|
protected ValueModel<V> |
getValueModel()
|
boolean |
isValidValue()
Determines whether the value of this model is valid. |
void |
reset()
Resets the control to its default value. |
void |
resetValue()
Resets the value to a default value, which may be invalid according to any installed validators. |
void |
setValidator(Validator<V> newValidator)
Sets the validator. |
void |
setValue(V newValue)
Sets the new value. |
boolean |
validate()
Validates the user input of this component and all child components. |
void |
validateValue()
Validates the value of this model, throwing an exception if the model is not valid. |
| Methods inherited from class com.guiseframework.component.AbstractControl |
|---|
determineStatus, getEnableable, getStatus, isEnabled, setEnabled, setNotification, setStatus, updateStatus, updateValid |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.guiseframework.component.Control |
|---|
getStatus |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
depict, getDepictID, getSession, processEvent |
| Methods inherited from interface com.guiseframework.model.InfoModel |
|---|
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType |
| Methods inherited from interface com.guiseframework.model.LabelModel |
|---|
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from interface com.guiseframework.model.Enableable |
|---|
isEnabled, setEnabled |
| Constructor Detail |
|---|
public AbstractValueControl(InfoModel infoModel,
ValueModel<V> valueModel,
Enableable enableable)
infoModel - The component info model.valueModel - The component value model.enableable - The enableable object in which to store enabled status.
java.lang.NullPointerException - if the given info model, value model, and/or enableable object is null.| Method Detail |
|---|
protected ValueModel<V> getValueModel()
protected boolean determineValid()
determineValid in class AbstractComponenttrue if the component and all children passes all validity tests, else false.public boolean validate()
validate in interface Componentvalidate in class AbstractComponentAbstractComponent.isValid() as a convenience.public void reset()
reset in interface Controlreset in class AbstractControlresetValue()public V getDefaultValue()
getDefaultValue in interface ValueModel<V>public V getValue()
getValue in interface ValuedComponent<V>getValue in interface Valued<V>getValue in interface ValueModel<V>null if there is no input value.
public void setValue(V newValue)
throws java.beans.PropertyVetoException
equals() method.
If a validator is installed, the value will first be validated before the current value is changed.
Validation always occurs if a validator is installed, even if the value is not changing.
If the value change is vetoed by the installed validator, the validation exception will be accessible via Throwable.getCause().
setValue in interface ValuedComponent<V>setValue in interface Valued<V>setValue in interface ValueModel<V>newValue - The new value.
java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.getValidator(),
ValueModel.VALUE_PROPERTYpublic void clearValue()
null, which may be invalid according to any installed validators.
No validation occurs.
clearValue in interface ValueModel<V>Value#VALUE_PROPERTYpublic void resetValue()
resetValue in interface ValueModel<V>ValueModel.VALUE_PROPERTYpublic Validator<V> getValidator()
getValidator in interface ValueModel<V>null if no validator is installed.public void setValidator(Validator<V> newValidator)
setValidator in interface ValueModel<V>newValidator - The validator for this model, or null if no validator should be used.ValueModel.VALIDATOR_PROPERTYpublic boolean isValidValue()
isValidValue in interface ValueModel<V>
public void validateValue()
throws ValidationException
validateValue in interface ValueModel<V>ValidationException - if the value of this model is not valid.public java.lang.Class<V> getValueClass()
getValueClass in interface ValuedComponent<V>getValueClass in interface ValueModel<V>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||