Class BasicPopupPanelUI.PopupPanelEscapeDismisser
- java.lang.Object
-
- org.pushingpixels.radiance.component.internal.ui.common.popup.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.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<PopupPanelManager.PopupInfo>
lastPathSelected
The last shown popup panel sequence.private javax.swing.ActionMap
newActionMap
The currently installed action map on thetracedRootPane
.private javax.swing.InputMap
newInputMap
The currently installed input map on thetracedRootPane
.private javax.swing.JRootPane
tracedRootPane
Currently traced root pane.
-
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.
-
-
-
Field Detail
-
newActionMap
private javax.swing.ActionMap newActionMap
The currently installed action map on thetracedRootPane
.
-
newInputMap
private javax.swing.InputMap newInputMap
The currently installed input map on thetracedRootPane
.
-
lastPathSelected
java.util.List<PopupPanelManager.PopupInfo> lastPathSelected
The last shown popup panel sequence.
-
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 ofPopupPanelManager
.
-
-
Method Detail
-
popupHidden
public void popupHidden(PopupPanelManager.PopupEvent event)
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
public void popupShown(PopupPanelManager.PopupEvent event)
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
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.
-
-