Class BasicPopupPanelUI.PopupPanelEscapeDismisser
java.lang.Object
org.pushingpixels.radiance.component.internal.ui.common.popup.BasicPopupPanelUI.PopupPanelEscapeDismisser
- All Implemented Interfaces:
EventListener
,PopupPanelManager.PopupListener
- Enclosing class:
BasicPopupPanelUI
protected static class BasicPopupPanelUI.PopupPanelEscapeDismisser
extends 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.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List
<PopupPanelManager.PopupInfo> The last shown popup panel sequence.private ActionMap
The currently installed action map on thetracedRootPane
.private InputMap
The currently installed input map on thetracedRootPane
.private JRootPane
Currently traced root pane. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new tracer for popup panels to be dismissed with ESC key. -
Method Summary
Modifier and TypeMethodDescription(package private) void
addUIActionMap
(JComponent c, ActionMap map) Adds the specified action map to the specified component.(package private) void
addUIInputMap
(JComponent c, InputMap map) Adds the specified input map to the specified component.void
Fired when a popup panel has been hidden.void
Fired when a popup panel has been shown.(package private) void
removeUIActionMap
(JComponent c, ActionMap map) Removes the specified action map from the specified component.(package private) void
removeUIInputMap
(JComponent c, InputMap map) Removes the specified input map from the specified component.private void
traceRootPane
(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
Removes the installed maps on the currently traced root pane.
-
Field Details
-
newActionMap
The currently installed action map on thetracedRootPane
. -
newInputMap
The currently installed input map on thetracedRootPane
. -
lastPathSelected
List<PopupPanelManager.PopupInfo> lastPathSelectedThe last shown popup panel sequence. -
tracedRootPane
Currently traced root pane. It is the root pane of the originating component of the first popup panel in the currently shown sequence ofPopupPanelManager
.
-
-
Constructor Details
-
PopupPanelEscapeDismisser
public PopupPanelEscapeDismisser()Creates a new tracer for popup panels to be dismissed with ESC key.
-
-
Method Details
-
popupHidden
Description copied from interface:PopupPanelManager.PopupListener
Fired when a popup panel has been hidden.- Specified by:
popupHidden
in interfacePopupPanelManager.PopupListener
- Parameters:
event
- Popup event.
-
untraceRootPane
private void untraceRootPane()Removes the installed maps on the currently traced root pane. -
popupShown
Description copied from interface:PopupPanelManager.PopupListener
Fired when a popup panel has been shown.- Specified by:
popupShown
in interfacePopupPanelManager.PopupListener
- Parameters:
event
- Popup event.
-
traceRootPane
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
Adds the specified input map to the specified component.- Parameters:
c
- Component.map
- Input map to add.
-
addUIActionMap
Adds the specified action map to the specified component.- Parameters:
c
- Component.map
- Action map to add.
-
removeUIInputMap
Removes the specified input map from the specified component.- Parameters:
c
- Component.map
- Input map to remove.
-
removeUIActionMap
Removes the specified action map from the specified component.- Parameters:
c
- Component.map
- Action map to remove.
-