|
|||||||||
| 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>
com.guiseframework.component.AbstractEditValueControl<V>
com.guiseframework.component.AbstractTextControl<V>
V - The type of value the input text is to represent.public class AbstractTextControl<V>
Control to accept text input from the user representing a particular value type. This control keeps track of literal text entered by the user, distinct from the value stored in the model. The component valid status is updated before any literal text change event is fired. Default converters are available for the following types:
char[]java.lang.Booleanjava.lang.Floatjava.lang.Integerjava.lang.String
| 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.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Control |
|---|
Control.Status |
| Field Summary | |
|---|---|
static java.lang.String |
AUTO_COMMIT_PATTERN_PROPERTY
The auto commit pattern bound property. |
static java.lang.String |
COLUMN_COUNT_PROPERTY
The column count bound property. |
static java.lang.String |
PROVISIONAL_TEXT_PROPERTY
The provisional text literal bound property. |
static java.lang.String |
TEXT_PROPERTY
The text literal bound property. |
static java.lang.String |
VALUE_CONTENT_TYPE_PROPERTY
The value content type bound property. |
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.component.EditComponent |
|---|
EDITABLE_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.component.ValueControl |
|---|
CONVERTER_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Control |
|---|
STATUS_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Enableable |
|---|
ENABLED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.ValueModel |
|---|
VALIDATOR_PROPERTY, VALUE_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractTextControl(java.lang.Class<V> valueClass)
Value class constructor with a default data model to represent a given type and a default converter. |
|
AbstractTextControl(ValueModel<V> valueModel)
Value model constructor with a default converter. |
|
AbstractTextControl(ValueModel<V> valueModel,
Converter<V,java.lang.String> converter)
Value model and converter constructor. |
|
| Method Summary | |
|---|---|
protected Control.Status |
determineStatus()
Checks the user input status of the control. |
protected boolean |
determineValid()
Checks the state of the component for validity. |
java.util.regex.Pattern |
getAutoCommitPattern()
|
int |
getColumnCount()
|
Converter<V,java.lang.String> |
getConverter()
|
java.lang.String |
getProvisionalText()
|
java.lang.String |
getText()
|
com.globalmentor.net.ContentType |
getValueContentType()
|
void |
reset()
Resets the control to its default value. |
void |
setAutoCommitPattern(java.util.regex.Pattern newAutoCommitPattern)
Sets the The regular expression pattern that will cause the text automatically to be committed immediately. |
void |
setColumnCount(int newColumnCount)
Sets the estimated number of columns requested to be visible. |
void |
setConverter(Converter<V,java.lang.String> newConverter)
Sets the converter. |
void |
setProvisionalText(java.lang.String newProvisionalText)
Sets the provisional text literal value. |
void |
setText(java.lang.String newText)
Sets the text literal value displayed in the control. |
void |
setTextValue(java.lang.String newText)
Sets the text literal value displayed in the control, and then converts the text to an appropriate value and stores it. |
void |
setValueContentType(com.globalmentor.net.ContentType newValueContentType)
Sets the content type of the value. |
protected void |
updateText()
Updates the component text with literal form of the given value. |
boolean |
validate()
Validates the user input of this component and all child components. |
| Methods inherited from class com.guiseframework.component.AbstractEditValueControl |
|---|
addEditListener, fireEdited, fireEdited, isEditable, removeEditListener, setEditable |
| Methods inherited from class com.guiseframework.component.AbstractValueControl |
|---|
clearValue, getDefaultValue, getValidator, getValue, getValueClass, getValueModel, isValidValue, resetValue, setValidator, setValue, validateValue |
| Methods inherited from class com.guiseframework.component.AbstractControl |
|---|
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.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.component.Control |
|---|
getStatus |
| Methods inherited from interface com.guiseframework.model.Enableable |
|---|
isEnabled, setEnabled |
| Field Detail |
|---|
public static final java.lang.String AUTO_COMMIT_PATTERN_PROPERTY
public static final java.lang.String COLUMN_COUNT_PROPERTY
public static final java.lang.String PROVISIONAL_TEXT_PROPERTY
public static final java.lang.String TEXT_PROPERTY
public static final java.lang.String VALUE_CONTENT_TYPE_PROPERTY
| Constructor Detail |
|---|
public AbstractTextControl(java.lang.Class<V> valueClass)
valueClass - The class indicating the type of value held in the model.
java.lang.NullPointerException - if the given value class is null.public AbstractTextControl(ValueModel<V> valueModel)
valueModel - The component data model.
java.lang.NullPointerException - if the given value model is null.
public AbstractTextControl(ValueModel<V> valueModel,
Converter<V,java.lang.String> converter)
valueModel - The component value model.converter - The converter for this component.
java.lang.NullPointerException - if the given value model and/or converter is null.| Method Detail |
|---|
public java.util.regex.Pattern getAutoCommitPattern()
null if text should not be committed during entry.public void setAutoCommitPattern(java.util.regex.Pattern newAutoCommitPattern)
newAutoCommitPattern - The regular expression pattern that will cause the text automatically to be committed immediately, or null if text should not be committed during entry.AUTO_COMMIT_PATTERN_PROPERTYpublic int getColumnCount()
public void setColumnCount(int newColumnCount)
Integer.
newColumnCount - The new requested number of visible columns, or -1 if no column count is specified.COLUMN_COUNT_PROPERTYpublic Converter<V,java.lang.String> getConverter()
public void setConverter(Converter<V,java.lang.String> newConverter)
newConverter - The converter for this component.
java.lang.NullPointerException - if the given converter is null.ValueControl.CONVERTER_PROPERTYpublic java.lang.String getProvisionalText()
null if there is no provisional literal value.public void setProvisionalText(java.lang.String newProvisionalText)
newProvisionalText - The provisional text literal value.PROVISIONAL_TEXT_PROPERTYpublic java.lang.String getText()
null if there is no literal value.public void setText(java.lang.String newText)
newText - The text literal value displayed in the control.TEXT_PROPERTY
public void setTextValue(java.lang.String newText)
throws ConversionException,
java.beans.PropertyVetoException
newText - The new text literal value to display in the control and then convert and store as a value.
ConversionException - if the literal value cannot be converted.
java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.setText(String),
getConverter(),
Converter.convertLiteral(Object),
AbstractValueControl.setValue(Object)public com.globalmentor.net.ContentType getValueContentType()
public void setValueContentType(com.globalmentor.net.ContentType newValueContentType)
newValueContentType - The new value content type.
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.VALUE_CONTENT_TYPE_PROPERTYprotected void updateText()
Converter.convertValue(Object),
AbstractValueControl.getValue(),
setText(String)protected boolean determineValid()
determineValid in class AbstractValueControl<V>true if the component and all children passes all validity tests, else false.getProvisionalText()protected Control.Status determineStatus()
Status#ERROR.
If the provisional literal text can be converted but the converted value is invalid,
the status is determined to be Status#WARNING unless the provisional text is the same as the literal text,
in which case the status is determined to be Status#ERROR.
The default value, even if invalid, is considered valid.
If the control is disabled no status is given.
determineStatus in class AbstractControlgetProvisionalText()public boolean validate()
validate in interface Componentvalidate in class AbstractValueControl<V>AbstractComponent.isValid() as a convenience.public void reset()
reset in interface Controlreset in class AbstractValueControl<V>updateText()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||