Interface ScriptCategoryProvider
public interface ScriptCategoryProvider
Contributes an extra top-level node to the Perspective scripts editor for a specific component
type. Registered against the
ScriptCategoryProviderRegistry at module startup via ScriptCategoryProviderRegistry.register(String, ScriptCategoryProvider) — the type-id binding
lives on registration, not on the provider.
Provider nodes only appear when the script editor targets exactly one component whose type id
matches the binding. Multi-component selections hide every provider's node and pass each
component's ScriptConfig.componentScriptExtensions[key] through on apply.
The script is JSON-shaped at the framework boundary: buildNode(JsonElement, ScriptCategoryContext) receives the raw
persisted JsonElement, and extract(ScriptTreeNode) returns one. The framework never needs to
know about provider-specific payload types — providers Gson-bridge to their domain type inside
the implementations.
-
Method Summary
Modifier and TypeMethodDescriptionbuildNode(@Nullable com.inductiveautomation.ignition.common.gson.JsonElement existing, ScriptCategoryContext ctx) Build the tree node to insert under the scripts editor root.@Nullable com.inductiveautomation.ignition.common.gson.JsonElementextract(ScriptTreeNode node) Pull current authored state from the provided tree node.key()Namespace key used inScriptConfig.componentScriptExtensions.
-
Method Details
-
key
String key()Namespace key used inScriptConfig.componentScriptExtensions. Must be globally unique. -
buildNode
ScriptTreeNode buildNode(@Nullable com.inductiveautomation.ignition.common.gson.JsonElement existing, ScriptCategoryContext ctx) Build the tree node to insert under the scripts editor root.- Parameters:
existing- priorcomponentScriptExtensions[key()]value, ornullwhen no data is persisted for this slot yet.
-
extract
Pull current authored state from the provided tree node. Returnnullto omit the key entirely from the savedcomponentScriptExtensionsmap (clean storage for components that haven't authored anything for this slot).
-