Interface TextModel

All Superinterfaces:
Model, com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable
All Known Implementing Classes:
DefaultTextModel, TextBox

public interface TextModel extends Model
A model for text and an associated label. This model only supports text content types, including:
  • text/*
  • application/xml
  • application/*+xml

The model defaults to a content type of text/plain.

Author:
Garret Wilson
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The text content type bound property.
    static final String
    The text bound property.
  • 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 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
  • Field Details

    • TEXT_CONTENT_TYPE_PROPERTY

      static final String TEXT_CONTENT_TYPE_PROPERTY
      The text content type bound property.
    • TEXT_PROPERTY

      static final String TEXT_PROPERTY
      The text bound property.
  • Method Details

    • getText

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

      void setText(String newText)
      Sets the text. This is a bound property.
      Parameters:
      newText - The new text, which may include a resource reference.
      See Also:
    • getTextContentType

      com.globalmentor.net.MediaType getTextContentType()
      Returns:
      The content type of the text.
    • setTextContentType

      void setTextContentType(com.globalmentor.net.MediaType newTextContentType)
      Sets the content type of the text. This is a bound property.
      Parameters:
      newTextContentType - The new text content type.
      Throws:
      NullPointerException - if the given content type is null.
      IllegalArgumentException - if the given content type is not a text content type.
      See Also: