Class TriggerConfigSupport<T>
java.lang.Object
com.inductiveautomation.ignition.designer.scripteditor.workspace.ai.TriggerConfigSupport<T>
- Type Parameters:
T- the tab's typed trigger-config model.
One event-script tab's trigger-configuration contract with the embedded assistant: the schema a
proposal must satisfy, the configuration the panel holds right now, and the write-back and
preview for a proposal the user accepts.
Build one in the tab's triggerConfigSupport() hook and never cache it: the assist
popup is non-modal, so current() is read again on every submit. apply(T) and preview(T) are invoked on the EDT.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidWrites a configuration the user accepted to the live panel, on the EDT.final voidapplyJson(com.inductiveautomation.ignition.common.gson.JsonObject config) Writes a proposed configuration to the live panel.protected abstract Tcurrent()final Stringprotected StringRenders a proposed configuration as Markdown rows for the reply card, on the EDT, using the same labels as the tab's settings panel.final StringpreviewJson(com.inductiveautomation.ignition.common.gson.JsonObject config) Renders a proposed configuration for the reply card.final ConfigSchema<T> schema()final @Nullable ConfigProblemsvalidate(com.inductiveautomation.ignition.common.gson.JsonObject config)
-
Constructor Details
-
TriggerConfigSupport
- Parameters:
schema- the authoritative schema and deserialization for this tab's trigger config.
-
-
Method Details
-
schema
- Returns:
- the authoritative schema and deserialization for this tab's trigger config.
-
current
- Returns:
- the configuration the panel holds right now — the live editor state, not the last-saved model.
-
apply
Writes a configuration the user accepted to the live panel, on the EDT.- Parameters:
config- the accepted configuration.
-
preview
-
describeCurrent
- Returns:
- the panel's live configuration as canonical JSON, for showing the model what the script is configured with now. Not necessarily schema-valid — an editor can hold states the schema forbids in a proposal — so present it as current state rather than as an example.
-
validate
public final @Nullable ConfigProblems validate(com.inductiveautomation.ignition.common.gson.JsonObject config) - Parameters:
config- a configuration the model proposed.- Returns:
- every problem with
config, ornullwhen it is acceptable. - See Also:
-
applyJson
public final void applyJson(com.inductiveautomation.ignition.common.gson.JsonObject config) throws ConfigurationException Writes a proposed configuration to the live panel. Call only aftervalidate(JsonObject)came backnull.- Parameters:
config- the accepted configuration.- Throws:
ConfigurationException- ifconfigcannot be parsed into the typed model.
-
previewJson
public final String previewJson(com.inductiveautomation.ignition.common.gson.JsonObject config) throws ConfigurationException Renders a proposed configuration for the reply card. Call only aftervalidate(JsonObject)came backnull.- Parameters:
config- the proposed configuration.- Returns:
- the preview rows as Markdown; blank when the tab has nothing to show.
- Throws:
ConfigurationException- ifconfigcannot be parsed into the typed model.
-