Class InputMapStore

java.lang.Object
com.vaadin.swingbridge.surrogates.internal.InputMapStore

public final class InputMapStore extends Object
Per-component slots for Swing's three condition-scoped InputMaps and single ActionMap, plus the Vaadin ShortcutRegistration map that backs JComponentMixin.registerKeyboardAction. Each slot is lazily allocated on first access so a component that never touches its keymaps pays nothing.

Browser-side shortcut wiring (SD_vaadin_first_binding): maps populated via registerKeyboardAction drive a real Vaadin Shortcuts registration on the surrogate; installedShortcuts keys the registration by (condition, KeyStroke) so unregister / setInputMap-replacement can tear it down precisely.

  • Method Details

    • of

      public static InputMapStore of(com.vaadin.flow.component.Component target)
    • getWhenFocused

      public InputMap getWhenFocused()
      Lazy-allocate the WHEN_FOCUSED map.
    • getWhenAncestor

      public InputMap getWhenAncestor()
      Lazy-allocate the WHEN_ANCESTOR_OF_FOCUSED_COMPONENT map.
    • getWhenInWindow

      public InputMap getWhenInWindow()
      Lazy-allocate the WHEN_IN_FOCUSED_WINDOW map.
    • rawWhenFocused

      public InputMap rawWhenFocused()
      Raw accessor — returns null when never allocated. Used by query paths that mustn't materialise empty maps.
    • rawWhenAncestor

      public InputMap rawWhenAncestor()
    • rawWhenInWindow

      public InputMap rawWhenInWindow()
    • setWhenFocused

      public void setWhenFocused(InputMap map)
      Replace the WHEN_FOCUSED map (caller-provided; may be null to clear).
    • setWhenAncestor

      public void setWhenAncestor(InputMap map)
    • setWhenInWindow

      public void setWhenInWindow(InputMap map)
    • getActionMap

      public ActionMap getActionMap()
      Lazy-allocate the single ActionMap.
    • rawActionMap

      public ActionMap rawActionMap()
      Raw accessor — returns null when never allocated.
    • setActionMap

      public void setActionMap(ActionMap map)
      Replace the ActionMap (caller-provided; may be null to clear).
    • shortcuts

      public Map<InputMapStore.ShortcutKey, com.vaadin.flow.component.ShortcutRegistration> shortcuts()
      Lazy-allocate the (condition, KeyStroke) → ShortcutRegistration map. Insertion order matters for tests asserting consistent iteration.
    • rawShortcuts

      public Map<InputMapStore.ShortcutKey, com.vaadin.flow.component.ShortcutRegistration> rawShortcuts()
      Raw accessor — returns null when no shortcut was ever installed.