Class PopupHelper
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.gui.popup.PopupHelper
-
public class PopupHelper extends java.lang.ObjectThis 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 voidbind()Adds mouse handling to the invoking component to show the popup.static voidbind(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton)voiddoTogglePopup(java.awt.event.MouseEvent e)Toggles popup visibilityjava.lang.RunnablegetCloseListener()PopupLocationgetLocation()PopupTriggergetTrigger()voidhidePopup()booleanisAcceptInputFocus()booleanisShowing()static voidmain(java.lang.String[] args)voidsetAcceptInputFocus(boolean acceptInputFocus)voidsetCloseListener(java.lang.Runnable closeListener)Set a runnable to be called when the popup is closed.voidsetInvoker(javax.swing.JComponent invoker)Set the invoking component.voidsetLocation(PopupLocation location)voidsetTrigger(PopupTrigger trigger)Set when the popup is show (for use with bind())protected voidshowPopup(java.awt.event.MouseEvent e)voidunbind()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)
-
-