Interface ScriptCategoryContext
public interface ScriptCategoryContext
Per-editor context handed to a
ScriptCategoryProvider when its node is built. Exposes
only what a provider needs to wire its tree node + editor against the surrounding scripts editor
frame:
- Selection metadata via
getPrimaryComponentPath()(for path-aware UI like the Browse-Properties button) andgetAdapter()(theDesignAdapterfor broader Designer-API access). - Tree mutation via
insert(DefaultMutableTreeNode, MutableTreeNode, int),update(TreeNode), andremove(DefaultMutableTreeNode, MutableTreeNode), so popup-action handlers can add/remove children and signal change to the underlying tree model.
-
Method Summary
Modifier and TypeMethodDescriptionvoidinsert(DefaultMutableTreeNode parent, MutableTreeNode child, int index) Insertchildunderparentatindexand notify the tree model.voidremove(DefaultMutableTreeNode parent, MutableTreeNode child) Removechildfromparentand notify the tree model.voidNotify the tree model thatnode's rendering may have changed.
-
Method Details
-
getPrimaryComponentPath
Optional<ComponentPath> getPrimaryComponentPath()- Returns:
- the lead component's path when the scripts editor targets a single component, or
Optional.empty()when no component is the obvious anchor.
-
getAdapter
DesignAdapter getAdapter()- Returns:
- the
DesignAdapterowning the current edit session.
-
update
Notify the tree model thatnode's rendering may have changed. -
insert
Insertchildunderparentatindexand notify the tree model. Selects the new child once inserted. -
remove
Removechildfromparentand notify the tree model. No-op when absent.
-