class flux::FluxCommand
sys::Obj fwt::Command flux::FluxCommand
Flux specialization of normal fwt commands. All FluxCommands are identified by a string id which is used to map the command in various APIs and bind to localized resources and key bindings. Command id should be globally scoped. Common built-in commands are identified with a simple string like "cut" and a constant in CommandId
. Custom commands implemented by plugin pods should be prefixed with their pod name such as "imageEditor.resizeImage".
All FluxCommands are assumed to be localized by mapping their name, icon, and default accelerator to a localized properties file. The default make
constructor routes to Command.makeLocale
.
If a FluxCommand supports undo/redo, then it should be posted to the View.commandStack
. However it should not maintain references to a specific view instance since the command stack is persisted between hyperlinks for a given URI.
- frame
-
Frame? frame { internal set }
Get the flux Frame associated with this command.
- id
-
const Str id
The id serves as the string identifer for processing the command and looking up resources such as localization and key bindings.
- make
-
new make(Str id, Pod pod := Flux#.pod())
Construct with id and optional pod. The pod defines where to look for localized name, icon, and default accelerator. If pod is omitted, it defaults to the "flux" pod. This method routes to
Command.makeLocale
whereid
is passed as thekeyBase
.The default accelerator is defined by the localized property definition. But we allow the user to redefine key bindings via
KeyOptions
. This constructor automatically checks for additional key bindings. - view
-
View? view()
Get the flux View associated with this command.