Class TextBox

All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, io.clogr.Clogged, Component, CompositeComponent, Container, LayoutComponent, SectionComponent, Displayable, InfoModel, LabelModel, Model, TextModel, PresentationModel, DepictedObject, Iterable<Component>

public class TextBox extends AbstractContainer implements TextModel, SectionComponent
A box containing text.

This component may have child components, each bound to a specific ID in the text using ReferenceConstraints. When the text is rendered, XML elements with IDs referencing child components will be replaced with representations of those child components. Child element ID reference replacement can only occur if the text has an XML-based content type (such as XHTML).

This component only supports text content types, including:

  • text/*
  • application/xml
  • application/*+xml

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

This component by default indicates no section type, thereby indicating that its text does not indicate a semantically significant area.

Author:
Garret Wilson
See Also:
  • Constructor Details

    • TextBox

      public TextBox()
      Default constructor with a default text model.
    • TextBox

      public TextBox(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.
    • TextBox

      public TextBox(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.
    • TextBox

      public TextBox(TextModel textModel)
      Text model constructor.
      Parameters:
      textModel - The component text model.
      Throws:
      NullPointerException - if the given text model is null.
  • Method Details