Package io.guise.framework.prototype
Class ValuePrototype<V>
java.lang.Object
com.globalmentor.beans.BoundPropertyObject
io.guise.framework.model.AbstractModel
io.guise.framework.model.AbstractValueModel<V>
io.guise.framework.model.DefaultValueModel<V>
io.guise.framework.prototype.ValuePrototype<V>
- Type Parameters:
V
- The type of value contained in the model.
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,com.globalmentor.model.MutableValued<V>
,com.globalmentor.model.Valued<V>
,Enableable
,InfoModel
,LabelModel
,Model
,ValueModel<V>
,Prototype
- Direct Known Subclasses:
TogglePrototype
public class ValuePrototype<V>
extends DefaultValueModel<V>
implements Prototype, InfoModel, Enableable
Contains prototype information for a value control.
- Author:
- Garret Wilson
-
Field Summary
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
Fields inherited from interface io.guise.framework.model.Enableable
ENABLED_PROPERTY
Fields inherited from interface io.guise.framework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
Fields inherited from interface io.guise.framework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
Fields inherited from interface io.guise.framework.model.ValueModel
VALIDATOR_PROPERTY, VALUE_PROPERTY
-
Constructor Summary
ConstructorsConstructorDescriptionValuePrototype
(Class<V> valueClass) Value class constructor with anull
default value.ValuePrototype
(Class<V> valueClass, String label) Value class and label constructor with anull
default value.ValuePrototype
(Class<V> valueClass, String label, URI icon) Value class, label, and icon constructor with anull
default value.ValuePrototype
(Class<V> valueClass, V defaultValue) Value class and default value constructor.ValuePrototype
(Class<V> valueClass, V defaultValue, String label) Value class, default value, and label constructor.Value class, default value, label, and icon constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.globalmentor.net.MediaType
getInfo()
com.globalmentor.net.MediaType
getLabel()
com.globalmentor.net.MediaType
boolean
void
setDescription
(String newDescription) Sets the description text, such as might appear in a flyover.void
setDescriptionContentType
(com.globalmentor.net.MediaType newDescriptionContentType) Sets the content type of the description text.void
setEnabled
(boolean newEnabled) Sets whether the object is enabled and can receive user input.void
setGlyphURI
(URI newIcon) Sets the URI of the icon.void
Sets the advisory information text, such as might appear in a tooltip.void
setInfoContentType
(com.globalmentor.net.MediaType newInfoContentType) Sets the content type of the advisory information text.void
Sets the text of the label.void
setLabelContentType
(com.globalmentor.net.MediaType newLabelTextContentType) Sets the content type of the label text.Methods inherited from class io.guise.framework.model.DefaultValueModel
clearValue, getDefaultValue, getValue, resetValue, setValue
Methods inherited from class io.guise.framework.model.AbstractValueModel
createPropertyVetoException, getValidator, getValueClass, isValidValue, setValidator, validateValue
Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
-
Constructor Details
-
ValuePrototype
Value class constructor with anull
default value.- Parameters:
valueClass
- The class indicating the type of value held in the model.- Throws:
NullPointerException
- if the given value class isnull
.
-
ValuePrototype
Value class and default value constructor.- Parameters:
valueClass
- The class indicating the type of value held in the model.defaultValue
- The default value, which will not be validated.- Throws:
NullPointerException
- if the given value class isnull
.
-
ValuePrototype
Value class and label constructor with anull
default value.- Parameters:
valueClass
- The class indicating the type of value held in the model.label
- The text of the label, ornull
if there should be no label.- Throws:
NullPointerException
- if the given value class isnull
.
-
ValuePrototype
Value class, default value, and label constructor.- Parameters:
valueClass
- The class indicating the type of value held in the model.defaultValue
- The default value, which will not be validated.label
- The text of the label, ornull
if there should be no label.- Throws:
NullPointerException
- if the given value class isnull
.
-
ValuePrototype
Value class, label, and icon constructor with anull
default value.- Parameters:
valueClass
- The class indicating the type of value held in the model.label
- The text of the label, ornull
if there should be no label.icon
- The icon URI, which may be a resource URI, ornull
if there is no icon URI.- Throws:
NullPointerException
- if the given value class isnull
.
-
ValuePrototype
Value class, default value, label, and icon constructor.- Parameters:
valueClass
- The class indicating the type of value held in the model.defaultValue
- The default value, which will not be validated.label
- The text of the label, ornull
if there should be no label.icon
- The icon URI, which may be a resource URI, ornull
if there is no icon URI.- Throws:
NullPointerException
- if the given value class isnull
.
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceEnableable
- Returns:
- Whether the object is enabled and can receive user input.
-
setEnabled
public void setEnabled(boolean newEnabled) Description copied from interface:Enableable
Sets whether the object is enabled and can receive user input. This is a bound property of typeBoolean
.- Specified by:
setEnabled
in interfaceEnableable
- Parameters:
newEnabled
-true
if the object should indicate and accept user input.- See Also:
-
getGlyphURI
- Specified by:
getGlyphURI
in interfaceLabelModel
- Returns:
- The glyph URI, which may be a resource URI, or
null
if there is no glyph URI.
-
setGlyphURI
Description copied from interface:LabelModel
Sets the URI of the icon. This is a bound property.- Specified by:
setGlyphURI
in interfaceLabelModel
- Parameters:
newIcon
- The new URI of the icon, which may be a resource URI.- See Also:
-
getLabel
- Specified by:
getLabel
in interfaceLabelModel
- Returns:
- The label text, which may include a resource reference, or
null
if there is no label text.
-
setLabel
Description copied from interface:LabelModel
Sets the text of the label. This is a bound property.- Specified by:
setLabel
in interfaceLabelModel
- Parameters:
newLabelText
- The new text of the label, which may include a resource reference.- See Also:
-
getLabelContentType
public com.globalmentor.net.MediaType getLabelContentType()- Specified by:
getLabelContentType
in interfaceLabelModel
- Returns:
- The content type of the label text.
-
setLabelContentType
public void setLabelContentType(com.globalmentor.net.MediaType newLabelTextContentType) Description copied from interface:LabelModel
Sets the content type of the label text. This is a bound property.- Specified by:
setLabelContentType
in interfaceLabelModel
- Parameters:
newLabelTextContentType
- The new label text content type.- See Also:
-
getDescription
- Specified by:
getDescription
in interfaceInfoModel
- Returns:
- The description text, such as might appear in a flyover, or
null
if there is no description.
-
setDescription
Description copied from interface:InfoModel
Sets the description text, such as might appear in a flyover. This is a bound property.- Specified by:
setDescription
in interfaceInfoModel
- Parameters:
newDescription
- The new text of the description, such as might appear in a flyover.- See Also:
-
getDescriptionContentType
public com.globalmentor.net.MediaType getDescriptionContentType()- Specified by:
getDescriptionContentType
in interfaceInfoModel
- Returns:
- The content type of the description text.
-
setDescriptionContentType
public void setDescriptionContentType(com.globalmentor.net.MediaType newDescriptionContentType) Description copied from interface:InfoModel
Sets the content type of the description text. This is a bound property.- Specified by:
setDescriptionContentType
in interfaceInfoModel
- Parameters:
newDescriptionContentType
- The new description text content type.- See Also:
-
getInfo
-
setInfo
Description copied from interface:InfoModel
Sets the advisory information text, such as might appear in a tooltip. This is a bound property. -
getInfoContentType
public com.globalmentor.net.MediaType getInfoContentType()- Specified by:
getInfoContentType
in interfaceInfoModel
- Returns:
- The content type of the advisory information text.
-
setInfoContentType
public void setInfoContentType(com.globalmentor.net.MediaType newInfoContentType) Description copied from interface:InfoModel
Sets the content type of the advisory information text. This is a bound property.- Specified by:
setInfoContentType
in interfaceInfoModel
- Parameters:
newInfoContentType
- The new advisory information text content type.- See Also:
-