Class DefaultTextModel

java.lang.Object
com.globalmentor.beans.BoundPropertyObject
io.guise.framework.model.AbstractModel
io.guise.framework.model.DefaultTextModel
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Model, TextModel

public class DefaultTextModel extends AbstractModel implements TextModel
The default implementation of a model for text and an associated label.
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.TextModel

    TEXT_CONTENT_TYPE_PROPERTY, TEXT_PROPERTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Text constructor with a default Text.PLAIN_MEDIA_TYPE content type.
    DefaultTextModel(String text, com.globalmentor.net.MediaType textContentType)
    Text and content type constructor
  • Method Summary

    Modifier and Type
    Method
    Description
     
    com.globalmentor.net.MediaType
     
    void
    setText(String newText)
    Sets the text.
    void
    setTextContentType(com.globalmentor.net.MediaType newTextContentType)
    Sets the content type of the text.

    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

    • DefaultTextModel

      public DefaultTextModel()
      Default constructor.
    • DefaultTextModel

      public DefaultTextModel(String text)
      Text constructor with a default Text.PLAIN_MEDIA_TYPE content type.
      Parameters:
      text - The text, which may include a resource reference, or null if there is no text.
    • DefaultTextModel

      public DefaultTextModel(String text, com.globalmentor.net.MediaType textContentType)
      Text and content type constructor
      Parameters:
      text - The text, which may include a resource reference, or null if there is no text.
      textContentType - The content type of the text.
      Throws:
      NullPointerException - if the given content type is null.
      IllegalArgumentException - if the given content type is not a text content type.
  • Method Details

    • getText

      public String getText()
      Specified by:
      getText in interface TextModel
      Returns:
      The text, which may include a resource reference, or null if there is no text.
    • setText

      public void setText(String newText)
      Description copied from interface: TextModel
      Sets the text. This is a bound property.
      Specified by:
      setText in interface TextModel
      Parameters:
      newText - The new text, which may include a resource reference.
      See Also:
    • getTextContentType

      public com.globalmentor.net.MediaType getTextContentType()
      Specified by:
      getTextContentType in interface TextModel
      Returns:
      The content type of the text.
    • setTextContentType

      public void setTextContentType(com.globalmentor.net.MediaType newTextContentType)
      Description copied from interface: TextModel
      Sets the content type of the text. This is a bound property.
      Specified by:
      setTextContentType in interface TextModel
      Parameters:
      newTextContentType - The new text content type.
      See Also: