Skip to content
Reference > AmiScript API > Classes

PanelEditor

Definition

PanelEditor var = .... ;

Extends

Extended By

Description

AMI Web panel editor (lifecycle base). Capability-specific surfaces (text editing, JSON settings, formula set, DataModel introspection) live on the sub-interface bindings and are reachable via runtime dispatch when the editor implements them.

Method Summary

Owner Name Return Type Description
PanelEditor apply() Boolean Persist the editor working copy to the underlying object. Call validate() first.
PanelEditor close() Boolean Dismiss this editor's window and unregister it from the editor registry. Triggers the same lifecycle as the user clicking the window's close button.
PanelEditor getBinding() Map Return the editor's binding metadata as a map: {handle, editorType, contentType, ari, name, parentHandle, scope, capabilities:[...], readonly}. Use this to ask 'what kind of editor is this?' or 'can I setCode on it?' (check capabilities for 'set_code') without runtime-type-checking the editor instance.
Object getClassName() String Returns the string name of this object's class type.
PanelEditor getHandle() String Return this editor's stable session handle.
PanelEditor getRevision() Long Return the editor's monotonic working-copy revision.
PanelEditor hasChanged() Boolean Return true if the working copy differs from persisted state.
PanelEditor open() Boolean Open this editor in the UI, bringing it onto the user's screen if it is not already visible. Editing can be done without calling open().
PanelEditor revert() Boolean Discard unsaved working-copy changes and return to persisted state.
PanelEditor test() Map Execute the editor's payload in its runtime context without persisting. Returns {ok, revision, returnValue, output, errorMessage}. Only valid when capabilities contains 'test' -- other editor kinds return a not-supported result. Mirrors the editor_test admin/MCP shape.
Object toJson() String Returns a string of a json representation of this object.
PanelEditor validate() Map Validate the editor's working copy. Returns {ok, revision, diagnostics}. Does not surface validation errors as UI alerts -- callers inspect the returned diagnostics list instead.

Method Definitions


apply()

Boolean PanelEditor::apply()

Description

Persist the editor working copy to the underlying object. Call validate() first.


close()

Boolean PanelEditor::close()

Description

Dismiss this editor's window and unregister it from the editor registry. Triggers the same lifecycle as the user clicking the window's close button.


getBinding()

Map PanelEditor::getBinding()

Description

Return the editor's binding metadata as a map: {handle, editorType, contentType, ari, name, parentHandle, scope, capabilities:[...], readonly}. Use this to ask 'what kind of editor is this?' or 'can I setCode on it?' (check capabilities for 'set_code') without runtime-type-checking the editor instance.


getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.


getHandle()

String PanelEditor::getHandle()

Description

Return this editor's stable session handle.


getRevision()

Long PanelEditor::getRevision()

Description

Return the editor's monotonic working-copy revision.


hasChanged()

Boolean PanelEditor::hasChanged()

Description

Return true if the working copy differs from persisted state.


open()

Boolean PanelEditor::open()

Description

Open this editor in the UI, bringing it onto the user's screen if it is not already visible. Editing can be done without calling open().


revert()

Boolean PanelEditor::revert()

Description

Discard unsaved working-copy changes and return to persisted state.


test()

Map PanelEditor::test()

Description

Execute the editor's payload in its runtime context without persisting. Returns {ok, revision, returnValue, output, errorMessage}. Only valid when capabilities contains 'test' -- other editor kinds return a not-supported result. Mirrors the editor_test admin/MCP shape.


toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.


validate()

Map PanelEditor::validate()

Description

Validate the editor's working copy. Returns {ok, revision, diagnostics}. Does not surface validation errors as UI alerts -- callers inspect the returned diagnostics list instead.