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
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordSnapshot of a text component's user-visible state at a single moment.static classstatic classstatic classWrapper for the extension-function panel.static classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable TextlikeComponent.TextEditorStateabstract Componentabstract StringgetText()abstract voidInserts text into the component, in whatever way is meaningful for that component.static TextlikeComponentof(com.inductiveautomation.ignition.designer.gui.tools.ExtensionFunctionPanel comp) static TextlikeComponentof(com.inductiveautomation.ignition.designer.gui.tools.PythonTextArea comp) static TextlikeComponentof(com.jidesoft.editor.CodeEditor comp) static TextlikeComponentstatic TextlikeComponentUses the currently selected row of the table.static TextlikeComponentUses the currently selected row of the table.static TextlikeComponentof(JTextComponent comp) abstract voidabstract voidReplaces the component's entire contents.
-
Constructor Details
-
TextlikeComponent
public TextlikeComponent()
-
-
Method Details
-
insert
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
Replaces the component's entire contents. -
requestFocus
public abstract void requestFocus() -
getText
-
getEditorState
-
getInternalComponent
-
of
-
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
-
of
-
of
Uses the currently selected row of the table. A cell holds a single value, soinsert(String)overwrites it. For alternate behavior, seeTextLikeComponent.of(table, column, keepExistingText). -
of
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.
-