public class PopupHelper
extends java.lang.Object
Constructor and Description |
---|
PopupHelper(javax.swing.JComponent invoker,
javax.swing.JComponent popupContents,
boolean addCloseButton,
java.awt.Insets closeInsets) |
Modifier and Type | Method and 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 visibility
|
java.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()
|
public PopupHelper(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton, java.awt.Insets closeInsets)
public static void bind(javax.swing.JComponent invoker, javax.swing.JComponent popupContents, boolean addCloseButton)
public void setCloseListener(java.lang.Runnable closeListener)
public java.lang.Runnable getCloseListener()
public void setTrigger(PopupTrigger trigger)
public PopupTrigger getTrigger()
public void setLocation(PopupLocation location)
public PopupLocation getLocation()
public boolean isAcceptInputFocus()
public void setAcceptInputFocus(boolean acceptInputFocus)
public void setInvoker(javax.swing.JComponent invoker)
public void bind()
public void unbind()
public boolean isShowing()
public void doTogglePopup(java.awt.event.MouseEvent e)
public void hidePopup()
protected void showPopup(java.awt.event.MouseEvent e)
public static void main(java.lang.String[] args)