Class AbstractUITextEntryComponent

All Implemented Interfaces:
UIKeyHandler, Textable, Hintable, Savable
Direct Known Subclasses:
UITextArea, UITextField

public abstract class AbstractUITextEntryComponent extends StateBasedUIComponent implements Textable
  • Field Details

    • _caretPosition

      protected int _caretPosition
    • _editable

      protected boolean _editable
    • _copyable

      protected boolean _copyable
    • _disabledState

      protected UIState _disabledState
    • _defaultState

      protected UIState _defaultState
    • _writingState

      protected UIState _writingState
    • _uiText

      protected RenderedText _uiText
      The text object to use for drawing label text.
    • _styled

      protected boolean _styled
      If true, our text could be marked up with style information.
    • _alignment

      protected Alignment _alignment
      Alignment value to use to position the icon/text within the overall dimensions of this component.
    • _caret

      protected TextCaret _caret
    • _selection

      protected TextSelection _selection
  • Constructor Details

    • AbstractUITextEntryComponent

      public AbstractUITextEntryComponent()
  • Method Details

    • getKeyHandler

      protected abstract UIKeyHandler getKeyHandler()
    • getDefaultState

      public UIState getDefaultState()
      Specified by:
      getDefaultState in class StateBasedUIComponent
      Returns:
      the state that represents the default appearance and behavior for this component.
    • getDisabledState

      public UIState getDisabledState()
      Specified by:
      getDisabledState in class StateBasedUIComponent
      Returns:
      the state that represents the disabled appearance and behavior for this component.
    • getWritingState

      public UIState getWritingState()
    • getText

      public String getText()
      Specified by:
      getText in interface Textable
      Returns:
      the text value of this text entry widget
    • setText

      public void setText(String text)
      Set the text for this component. Also updates the minimum size of the component.
      Specified by:
      setText in interface Textable
      Parameters:
      text - the new text
    • isStyledText

      public boolean isStyledText()
      Specified by:
      isStyledText in interface Textable
    • setStyledText

      public void setStyledText(boolean value)
      Specified by:
      setStyledText in interface Textable
    • isCopyable

      public boolean isCopyable()
    • setCopyable

      public void setCopyable(boolean copyable)
    • setCaretPosition

      public int setCaretPosition(int index)
      Set the position of the text caret as an index to the current set text string. If the specified position is after the last possible index, it is set to the last possible index.
      Parameters:
      index - the new position
      Returns:
      the new caret position
    • getCaretPosition

      public int getCaretPosition()
    • getSelectionLength

      public int getSelectionLength()
    • clearSelection

      public void clearSelection()
    • isEditable

      public boolean isEditable()
    • setEditable

      public void setEditable(boolean editable)
      Parameters:
      editable - true if the text of this component can be changed by keyboard interaction
    • getCaret

      public TextCaret getCaret()
    • getSelection

      public TextSelection getSelection()
    • getAlignment

      public Alignment getAlignment()
    • setAlignment

      public void setAlignment(Alignment alignment)
    • fireStyleChanged

      public void fireStyleChanged()
      Description copied from class: UIComponent
      Let subcomponents know that style has been changed.
      Overrides:
      fireStyleChanged in class UIComponent
    • updateMinimumSizeFromContents

      public void updateMinimumSizeFromContents()
      Description copied from class: UIComponent
      Ask this component to update its minimum allowed size, based on its contents.
      Overrides:
      updateMinimumSizeFromContents in class UIComponent
    • getStates

      public Set<UIState> getStates()
      Specified by:
      getStates in class StateBasedUIComponent
      Returns:
      an ImmutableSet of possible states for this component.