Class TextlikeComponent

java.lang.Object
com.inductiveautomation.ignition.designer.util.TextlikeComponent
Direct Known Subclasses:
TextlikeComponent.TableTextComponent, TextlikeComponent.TextLikeCodeEditor, TextlikeComponent.TextLikeComboBox, TextlikeComponent.TextLikeExtensionFunctionPanel, TextlikeComponent.TextLikeScriptEditor, TextlikeComponent.TextLikeTextComponent

public abstract class TextlikeComponent extends Object
Wrapper around various components that can be modeled like a JTextComponent. Can be instantiated using the static of(component) functions.

The two mutators mean different things: setText(String) always replaces the whole value, while insert(String) adds text the way the wrapped component wants it added. Callers that hand a component something the user picked — a tag path, a property reference, a resource path — want insert(String).

  • Constructor Details

    • TextlikeComponent

      public TextlikeComponent()
  • Method Details

    • insert

      public abstract void insert(String text)
      Inserts text into the component, in whatever way is meaningful for that component. A free-text component splices at the caret, replacing any active selection. A single-value component — a text field, a combo box, a table cell — has no interior to splice into, so the text becomes its new value.
    • setText

      public abstract void setText(String text)
      Replaces the component's entire contents.
    • requestFocus

      public abstract void requestFocus()
    • getText

      public abstract String getText()
    • getEditorState

      public @Nullable TextlikeComponent.TextEditorState getEditorState()
    • getInternalComponent

      public abstract Component getInternalComponent()
    • of

      public static TextlikeComponent of(com.jidesoft.editor.CodeEditor comp)
    • of

      public static TextlikeComponent of(com.inductiveautomation.ignition.designer.gui.tools.PythonTextArea comp)
    • of

      public static TextlikeComponent of(com.inductiveautomation.ignition.designer.gui.tools.ExtensionFunctionPanel comp)
    • of

      public static TextlikeComponent of(JTextComponent comp)
    • of

      public static TextlikeComponent of(JComboBox<?> comp)
    • of

      public static TextlikeComponent of(JTable comp, int column)
      Uses the currently selected row of the table. A cell holds a single value, so insert(String) overwrites it. For alternate behavior, see TextLikeComponent.of(table, column, keepExistingText).
    • of

      public static TextlikeComponent of(JTable comp, int column, boolean keepExistingText)
      Uses the currently selected row of the table.
      Parameters:
      keepExistingText - If true, insert(String) splices into the cell's existing text rather than replacing it.