com.guiseframework.prototype
Class ValuePrototype<V>

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.model.AbstractModel
          extended by com.guiseframework.model.AbstractValueModel<V>
              extended by com.guiseframework.model.DefaultValueModel<V>
                  extended by com.guiseframework.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, Enableable, InfoModel, LabelModel, Model, Valued<V>, 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 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
ValuePrototype(java.lang.Class<V> valueClass)
          Value class constructor with a null default value.
ValuePrototype(java.lang.Class<V> valueClass, java.lang.String label)
          Value class and label constructor with a null default value.
ValuePrototype(java.lang.Class<V> valueClass, java.lang.String label, java.net.URI icon)
          Value class, label, and icon constructor with a null default value.
ValuePrototype(java.lang.Class<V> valueClass, V defaultValue)
          Value class and default value constructor.
ValuePrototype(java.lang.Class<V> valueClass, V defaultValue, java.lang.String label)
          Value class, default value, and label constructor.
ValuePrototype(java.lang.Class<V> valueClass, V defaultValue, java.lang.String label, java.net.URI icon)
          Value class, default value, label, and icon constructor.
 
Method Summary
 java.lang.String getDescription()
           
 com.globalmentor.net.ContentType getDescriptionContentType()
           
 java.net.URI getGlyphURI()
           
 java.lang.String getInfo()
           
 com.globalmentor.net.ContentType getInfoContentType()
           
 java.lang.String getLabel()
           
 com.globalmentor.net.ContentType getLabelContentType()
           
 boolean isEnabled()
           
 void setDescription(java.lang.String newDescription)
          Sets the description text, such as might appear in a flyover.
 void setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
          Sets the content type of the description text.
 void setEnabled(boolean newEnabled)
          Sets whether the control is enabled and and can receive user input.
 void setGlyphURI(java.net.URI newIcon)
          Sets the URI of the icon.
 void setInfo(java.lang.String newInfo)
          Sets the advisory information text, such as might appear in a tooltip.
 void setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
          Sets the content type of the advisory information text.
 void setLabel(java.lang.String newLabelText)
          Sets the text of the label.
 void setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
          Sets the content type of the label text.
 
Methods inherited from class com.guiseframework.model.DefaultValueModel
clearValue, getDefaultValue, getValue, resetValue, setValue
 
Methods inherited from class com.guiseframework.model.AbstractValueModel
createPropertyVetoException, getValidator, getValueClass, isValidValue, setValidator, validateValue
 
Methods inherited from class com.guiseframework.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 Detail

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass)
Value class constructor with a null default value.

Parameters:
valueClass - The class indicating the type of value held in the model.
Throws:
java.lang.NullPointerException - if the given value class is null.

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass,
                      V defaultValue)
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:
java.lang.NullPointerException - if the given value class is null.

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass,
                      java.lang.String label)
Value class and label constructor with a null default value.

Parameters:
valueClass - The class indicating the type of value held in the model.
label - The text of the label, or null if there should be no label.
Throws:
java.lang.NullPointerException - if the given value class is null.

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass,
                      V defaultValue,
                      java.lang.String label)
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, or null if there should be no label.
Throws:
java.lang.NullPointerException - if the given value class is null.

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass,
                      java.lang.String label,
                      java.net.URI icon)
Value class, label, and icon constructor with a null default value.

Parameters:
valueClass - The class indicating the type of value held in the model.
label - The text of the label, or null if there should be no label.
icon - The icon URI, which may be a resource URI, or null if there is no icon URI.
Throws:
java.lang.NullPointerException - if the given value class is null.

ValuePrototype

public ValuePrototype(java.lang.Class<V> valueClass,
                      V defaultValue,
                      java.lang.String label,
                      java.net.URI icon)
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, or null if there should be no label.
icon - The icon URI, which may be a resource URI, or null if there is no icon URI.
Throws:
java.lang.NullPointerException - if the given value class is null.
Method Detail

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Enableable
Returns:
Whether the control is enabled and can receive user input.

setEnabled

public void setEnabled(boolean newEnabled)
Sets whether the control is enabled and and can receive user input. This is a bound property of type Boolean.

Specified by:
setEnabled in interface Enableable
Parameters:
newEnabled - true if the control should indicate and accept user input.
See Also:
Enableable.ENABLED_PROPERTY

getGlyphURI

public java.net.URI getGlyphURI()
Specified by:
getGlyphURI in interface LabelModel
Returns:
The icon URI, which may be a resource URI, or null if there is no icon URI.

setGlyphURI

public void setGlyphURI(java.net.URI newIcon)
Sets the URI of the icon. This is a bound property of type URI.

Specified by:
setGlyphURI in interface LabelModel
Parameters:
newIcon - The new URI of the icon, which may be a resource URI.
See Also:
LabelModel.GLYPH_URI_PROPERTY

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in interface LabelModel
Returns:
The label text, which may include a resource reference, or null if there is no label text.

setLabel

public void setLabel(java.lang.String newLabelText)
Sets the text of the label. This is a bound property.

Specified by:
setLabel in interface LabelModel
Parameters:
newLabelText - The new text of the label, which may include a resource reference.
See Also:
LabelModel.LABEL_PROPERTY

getLabelContentType

public com.globalmentor.net.ContentType getLabelContentType()
Specified by:
getLabelContentType in interface LabelModel
Returns:
The content type of the label text.

setLabelContentType

public void setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
Sets the content type of the label text. This is a bound property.

Specified by:
setLabelContentType in interface LabelModel
Parameters:
newLabelTextContentType - The new label text content type.
Throws:
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.
See Also:
LabelModel.LABEL_CONTENT_TYPE_PROPERTY

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface InfoModel
Returns:
The description text, such as might appear in a flyover, or null if there is no description.

setDescription

public void setDescription(java.lang.String newDescription)
Sets the description text, such as might appear in a flyover. This is a bound property.

Specified by:
setDescription in interface InfoModel
Parameters:
newDescription - The new text of the description, such as might appear in a flyover.
See Also:
InfoModel.DESCRIPTION_PROPERTY

getDescriptionContentType

public com.globalmentor.net.ContentType getDescriptionContentType()
Specified by:
getDescriptionContentType in interface InfoModel
Returns:
The content type of the description text.

setDescriptionContentType

public void setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
Sets the content type of the description text. This is a bound property.

Specified by:
setDescriptionContentType in interface InfoModel
Parameters:
newDescriptionContentType - The new description text content type.
Throws:
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.
See Also:
InfoModel.DESCRIPTION_CONTENT_TYPE_PROPERTY

getInfo

public java.lang.String getInfo()
Specified by:
getInfo in interface InfoModel
Returns:
The advisory information text, such as might appear in a tooltip, or null if there is no advisory information.

setInfo

public void setInfo(java.lang.String newInfo)
Sets the advisory information text, such as might appear in a tooltip. This is a bound property.

Specified by:
setInfo in interface InfoModel
Parameters:
newInfo - The new text of the advisory information, such as might appear in a tooltip.
See Also:
InfoModel.INFO_PROPERTY

getInfoContentType

public com.globalmentor.net.ContentType getInfoContentType()
Specified by:
getInfoContentType in interface InfoModel
Returns:
The content type of the advisory information text.

setInfoContentType

public void setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
Sets the content type of the advisory information text. This is a bound property.

Specified by:
setInfoContentType in interface InfoModel
Parameters:
newInfoContentType - The new advisory information text content type.
Throws:
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.
See Also:
InfoModel.INFO_CONTENT_TYPE_PROPERTY


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.