Class ValuePrototype<V>

java.lang.Object
com.globalmentor.beans.BoundPropertyObject
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
  • Constructor Details

    • ValuePrototype

      public ValuePrototype(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:
      NullPointerException - if the given value class is null.
    • ValuePrototype

      public ValuePrototype(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:
      NullPointerException - if the given value class is null.
    • ValuePrototype

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

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

      public ValuePrototype(Class<V> valueClass, String label, 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:
      NullPointerException - if the given value class is null.
    • ValuePrototype

      public ValuePrototype(Class<V> valueClass, V defaultValue, String label, 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:
      NullPointerException - if the given value class is null.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Enableable
      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 type Boolean.
      Specified by:
      setEnabled in interface Enableable
      Parameters:
      newEnabled - true if the object should indicate and accept user input.
      See Also:
    • getGlyphURI

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

      public void setGlyphURI(URI newIcon)
      Description copied from interface: LabelModel
      Sets the URI of the icon. This is a bound property.
      Specified by:
      setGlyphURI in interface LabelModel
      Parameters:
      newIcon - The new URI of the icon, which may be a resource URI.
      See Also:
    • getLabel

      public 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(String newLabelText)
      Description copied from interface: LabelModel
      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:
    • getLabelContentType

      public com.globalmentor.net.MediaType getLabelContentType()
      Specified by:
      getLabelContentType in interface LabelModel
      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 interface LabelModel
      Parameters:
      newLabelTextContentType - The new label text content type.
      See Also:
    • getDescription

      public 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(String newDescription)
      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 interface InfoModel
      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 interface InfoModel
      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 interface InfoModel
      Parameters:
      newDescriptionContentType - The new description text content type.
      See Also:
    • getInfo

      public 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(String newInfo)
      Description copied from interface: InfoModel
      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:
    • getInfoContentType

      public com.globalmentor.net.MediaType getInfoContentType()
      Specified by:
      getInfoContentType in interface InfoModel
      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 interface InfoModel
      Parameters:
      newInfoContentType - The new advisory information text content type.
      See Also: