Class PopupHelper
java.lang.Object
com.inductiveautomation.ignition.client.util.gui.popup.PopupHelper
This class uses a lower-level implementation of Popup than the similar JPopupMenuHelper class does. This can help
when popups get nested.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPopupHelper
(JComponent invoker, Supplier<JComponent> popupContents) PopupHelper
(JComponent invoker, Supplier<JComponent> popupContents, boolean addCloseButton) PopupHelper
(JComponent invoker, Supplier<JComponent> popupContents, boolean addCloseButton, Insets closeInsets) PopupHelper
(JComponent invoker, JComponent popupContents) PopupHelper
(JComponent invoker, JComponent popupContents, boolean addCloseButton, Insets closeInsets) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind()
Adds mouse handling to the invoking component to show the popup.void
Toggles popup visibilityvoid
protected JComponent
initializeContentPanel
(JComponent content) boolean
boolean
void
setAcceptInputFocus
(boolean acceptInputFocus) void
setCloseListener
(Runnable closeListener) Set a runnable to be called when the popup is closed.void
setInvoker
(JComponent invoker) Set the invoking component.void
setLocation
(PopupLocation location) void
setTrigger
(PopupTrigger trigger) Set when the popup is show (for use with bind())protected void
void
unbind()
Removes the mouse handling added by bind()
-
Field Details
-
DEFAULT_CLOSE_INSETS
-
-
Constructor Details
-
PopupHelper
-
PopupHelper
public PopupHelper(JComponent invoker, JComponent popupContents, boolean addCloseButton, Insets closeInsets) -
PopupHelper
-
PopupHelper
-
PopupHelper
public PopupHelper(JComponent invoker, Supplier<JComponent> popupContents, boolean addCloseButton, Insets closeInsets)
-
-
Method Details
-
initializeContentPanel
-
setCloseListener
Set a runnable to be called when the popup is closed. -
getCloseListener
-
setTrigger
Set when the popup is show (for use with bind()) -
getTrigger
-
setLocation
-
getLocation
-
isAcceptInputFocus
public boolean isAcceptInputFocus() -
setAcceptInputFocus
public void setAcceptInputFocus(boolean acceptInputFocus) -
setInvoker
Set the invoking component. Shouldn't be re-set after the consructor if using the bind() method of controlling the popup. Can be used if doTogglePopup(MouseEvent) is being called directly. -
bind
public void bind()Adds mouse handling to the invoking component to show the popup. Popup is shown either when the PopupTrigger matches. -
unbind
public void unbind()Removes the mouse handling added by bind() -
isShowing
public boolean isShowing() -
doTogglePopup
Toggles popup visibility -
hidePopup
public void hidePopup() -
showPopup
-