Class EditorShortcuts

java.lang.Object
ch.autumo.ui.fx.view.EditorShortcuts

public final class EditorShortcuts extends Object
The editing shortcuts of a Swing editor inside a SwingNode.

A Cmd/Ctrl combination does not reach the Swing component on every platform: JavaFX handles the key event first. The shortcuts are therefore intercepted on the JavaFX node and executed on the editor directly. The system clipboard of JavaFX is used instead of the clipboard of Swing, so copying in another application and pasting into the editor works - and the other way round.

Handled are Cmd/Ctrl+C (copy), +V (paste), +X (cut), +A (select all), +Z (undo) and Shift+Z (redo). Paste, cut and undo/redo do nothing when the editor is not editable.

  • Method Details

    • install

      public static void install(Pane root, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea area)
      Intercepts the editing shortcuts of the editor.
      Parameters:
      root - the JavaFX node that contains the SwingNode of the editor
      area - the editor widget