public class PopupPanelManager extends Object
JPopupPanel
s.Modifier and Type | Class | Description |
---|---|---|
static class |
PopupPanelManager.PopupEvent |
Popup event.
|
static class |
PopupPanelManager.PopupInfo |
Information on a single showing popup.
|
static interface |
PopupPanelManager.PopupListener |
Listener on showing and hiding the popup panels.
|
Modifier and Type | Field | Description |
---|---|---|
protected EventListenerList |
listenerList |
List of all registered listeners.
|
protected Map<JPopupPanel,Popup> |
popupPanels |
Map of all popup panels and associated
Popup objects. |
protected LinkedList<PopupPanelManager.PopupInfo> |
shownPath |
All currently shown popup panels.
|
Constructor | Description |
---|---|
PopupPanelManager() |
Modifier and Type | Method | Description |
---|---|---|
void |
addPopup(JComponent popupOriginator,
Popup popup,
JPopupPanel popupInitiator) |
Adds new popup to the tracking structures.
|
void |
addPopupListener(PopupPanelManager.PopupListener l) |
Adds the specified popup listener.
|
static PopupPanelManager |
defaultManager() |
Returns the default popup panel manager.
|
protected void |
firePopupHidden(JPopupPanel panel,
JComponent popupOriginator) |
Fires an event on hiding the specified popup panel.
|
protected void |
firePopupShown(JPopupPanel panel,
JComponent popupOriginator) |
Fires an event on showing the specified popup panel.
|
List<PopupPanelManager.PopupInfo> |
getShownPath() |
Returns all currently shown popup panels.
|
void |
hideLastPopup() |
Hides the last shown popup panel.
|
void |
hidePopups(Component comp) |
Hides all popup panels based on the specified component.
|
void |
removePopupListener(PopupPanelManager.PopupListener l) |
Removes the specified popup listener.
|
protected EventListenerList listenerList
protected LinkedList<PopupPanelManager.PopupInfo> shownPath
protected Map<JPopupPanel,Popup> popupPanels
Popup
objects.public static PopupPanelManager defaultManager()
public void addPopup(JComponent popupOriginator, Popup popup, JPopupPanel popupInitiator)
popupOriginator
- The originating component.popup
- The new popup.popupInitiator
- The initiator of the popup.public void hideLastPopup()
public void hidePopups(Component comp)
null
, all popup panels are closed.comp
- Component.public List<PopupPanelManager.PopupInfo> getShownPath()
public void addPopupListener(PopupPanelManager.PopupListener l)
l
- Listener to add.public void removePopupListener(PopupPanelManager.PopupListener l)
l
- Listener to remove.protected void firePopupShown(JPopupPanel panel, JComponent popupOriginator)
panel
- Popup panel that was shown.popupOriginator
- The originating component.protected void firePopupHidden(JPopupPanel panel, JComponent popupOriginator)
panel
- Popup panel that was hidden.popupOriginator
- The originating component.