Package sc.fiji.snt.gui
Class SNTCommandFinder
java.lang.Object
sc.fiji.snt.gui.SNTCommandFinder
Implements SNT's Command Palette. An older version of this code is used by Fiji's Script
Editor. In the future, should move to a common library to avoid this kind of duplication.
-
Constructor Summary
ConstructorsConstructorDescriptionSNTCommandFinder(SNTUI sntui) Constructs a new SNTCommandFinder for the specified SNTUI instance.SNTCommandFinder(Viewer3D viewer3D) Constructs a new SNTCommandFinder for the specified Viewer3D instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddispose()Disposes of this command finder and its associated resources.getButton(float scaleFactor) getMenuItem(boolean asButton) getRegisteredComponent(String label) voidregister(AbstractButton button, String... description) voidregister(AbstractButton button, List<String> pathDescription) voidregister(JPopupMenu menu, List<String> path) voidregisterKeywords(String label, List<String> path, List<String> keywords, AbstractAction executeAction, AbstractAction revealAction) Registers a pseudo entry that isn't backed by any UI button.voidrunCommand(String actionIdentifier) voidsetRecorder(ScriptRecorder recorder) Sets the script recorder for this command finder.voidsetVisible(boolean b) voidToggles the visibility of the command finder window.
-
Constructor Details
-
SNTCommandFinder
Constructs a new SNTCommandFinder for the specified SNTUI instance.- Parameters:
sntui- the SNTUI instance to associate with this command finder
-
SNTCommandFinder
Constructs a new SNTCommandFinder for the specified Viewer3D instance.- Parameters:
viewer3D- the Viewer3D instance to associate with this command finder
-
-
Method Details
-
dispose
public void dispose()Disposes of this command finder and its associated resources. -
setRecorder
Sets the script recorder for this command finder.- Parameters:
recorder- the ScriptRecorder instance to use for recording commands
-
runCommand
-
registerKeywords
public void registerKeywords(String label, List<String> path, List<String> keywords, AbstractAction executeAction, AbstractAction revealAction) Registers a pseudo entry that isn't backed by any UI button. Useful for surfacing tabs, panels, or actions that have no immediate clickable action.The entry survives subsequent
index rebuildsand matches against the suppliedkeywords,label, andpath.- Parameters:
label- primary entry name (matched against id; also displayed in the palette)path- parent-path description shown in the palette, e.g.List.of("PM Tabs")keywords- additional searchable terms; any match brings up the entry (e.g., synonyms, related concepts, or names of nested features)executeAction- what to run when the entry is invokedrevealAction- what to run when the entry is invoked in 'reveal' mode. Optional: null allowed.
-
toggleVisibility
public void toggleVisibility()Toggles the visibility of the command finder window. -
attach
-
getButton
-
getMenuItem
-
register
-
register
-
register
-
getRegisteredComponent
-
setVisible
public void setVisible(boolean b) -
getAcceleratorString
-