Commands
A group of many Commands.
Some applications have a single instance of Commands, but more complex application may have many (one for each part of the application).
For shortcuts to work, you must attachTo a node. The shortcuts will only work when the input focus is one of that node's descendants (or itself). Therefore, Scene.root is often a good choice to attach to.
NOTE, button, toggleButton etc. all create Buttons with text as well as a graphic. However, if the Button is placed within a ToolBar, Glok's default theme sets ContentDisplay.GRAPHIC_ONLY, which means that the text will NOT be displayed (assuming the icon exists). If you place the button elsewhere, then the text (and graphic) will be displayed.
(If the graphic is not found, then the button's text is displayed, despite ContentDisplay.GRAPHIC_ONLY).
IMHO, these are the correct defaults, which differ from JavaFX's defaults.
If you prefer JavaFX's defaults, either extend (or replace) Glok's default theme, or set ContentDisplay.LEFT on each toolbar button.
Properties
Functions
Adds an onKeyPressed
event handler to node, which checks the KeyEvent against each action's Action.keyCombination and Action.additionalKeyCombinations.
Removes the key handler added by attachTo.
Looks for the command matching action, checks that it isn't disabled, and then calls the Command.lambda.