Record Class TextlikeComponent.TextEditorState

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.designer.util.TextlikeComponent.TextEditorState
Record Components:
text - the full editor text.
caretOffset - the caret position, in characters from the start of the text.
selectedText - the currently selected substring, or null if no selection is active.
Enclosing class:
TextlikeComponent

public static record TextlikeComponent.TextEditorState(String text, int caretOffset, @Nullable String selectedText) extends Record
Snapshot of a text component's user-visible state at a single moment.
  • Constructor Details

    • TextEditorState

      public TextEditorState(String text, int caretOffset, @Nullable String selectedText)
      Creates an instance of a TextEditorState record class.
      Parameters:
      text - the value for the text record component
      caretOffset - the value for the caretOffset record component
      selectedText - the value for the selectedText record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • caretOffset

      public int caretOffset()
      Returns the value of the caretOffset record component.
      Returns:
      the value of the caretOffset record component
    • selectedText

      public @Nullable String selectedText()
      Returns the value of the selectedText record component.
      Returns:
      the value of the selectedText record component