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 Type
    Method
    Description
    buildNode(@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.JsonElement
    Pull current authored state from the provided tree node.
    key()
    Namespace key used in ScriptConfig.componentScriptExtensions.
  • Method Details

    • key

      String key()
      Namespace key used in ScriptConfig.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 - prior componentScriptExtensions[key()] value, or null when no data is persisted for this slot yet.
    • extract

      @Nullable com.inductiveautomation.ignition.common.gson.JsonElement extract(ScriptTreeNode node)
      Pull current authored state from the provided tree node. Return null to omit the key entirely from the saved componentScriptExtensions map (clean storage for components that haven't authored anything for this slot).