Class PopupPanelManager
java.lang.Object
org.pushingpixels.radiance.component.api.common.popup.PopupPanelManager
Manager for showing and hiding
JPopupPanels.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPopup event.static classInformation on a single showing popup.static interfaceListener on showing and hiding the popup panels.static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PopupPanelManagerThe singleton instance of popup panel manager.private List<PopupPanelManager.WeakPopupListener> List of all registered listeners.Maps every shown popup panel to its popup menu host.private LinkedList<PopupPanelManager.PopupInfo> All currently shown popup panels. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent initialization outside ofdefaultManager()calls. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified popup listener.static PopupPanelManagerReturns the default popup panel manager.protected voidfirePopupHidden(JPopupPanel panel, JComponent popupOriginator) Fires an event on hiding the specified popup panel.protected voidfirePopupShown(JPopupPanel panel, JComponent popupOriginator) Fires an event on showing the specified popup panel.Returns all currently shown popup panels.voidHides the last shown popup panel.voidhidePopups(Component comp) Hides all popup panels based on the specified component.voidRemoves the specified popup listener.voidshowPopup(JComponent popupOriginator, JPopupPanel popupContent, int xOnScreen, int yOnScreen) Shows the specified content in a new popup and starts tracking it.
-
Field Details
-
listenerList
List of all registered listeners. -
instance
The singleton instance of popup panel manager. -
shownPath
All currently shown popup panels. -
popupHosts
Maps every shown popup panel to its popup menu host.
-
-
Constructor Details
-
PopupPanelManager
private PopupPanelManager()Private constructor to prevent initialization outside ofdefaultManager()calls.
-
-
Method Details
-
defaultManager
Returns the default popup panel manager.- Returns:
- a PopupPanelManager object
-
showPopup
public void showPopup(JComponent popupOriginator, JPopupPanel popupContent, int xOnScreen, int yOnScreen) Shows the specified content in a new popup and starts tracking it.- Parameters:
popupOriginator- The originator component.popupContent- The content of the popup.
-
hideLastPopup
public void hideLastPopup()Hides the last shown popup panel. -
hidePopups
Hides all popup panels based on the specified component. We find the first ancestor of the specified component that is a popup panel, and close all popups that were open from that popup panel. If the specified component isnull, all popup panels are closed.- Parameters:
comp- Component.
-
getShownPath
Returns all currently shown popup panels.- Returns:
- All currently shown popup panels.
-
addPopupListener
Adds the specified popup listener.- Parameters:
l- Listener to add.
-
removePopupListener
Removes the specified popup listener.- Parameters:
l- Listener to remove.
-
firePopupShown
Fires an event on showing the specified popup panel.- Parameters:
panel- Popup panel that was shown.popupOriginator- The originating component.
-
firePopupHidden
Fires an event on hiding the specified popup panel.- Parameters:
panel- Popup panel that was hidden.popupOriginator- The originating component.
-