Class InputMapUtils

java.lang.Object
org.openstreetmap.josm.tools.InputMapUtils

public final class InputMapUtils extends Object
Tools to work with Swing InputMap.
Since:
5200
  • Constructor Details

  • Method Details

    • unassignCtrlShiftUpDown

      public static void unassignCtrlShiftUpDown(JComponent cmp, int condition)
      Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component to allow global JOSM shortcuts to work in this component.
      Parameters:
      cmp - The Swing component
      condition - one of the following values:
      • JComponent.FOCUS_INPUTMAP_CREATED
      • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
      • JComponent.WHEN_IN_FOCUSED_WINDOW
    • unassignPageUpDown

      public static void unassignPageUpDown(JComponent cmp, int condition)
      Unassign PageUp/PageDown from the given component to allow global JOSM shortcuts to work in this component.
      Parameters:
      cmp - The Swing component
      condition - one of the following values:
      • JComponent.FOCUS_INPUTMAP_CREATED
      • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
      • JComponent.WHEN_IN_FOCUSED_WINDOW
      Since:
      6557
    • enableEnter

      public static void enableEnter(JButton b)
      Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels).
      Parameters:
      b - Button
    • addEnterAction

      public static void addEnterAction(JComponent c, Action a)
      Add an action activated with Enter key on a component.
      Parameters:
      c - The Swing component
      a - action activated with Enter key
      See Also:
    • addEnterActionWhenAncestor

      public static void addEnterActionWhenAncestor(JComponent c, Action a)
      Add an action activated with Enter key on a component or its children.
      Parameters:
      c - The Swing component
      a - action activated with Enter key
      Since:
      10790
      See Also:
    • addEnterAction

      private static void addEnterAction(JComponent c, Action a, int condition)
    • addSpacebarAction

      public static void addSpacebarAction(JComponent c, Action a)
      Add an action activated with Spacebar key on a component.
      Parameters:
      c - The Swing component
      a - action activated with Spacebar key
    • addEscapeAction

      public static void addEscapeAction(JComponent c, Action a)
      Add an action activated with ESCAPE key on a component or its children.
      Parameters:
      c - The Swing component
      a - action activated with ESCAPE key
      Since:
      10791
      See Also:
    • addCtrlEnterAction

      public static void addCtrlEnterAction(JComponent c, Action a)
      Add an action activated with Ctrl+Enter key on a component.
      Parameters:
      c - The Swing component
      a - action activated with Ctrl+Enter key
      See Also: