Class BasicPopupPanelUI.PopupPanelEscapeDismisser

  • All Implemented Interfaces:
    java.util.EventListener, PopupPanelManager.PopupListener
    Enclosing class:
    BasicPopupPanelUI

    protected static class BasicPopupPanelUI.PopupPanelEscapeDismisser
    extends java.lang.Object
    implements PopupPanelManager.PopupListener
    This class is used to trace the changes in the shown popup panels and install ESC key listener on the matching root pane so that the popup panels can be dismissed with the ESC key.
    • Constructor Summary

      Constructors 
      Constructor Description
      PopupPanelEscapeDismisser()
      Creates a new tracer for popup panels to be dismissed with ESC key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addUIActionMap​(javax.swing.JComponent c, javax.swing.ActionMap map)
      Adds the specified action map to the specified component.
      (package private) void addUIInputMap​(javax.swing.JComponent c, javax.swing.InputMap map)
      Adds the specified input map to the specified component.
      void popupHidden​(PopupPanelManager.PopupEvent event)
      Fired when a popup panel has been hidden.
      void popupShown​(PopupPanelManager.PopupEvent event)
      Fired when a popup panel has been shown.
      (package private) void removeUIActionMap​(javax.swing.JComponent c, javax.swing.ActionMap map)
      Removes the specified action map from the specified component.
      (package private) void removeUIInputMap​(javax.swing.JComponent c, javax.swing.InputMap map)
      Removes the specified input map from the specified component.
      private void traceRootPane​(java.util.List<PopupPanelManager.PopupInfo> shownPath)
      Installs the maps on the root pane of the originating component of the first popup panel of the specified sequence to trace the ESC key and dismiss the shown popup panels.
      private void untraceRootPane()
      Removes the installed maps on the currently traced root pane.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • newActionMap

        private javax.swing.ActionMap newActionMap
        The currently installed action map on the tracedRootPane.
      • newInputMap

        private javax.swing.InputMap newInputMap
        The currently installed input map on the tracedRootPane.
      • tracedRootPane

        private javax.swing.JRootPane tracedRootPane
        Currently traced root pane. It is the root pane of the originating component of the first popup panel in the currently shown sequence of PopupPanelManager.
    • Constructor Detail

      • PopupPanelEscapeDismisser

        public PopupPanelEscapeDismisser()
        Creates a new tracer for popup panels to be dismissed with ESC key.
    • Method Detail

      • untraceRootPane

        private void untraceRootPane()
        Removes the installed maps on the currently traced root pane.
      • traceRootPane

        private void traceRootPane​(java.util.List<PopupPanelManager.PopupInfo> shownPath)
        Installs the maps on the root pane of the originating component of the first popup panel of the specified sequence to trace the ESC key and dismiss the shown popup panels.
        Parameters:
        shownPath - Popup panel sequence.
      • addUIInputMap

        void addUIInputMap​(javax.swing.JComponent c,
                           javax.swing.InputMap map)
        Adds the specified input map to the specified component.
        Parameters:
        c - Component.
        map - Input map to add.
      • addUIActionMap

        void addUIActionMap​(javax.swing.JComponent c,
                            javax.swing.ActionMap map)
        Adds the specified action map to the specified component.
        Parameters:
        c - Component.
        map - Action map to add.
      • removeUIInputMap

        void removeUIInputMap​(javax.swing.JComponent c,
                              javax.swing.InputMap map)
        Removes the specified input map from the specified component.
        Parameters:
        c - Component.
        map - Input map to remove.
      • removeUIActionMap

        void removeUIActionMap​(javax.swing.JComponent c,
                               javax.swing.ActionMap map)
        Removes the specified action map from the specified component.
        Parameters:
        c - Component.
        map - Action map to remove.