Class EditorPopup

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

public final class EditorPopup extends Object
Styles the Swing popup menu of an RSyntaxTextArea in the dark theme of the framework and with the framework's UI font.

RSyntaxTextArea brings its own cut/copy/paste/select-all menu, but it is painted in the colours of the Swing look & feel - a bright menu on the dark editor. The menu itself is reused; only its colours and the font are set, so the localized labels and the enabled/disabled state handling of the component stay untouched.

The framework loads Inter for JavaFX only; AWT does not know it. The font of the resources is therefore loaded directly and used for the menu - no installation needed.

  • Method Details

    • font

      public static Font font()
      The framework's UI font (Inter) for Swing components.
      Returns:
      the font at menu size
    • applyDarkTheme

      public static void applyDarkTheme(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea area)
      Paints the popup menu of the editor in the dark theme and in the framework font.

      The menu of RSyntaxTextArea is created lazily; calling this method creates it, so the styling applies to the instance that is shown later.

      Parameters:
      area - the editor whose menu is styled