Class PopupHelper
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.gui.popup.PopupHelper
-
public class PopupHelper extends java.lang.Object
This class uses a lower-level implementation of Popup than the similar JPopupMenuHelper class does. This can help when popups get nested.
-
-
Constructor Summary
Constructors Constructor Description PopupHelper(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton, java.awt.Insets closeInsets)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind()
Adds mouse handling to the invoking component to show the popup.static void
bind(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton)
void
doTogglePopup(java.awt.event.MouseEvent e)
Toggles popup visibilityjava.lang.Runnable
getCloseListener()
PopupLocation
getLocation()
PopupTrigger
getTrigger()
void
hidePopup()
boolean
isAcceptInputFocus()
boolean
isShowing()
static void
main(java.lang.String[] args)
void
setAcceptInputFocus(boolean acceptInputFocus)
void
setCloseListener(java.lang.Runnable closeListener)
Set a runnable to be called when the popup is closed.void
setInvoker(javax.swing.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
showPopup(java.awt.event.MouseEvent e)
void
unbind()
Removes the mouse handling added by bind()
-
-
-
Method Detail
-
bind
public static void bind(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton)
-
setCloseListener
public void setCloseListener(java.lang.Runnable closeListener)
Set a runnable to be called when the popup is closed.
-
getCloseListener
public java.lang.Runnable getCloseListener()
-
setTrigger
public void setTrigger(PopupTrigger trigger)
Set when the popup is show (for use with bind())
-
getTrigger
public PopupTrigger getTrigger()
-
setLocation
public void setLocation(PopupLocation location)
-
getLocation
public PopupLocation getLocation()
-
isAcceptInputFocus
public boolean isAcceptInputFocus()
-
setAcceptInputFocus
public void setAcceptInputFocus(boolean acceptInputFocus)
-
setInvoker
public void setInvoker(javax.swing.JComponent invoker)
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
public void doTogglePopup(java.awt.event.MouseEvent e)
Toggles popup visibility
-
hidePopup
public void hidePopup()
-
showPopup
protected void showPopup(java.awt.event.MouseEvent e)
-
main
public static void main(java.lang.String[] args)
-
-