Package com.jidesoft.popup
Class JidePopup
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- com.jidesoft.popup.JidePopup
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,javax.swing.WindowConstants
- Direct Known Subclasses:
Searchable.SearchPopup
public class JidePopup extends javax.swing.JComponent implements javax.accessibility.Accessible, javax.swing.WindowConstantsJidePopupis a popup window which can be resized, dragged and autohide if time out. JidePopup uses JWindow as the container in order to show itself. By default, JidePopup is not focusable which means no component in the JidePopup will get focus. For example, if you put a JTextField in JidePopup and the JTextField becomes not editable, this is a result of non-focusable JWindow. So if you want components in JidePopup to be able to receive focus, you can either call setFocusable(true) or you can callsetDefaultFocusComponent(java.awt.Component)to set a child component as the default focus component.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJidePopup.AccessiblePopupThis class implements accessibility support for thePopupclass.-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Component_actualOwnerprotected java.awt.Point_actualOwnerLocationprotected boolean_detachedprotected java.awt.Insets_insetsprotected ResizablePanel_panelprotected java.awt.Dimension_previousSizeprotected ResizableSupport_resizableSupportprotected ResizableWindow_windowstatic java.lang.StringATTACHABLE_PROPERTYConstrained property name indicating that the popup is attachable.static java.lang.StringCLIENT_PROPERTY_POPUP_ACTUAL_OWNERIf the popup shows a dialog and you don't want the popup to be hidden when the dialog is shown, you can use this special client property to do it.static java.lang.StringCLIENT_PROPERTY_POPUP_TYPEstatic java.lang.StringCLIENT_PROPERTY_VALUE_POPUP_TYPE_COMBOBOXstatic java.lang.StringCLIENT_PROPERTY_WINDOW_OPACITYYou can set client property to JidePopup control the window opacity (only when heavyweight popup is in use).static java.lang.StringCLIENT_PROPERTY_WINDOW_OPAQUEYou can set client property to JidePopup control the window opaque (only when heavyweight popup is in use) The value of the client property should be a boolean.static java.lang.StringCLIENT_PROPERTY_WINDOW_SHAPEYou can set client property to JidePopup control the window shape (only when heavyweight popup is in use) The value of the client property should be a Shape.static java.lang.StringCONTENT_PANE_PROPERTYBound property name.static java.lang.StringDETACHED_PROPERTYBound property name for if the popup is detached.intDISTANCE_TO_SCREEN_BORDERThe distance between alert and screen border.static intDO_NOTHING_ON_MOVEDHides the popup when the owner is moved.static java.lang.StringGLASS_PANE_PROPERTYBound property name.static intHEAVY_WEIGHT_POPUPstatic intHIDE_ON_MOVEDHides the popup when the owner is moved.static java.lang.StringLAYERED_PANE_PROPERTYBound property name.static intLIGHT_WEIGHT_POPUPKey used to indicate a light weight popup should be used.static java.lang.StringMENU_BAR_PROPERTYBound property name.static java.lang.StringMOVABLE_PROPERTYBound property name for gripper.static intMOVE_ON_MOVEDMoves the popup along with owner when the owner is moved.static java.lang.StringOWNER_PROPERTYBound property name for owner.static java.lang.StringPROPERTY_GRIPPER_LOCATIONstatic java.lang.StringRESIZABLE_PROPERTYBound property name for resizable.static java.lang.StringROOT_PANE_PROPERTYBound property name.static java.lang.StringTRANSIENT_PROPERTYstatic java.lang.StringVISIBLE_PROPERTYBound property name.-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JidePopup()Creates a Popup.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExcludedComponent(java.awt.Component component)Adds a component as excluded component.protected voidaddImpl(java.awt.Component comp, java.lang.Object constraints, int index)Ensures that, by default, children cannot be added directly to this component.voidaddPopupMenuListener(javax.swing.event.PopupMenuListener l)Adds aPopupMenulistener which will listen to notification messages from the popup portion of the combo box.protected voidancestorHidden()This method will process component hidden event for the popup's ancestor.protected voidancestorMoved()This method will process component moved event for the popup's ancestor.protected voidbeginDragging(javax.swing.JComponent f, int mouseX, int mouseY, double relativeX, double relativeY)protected voidcontentResized()protected ResizableWindowcreateHeavyweightPopupContainer(java.awt.Component owner)protected ResizablePanelcreateLightweightPopupContainer(java.awt.Component owner)Creates lightweight container for the popup.protected javax.swing.JRootPanecreateRootPane()Called by the constructor to set up theJRootPane.protected voidcreateWindow(java.awt.Component owner, int x, int y)protected voiddrag(javax.swing.JComponent f, int newX, int newY, int mouseModifiers)protected voidendDragging()voidfirePopupMenuCanceled()NotifiesPopupMenuListeners that the popup portion of the combo box has been canceled.voidfirePopupMenuWillBecomeInvisible()NotifiesPopupMenuListeners that the popup portion of the combo box has become invisible.voidfirePopupMenuWillBecomeVisible()NotifiesPopupMenuListeners that the popup portion of the combo box will become visible.javax.accessibility.AccessibleContextgetAccessibleContext()Gets theAccessibleContextassociated with thisPopup.protected java.awt.ComponentgetActualOwner()Gets the actual owner.protected java.awt.RectanglegetAdjustedRectangle(int x, int y, java.awt.Component owner)Gets the rectangle adjusted by preferred size and the monitor device settings.java.awt.InsetsgetBackToOriginalInsets()Get the insets so that when the JidePopup is dragged back to this area, the JidePopup will jump to its original position automatically.java.awt.ContainergetContentPane()Returns the content pane for this Popup.java.awt.ComponentgetDefaultFocusComponent()Gets the default focus component.intgetDefaultMoveOperation()Gets the default operation when the owner is moved.protected java.awt.RectanglegetDisplayScreenBounds(java.awt.Component owner)protected java.awt.PointgetDisplayStartLocation(java.awt.Rectangle screenDim, java.awt.Dimension size, int location)Get the display start location of the popup.protected static java.awt.FramegetFrame(java.awt.Component c)java.awt.ComponentgetGlassPane()Returns the glass pane for this popup.intgetGripperLocation()javax.swing.JMenuBargetJMenuBar()Returns the currentJMenuBarfor thisPopup, ornullif no menu bar has been set.javax.swing.JLayeredPanegetLayeredPane()Returns the layered pane for this popup.java.awt.ComponentgetOwner()Gets the owner of the popup.javax.swing.border.BordergetPopupBorder()Gets the popup border set bysetPopupBorder(javax.swing.border.Border).java.awt.RectanglegetPopupBounds()protected java.awt.PointgetPopupLocation(java.awt.Point point, java.awt.Dimension size, java.awt.Component owner)Calculates the popup location.javax.swing.event.PopupMenuListener[]getPopupMenuListeners()Returns an array of all thePopupMenuListeners added to this JComboBox with addPopupMenuListener().intgetPopupType()java.awt.DimensiongetPreferredPopupSize()protected javax.swing.JComponentgetRealParent(javax.swing.RootPaneContainer rootPaneContainer)javax.swing.JRootPanegetRootPane()Returns therootPaneobject for this popup.intgetTimeout()Gets the time out value, in milliseconds.static java.awt.ComponentgetTopLevelAncestor(java.awt.Component component)PopupUIgetUI()Returns the look-and-feel object that renders this component.java.lang.StringgetUIClassID()Returns the name of the look-and-feel class that renders this component.protected voidhandleComponentEvent(java.awt.event.ComponentEvent e)This method will process component event.protected voidhandleMouseDragged(java.awt.event.MouseEvent e)protected voidhandleMouseEntered(java.awt.event.MouseEvent e)protected voidhandleMouseExited(java.awt.event.MouseEvent e)protected voidhandleMousePressed(java.awt.event.MouseEvent e)protected voidhandleMouseReleased(java.awt.event.MouseEvent e)protected voidhandleWindowEvent(java.awt.event.WindowEvent e)voidhidePopup()voidhidePopup(boolean cancelled)voidhidePopupImmediately()Hides the popup immediately (compare tohidePopup()could use animation to hide the popup).voidhidePopupImmediately(boolean cancelled)protected voidinstallBorder()protected voidinstallListeners()protected voidinternalShowPopup(int x, int y)protected voidinternalShowPopup(int x, int y, java.awt.Component owner)booleanisAttachable()Checks if the popup is attachable.booleanisClickOnPopup(java.awt.event.MouseEvent e)Checks if the mouse event is on the popup.booleanisDetached()Checks if the popup is detached.protected booleanisDragging()booleanisEnsureInOneScreen()Checks if the popup will be shown in one screen.booleanisExcludedComponent(java.awt.Component component)Checks if a component is an excluded component.booleanisKeepPreviousSize()Get the flag indicating if JidePopup should keep the size last time it was popped up.booleanisMovable()Checks if the popup is movable.static booleanisPopupAncestorOf(JidePopup popup, java.awt.Component c)booleanisPopupVisible()booleanisResizable()Checks if the popup is resizable.booleanisReturnFocusToOwner()gets the flag.protected booleanisRootPaneCheckingEnabled()Returns whether calls toaddandsetLayoutcause an exception to be thrown.booleanisTransient()Checks if the popup is transient.protected voidmovePopup()voidpackPopup()Packs the popup.voidremove(java.awt.Component comp)Removes the specified component from this container.voidremoveAllExcludedComponents()Removes all excluded components that were added before.voidremoveExcludedComponent(java.awt.Component component)Removes a component from the excluded component list.voidremovePopupMenuListener(javax.swing.event.PopupMenuListener l)Removes aPopupMenuListener.voidsetAttachable(boolean attachable)Sets the attachable option.voidsetBackToOriginalInsets(java.awt.Insets backToOriginalInsets)Set the insets so that when the JidePopup is dragged back to this area, the JidePopup will jump to its original position automatically.voidsetContentPane(java.awt.Container c)Sets thisPopup'scontentPaneproperty.voidsetDefaultFocusComponent(java.awt.Component defaultFocusComponent)Sets the default focus component.voidsetDefaultMoveOperation(int defaultMoveOperation)Sets the default operation when the owner is moved.voidsetDetached(boolean detached)Changes the popup's detached mode.voidsetDisplayStartLocation(java.awt.Point startLocation)Set the display start location of the popup.voidsetEnsureInOneScreen(boolean ensureInOneScreen)Sets the flag if the popup should appear within one screen.voidsetGlassPane(java.awt.Component glass)Sets thisPopup'sglassPaneproperty.voidsetGripperLocation(int gripperLocation)Sets the gripper location.voidsetJMenuBar(javax.swing.JMenuBar m)Sets themenuBarproperty for thisPopup.voidsetKeepPreviousSize(boolean keepPreviousSize)Set the flag indicating if JidePopup should keep the size last time it was popped up.voidsetLayeredPane(javax.swing.JLayeredPane layered)Sets thisPopup'slayeredPaneproperty.voidsetLayout(java.awt.LayoutManager manager)Ensures that, by default, the layout of this component cannot be set.voidsetMovable(boolean movable)Sets the movable attribute.voidsetOwner(java.awt.Component owner)Sets the owner of the popup.voidsetPopupBorder(javax.swing.border.Border popupBorder)Sets the border for this popup.voidsetPopupType(int popupType)voidsetPreferredPopupSize(java.awt.Dimension size)Sets the preferred popup size.voidsetResizable(boolean resizable)Sets the resizable option.voidsetReturnFocusToOwner(boolean returnFocusToOwner)Sets the flag to return focus to the owner when the popup is hidden.protected voidsetRootPane(javax.swing.JRootPane root)Sets therootPaneproperty for thisPopup.protected voidsetRootPaneCheckingEnabled(boolean enabled)Determines whether calls toaddandsetLayoutcause an exception to be thrown.voidsetTimeout(int timeout)Sets the time out value, in milliseconds.voidsetTransient(boolean isTransient)Sets the transient attribute.voidsetUI(PopupUI ui)Sets the UI delegate for thisPopup.voidsetupResizeCorner(int corner)Setup Resizable's ResizeCorner.voidsetVisible(boolean visible)Makes the component visible or invisible.protected booleanshouldAWTEventListenerBeUsed()Returns whether the AWTEventEventListener should be used to handle event processingvoidshowPopup()Shows the popup.voidshowPopup(int location)Shows the popup at the specified location relative to the screen.voidshowPopup(int x, int y)Shows the popup at the specified x and y coordinates.voidshowPopup(int x, int y, java.awt.Component owner)Shows the popup at the specified x and y coordinates.voidshowPopup(int location, java.awt.Component owner)Shows the popup at the specified location relative to the owner.voidshowPopup(java.awt.Component owner)Shows the popup.voidshowPopup(java.awt.Insets insets)Shows the popup.voidshowPopup(java.awt.Insets insets, java.awt.Component owner)Shows the popup.protected voidshowPopupImmediately()voidupdateUI()Notification from theUIManagerthat the look and feel has changed.-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
CLIENT_PROPERTY_WINDOW_OPACITY
public static final java.lang.String CLIENT_PROPERTY_WINDOW_OPACITY
You can set client property to JidePopup control the window opacity (only when heavyweight popup is in use). The value of the client property should be a float.- See Also:
- Constant Field Values
-
CLIENT_PROPERTY_WINDOW_OPAQUE
public static final java.lang.String CLIENT_PROPERTY_WINDOW_OPAQUE
You can set client property to JidePopup control the window opaque (only when heavyweight popup is in use) The value of the client property should be a boolean.- See Also:
- Constant Field Values
-
CLIENT_PROPERTY_WINDOW_SHAPE
public static final java.lang.String CLIENT_PROPERTY_WINDOW_SHAPE
You can set client property to JidePopup control the window shape (only when heavyweight popup is in use) The value of the client property should be a Shape.- See Also:
- Constant Field Values
-
CONTENT_PANE_PROPERTY
public static final java.lang.String CONTENT_PANE_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
MENU_BAR_PROPERTY
public static final java.lang.String MENU_BAR_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
LAYERED_PANE_PROPERTY
public static final java.lang.String LAYERED_PANE_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
ROOT_PANE_PROPERTY
public static final java.lang.String ROOT_PANE_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
GLASS_PANE_PROPERTY
public static final java.lang.String GLASS_PANE_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
VISIBLE_PROPERTY
public static final java.lang.String VISIBLE_PROPERTY
Bound property name.- See Also:
- Constant Field Values
-
TRANSIENT_PROPERTY
public static final java.lang.String TRANSIENT_PROPERTY
- See Also:
- Constant Field Values
-
ATTACHABLE_PROPERTY
public static final java.lang.String ATTACHABLE_PROPERTY
Constrained property name indicating that the popup is attachable.- See Also:
- Constant Field Values
-
MOVABLE_PROPERTY
public static final java.lang.String MOVABLE_PROPERTY
Bound property name for gripper.- See Also:
- Constant Field Values
-
DETACHED_PROPERTY
public static final java.lang.String DETACHED_PROPERTY
Bound property name for if the popup is detached.- See Also:
- Constant Field Values
-
CLIENT_PROPERTY_POPUP_TYPE
public static final java.lang.String CLIENT_PROPERTY_POPUP_TYPE
- See Also:
- Constant Field Values
-
CLIENT_PROPERTY_VALUE_POPUP_TYPE_COMBOBOX
public static final java.lang.String CLIENT_PROPERTY_VALUE_POPUP_TYPE_COMBOBOX
- See Also:
- Constant Field Values
-
_detached
protected boolean _detached
-
_window
protected ResizableWindow _window
-
_panel
protected ResizablePanel _panel
-
_resizableSupport
protected ResizableSupport _resizableSupport
-
CLIENT_PROPERTY_POPUP_ACTUAL_OWNER
public static final java.lang.String CLIENT_PROPERTY_POPUP_ACTUAL_OWNER
If the popup shows a dialog and you don't want the popup to be hidden when the dialog is shown, you can use this special client property to do it. Here is the code, assuming the dialog is shown from your popup.JComponent c = JideSwingUtilities.getFirstJComponent(dialog); if(c != null) { c.putClientProperty(JidePopup.CLIENT_PROPERTY_POPUP_ACTUAL_OWNER, component); }- See Also:
- Constant Field Values
-
RESIZABLE_PROPERTY
public static final java.lang.String RESIZABLE_PROPERTY
Bound property name for resizable.- See Also:
- Constant Field Values
-
OWNER_PROPERTY
public static final java.lang.String OWNER_PROPERTY
Bound property name for owner.- See Also:
- Constant Field Values
-
DO_NOTHING_ON_MOVED
public static final int DO_NOTHING_ON_MOVED
Hides the popup when the owner is moved.- See Also:
- Constant Field Values
-
HIDE_ON_MOVED
public static final int HIDE_ON_MOVED
Hides the popup when the owner is moved.- See Also:
- Constant Field Values
-
MOVE_ON_MOVED
public static final int MOVE_ON_MOVED
Moves the popup along with owner when the owner is moved.- See Also:
- Constant Field Values
-
DISTANCE_TO_SCREEN_BORDER
public int DISTANCE_TO_SCREEN_BORDER
The distance between alert and screen border.
-
PROPERTY_GRIPPER_LOCATION
public static final java.lang.String PROPERTY_GRIPPER_LOCATION
- See Also:
- Constant Field Values
-
_previousSize
protected java.awt.Dimension _previousSize
-
_actualOwner
protected java.awt.Component _actualOwner
-
_actualOwnerLocation
protected java.awt.Point _actualOwnerLocation
-
LIGHT_WEIGHT_POPUP
public static final int LIGHT_WEIGHT_POPUP
Key used to indicate a light weight popup should be used.- See Also:
- Constant Field Values
-
HEAVY_WEIGHT_POPUP
public static final int HEAVY_WEIGHT_POPUP
- See Also:
- Constant Field Values
-
_insets
protected java.awt.Insets _insets
-
-
Method Detail
-
createRootPane
protected javax.swing.JRootPane createRootPane()
Called by the constructor to set up theJRootPane.- Returns:
- a new
JRootPane - See Also:
JRootPane
-
getUI
public PopupUI getUI()
Returns the look-and-feel object that renders this component.- Overrides:
getUIin classjavax.swing.JComponent- Returns:
- the
PopupUIobject that renders this component
-
setUI
public void setUI(PopupUI ui)
Sets the UI delegate for thisPopup.- Parameters:
ui- the UI delegate
-
updateUI
public void updateUI()
Notification from theUIManagerthat the look and feel has changed. Replaces the current UI object with the latest version from theUIManager.- Overrides:
updateUIin classjavax.swing.JComponent- See Also:
JComponent.updateUI()
-
getUIClassID
public java.lang.String getUIClassID()
Returns the name of the look-and-feel class that renders this component.- Overrides:
getUIClassIDin classjavax.swing.JComponent- Returns:
- the string "PopupUI"
- See Also:
JComponent.getUIClassID(),UIDefaults.getUI(javax.swing.JComponent)
-
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
Returns whether calls toaddandsetLayoutcause an exception to be thrown.- Returns:
trueifaddandsetLayoutare checked- See Also:
addImpl(java.awt.Component, java.lang.Object, int),setLayout(java.awt.LayoutManager),setRootPaneCheckingEnabled(boolean)
-
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
Determines whether calls toaddandsetLayoutcause an exception to be thrown.- Parameters:
enabled- a boolean value,trueif checking is to be enabled, which cause the exceptions to be thrown- See Also:
addImpl(java.awt.Component, java.lang.Object, int),setLayout(java.awt.LayoutManager),isRootPaneCheckingEnabled()
-
addImpl
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)Ensures that, by default, children cannot be added directly to this component. Instead, children must be added to its content pane. For example:thisComponent.getContentPane().add(child)
An attempt to add to directly to this component will cause a runtime exception to be thrown. Subclasses can disable this behavior.- Overrides:
addImplin classjava.awt.Container- Parameters:
comp- theComponentto be addedconstraints- the object containing the constraints, if anyindex- the index- Throws:
java.lang.Error- if called withisRootPaneCheckingtrue- See Also:
setRootPaneCheckingEnabled(boolean)
-
remove
public void remove(java.awt.Component comp)
Removes the specified component from this container.- Overrides:
removein classjava.awt.Container- Parameters:
comp- the component to be removed- See Also:
Container.add(java.awt.Component)
-
setLayout
public void setLayout(java.awt.LayoutManager manager)
Ensures that, by default, the layout of this component cannot be set. Instead, the layout of its content pane should be set. For example:thisComponent.getContentPane().setLayout(new GridLayout(1,2))
An attempt to set the layout of this component will cause an runtime exception to be thrown. Subclasses can disable this behavior.- Overrides:
setLayoutin classjava.awt.Container- Parameters:
manager- theLayoutManager- Throws:
java.lang.Error- if called withisRootPaneCheckingtrue- See Also:
setRootPaneCheckingEnabled(boolean)
-
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
Returns the currentJMenuBarfor thisPopup, ornullif no menu bar has been set.- Returns:
- the
JMenuBarused by this Popup. - See Also:
setJMenuBar(javax.swing.JMenuBar)
-
setJMenuBar
public void setJMenuBar(javax.swing.JMenuBar m)
Sets themenuBarproperty for thisPopup.- Parameters:
m- theJMenuBarto use in this Popup.- See Also:
getJMenuBar()
-
getContentPane
public java.awt.Container getContentPane()
Returns the content pane for this Popup.- Returns:
- the content pane
-
setContentPane
public void setContentPane(java.awt.Container c)
Sets thisPopup'scontentPaneproperty.- Parameters:
c- the content pane for this popup.- Throws:
java.awt.IllegalComponentStateException- (a runtime exception) if the content pane parameter isnull- See Also:
RootPaneContainer.getContentPane()
-
getLayeredPane
public javax.swing.JLayeredPane getLayeredPane()
Returns the layered pane for this popup.- Returns:
- a
JLayeredPaneobject - See Also:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane),RootPaneContainer.getLayeredPane()
-
setLayeredPane
public void setLayeredPane(javax.swing.JLayeredPane layered)
Sets thisPopup'slayeredPaneproperty.- Parameters:
layered- theJLayeredPanefor this popup- Throws:
java.awt.IllegalComponentStateException- (a runtime exception) if the layered pane parameter isnull- See Also:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
-
getGlassPane
public java.awt.Component getGlassPane()
Returns the glass pane for this popup.- Returns:
- the glass pane
- See Also:
RootPaneContainer.setGlassPane(java.awt.Component)
-
setGlassPane
public void setGlassPane(java.awt.Component glass)
Sets thisPopup'sglassPaneproperty.- Parameters:
glass- the glass pane for this popup- See Also:
RootPaneContainer.getGlassPane()
-
getRootPane
public javax.swing.JRootPane getRootPane()
Returns therootPaneobject for this popup.- Overrides:
getRootPanein classjavax.swing.JComponent- Returns:
- the
rootPaneproperty - See Also:
RootPaneContainer.getRootPane()
-
setRootPane
protected void setRootPane(javax.swing.JRootPane root)
Sets therootPaneproperty for thisPopup. This method is called by the constructor.- Parameters:
root- the newJRootPaneobject
-
setVisible
public void setVisible(boolean visible)
Makes the component visible or invisible. OverridesComponent.setVisible.- Overrides:
setVisiblein classjavax.swing.JComponent- Parameters:
visible- true to make the component visible; false to make it invisible
-
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
Gets theAccessibleContextassociated with thisPopup. For popups, theAccessibleContexttakes the form of anAccessiblePopupobject. A newAccessiblePopupinstance is created if necessary.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin classjava.awt.Component- Returns:
- an
AccessiblePopupthat serves as theAccessibleContextof thisPopup - See Also:
JidePopup.AccessiblePopup
-
isKeepPreviousSize
public boolean isKeepPreviousSize()
Get the flag indicating if JidePopup should keep the size last time it was popped up. The default value of this flag is true. If you want the popup to resize based on the changing contents like in IntelliHints, you need set this flag to false.- Returns:
- the flag.
-
setKeepPreviousSize
public void setKeepPreviousSize(boolean keepPreviousSize)
Set the flag indicating if JidePopup should keep the size last time it was popped up.- Parameters:
keepPreviousSize- the flag.
-
getBackToOriginalInsets
public java.awt.Insets getBackToOriginalInsets()
Get the insets so that when the JidePopup is dragged back to this area, the JidePopup will jump to its original position automatically. By default, the value is {10, 10, 10, 10}. You can disable the jump functionality by setting the insets to {0, 0, 0, 0}.- Returns:
- the insets.
-
setBackToOriginalInsets
public void setBackToOriginalInsets(java.awt.Insets backToOriginalInsets)
Set the insets so that when the JidePopup is dragged back to this area, the JidePopup will jump to its original position automatically.- Parameters:
backToOriginalInsets- the insets
-
showPopup
public void showPopup()
Shows the popup. By default, it will show right below the owner.
-
showPopup
public void showPopup(java.awt.Component owner)
Shows the popup. By default, it will show right below the owner after considering the insets. This call is almost the same as setOwner followed by showPopup() except in this case, the owner is only temporarily used to create the popup. It will not be added to excludedComponent list as setOwner would do.- Parameters:
owner- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or ContentContainer
-
showPopup
public void showPopup(java.awt.Insets insets)
Shows the popup. By default, it will show right below the owner after considering the insets.- Parameters:
insets- the popup's insets RootPaneContainer(Applet) or ContentContainer
-
showPopup
public void showPopup(java.awt.Insets insets, java.awt.Component owner)Shows the popup. By default, it will show right below the owner after considering the insets. Please note, if the owner is not displayed (isShowing returns false), the popup will not be displayed either.- Parameters:
insets- the popup's insetsowner- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or ContentContainer
-
getPopupLocation
protected java.awt.Point getPopupLocation(java.awt.Point point, java.awt.Dimension size, java.awt.Component owner)Calculates the popup location.- Parameters:
point- owner is top-left coordinate relative to screen.size- the size of the popup window.owner- the owner- Returns:
- new popup location. By default, it will return the coordinate of the bottom-left corner of owner.
-
setupResizeCorner
public void setupResizeCorner(int corner)
Setup Resizable's ResizeCorner.- Parameters:
corner- the corner.
-
getTopLevelAncestor
public static java.awt.Component getTopLevelAncestor(java.awt.Component component)
-
showPopup
public void showPopup(int location)
Shows the popup at the specified location relative to the screen. The valid locations are:SwingConstants.CENTERSwingConstants.SOUTHSwingConstants.NORTHSwingConstants.WESTSwingConstants.EASTSwingConstants.NORTH_EASTSwingConstants.NORTH_WESTSwingConstants.SOUTH_EASTSwingConstants.SOUTH_WEST
DISTANCE_TO_SCREEN_BORDER.- Parameters:
location- the new location.
-
showPopup
public void showPopup(int location, java.awt.Component owner)Shows the popup at the specified location relative to the owner. The valid locations are:SwingConstants.CENTERSwingConstants.SOUTHSwingConstants.NORTHSwingConstants.WESTSwingConstants.EASTSwingConstants.NORTH_EASTSwingConstants.NORTH_WESTSwingConstants.SOUTH_EASTSwingConstants.SOUTH_WEST
DISTANCE_TO_SCREEN_BORDER.- Parameters:
location- the new locationowner- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or ContentContainer
-
setDisplayStartLocation
public void setDisplayStartLocation(java.awt.Point startLocation)
Set the display start location of the popup.- Parameters:
startLocation- the display start location.- See Also:
getDisplayStartLocation(java.awt.Rectangle, java.awt.Dimension, int)
-
getDisplayStartLocation
protected java.awt.Point getDisplayStartLocation(java.awt.Rectangle screenDim, java.awt.Dimension size, int location)Get the display start location of the popup. It will automatically calculate a point if the customer didn't invokesetDisplayStartLocation(java.awt.Point)explicitly. It will just return the location if the customer already set it.- Parameters:
screenDim- the dimension of the screensize- the size of the popuplocation- the direction to show the popup- Returns:
- the display start location.
-
getDisplayScreenBounds
protected java.awt.Rectangle getDisplayScreenBounds(java.awt.Component owner)
-
packPopup
public void packPopup()
Packs the popup. Setting size only if it's a light weight popup. Otherwise do pack.
-
internalShowPopup
protected void internalShowPopup(int x, int y)
-
internalShowPopup
protected void internalShowPopup(int x, int y, java.awt.Component owner)
-
getAdjustedRectangle
protected java.awt.Rectangle getAdjustedRectangle(int x, int y, java.awt.Component owner)Gets the rectangle adjusted by preferred size and the monitor device settings. The client property "useAllMonitorDevices" could be registered in any ancestor component of the owner component to take effect.- Parameters:
x- the original xy- the original yowner- the owner component- Returns:
- the adjusted rectangle according to the preferred size and monitor devie settings.
- Since:
- 3.4.1
-
createWindow
protected void createWindow(java.awt.Component owner, int x, int y)
-
showPopup
public void showPopup(int x, int y)Shows the popup at the specified x and y coordinates.- Parameters:
x- the x position. It is screen position.y- the y position. It is screen position.
-
showPopup
public void showPopup(int x, int y, java.awt.Component owner)Shows the popup at the specified x and y coordinates.- Parameters:
x- the x position. It is screen position.y- the y position. It is screen position.owner- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or ContentContainer
-
getFrame
protected static java.awt.Frame getFrame(java.awt.Component c)
-
createHeavyweightPopupContainer
protected ResizableWindow createHeavyweightPopupContainer(java.awt.Component owner)
- Parameters:
owner- the owner for this popup container. It will be used to find the top level ancestor and use it as the parent for this popup window.- Returns:
- a ResizableWindow.
-
createLightweightPopupContainer
protected ResizablePanel createLightweightPopupContainer(java.awt.Component owner)
Creates lightweight container for the popup.- Parameters:
owner- the owner for this popup container. This parameter is not used in this method. It was there mainly because the correspondingcreateHeavyweightPopupContainer(java.awt.Component)has this parameter.- Returns:
- a ResizablePanel
-
installListeners
protected void installListeners()
-
contentResized
protected void contentResized()
-
installBorder
protected void installBorder()
-
showPopupImmediately
protected void showPopupImmediately()
-
movePopup
protected void movePopup()
-
endDragging
protected void endDragging()
-
beginDragging
protected void beginDragging(javax.swing.JComponent f, int mouseX, int mouseY, double relativeX, double relativeY)
-
isDragging
protected boolean isDragging()
-
drag
protected void drag(javax.swing.JComponent f, int newX, int newY, int mouseModifiers)
-
handleMousePressed
protected void handleMousePressed(java.awt.event.MouseEvent e)
-
handleMouseReleased
protected void handleMouseReleased(java.awt.event.MouseEvent e)
-
handleMouseDragged
protected void handleMouseDragged(java.awt.event.MouseEvent e)
-
handleMouseEntered
protected void handleMouseEntered(java.awt.event.MouseEvent e)
-
handleMouseExited
protected void handleMouseExited(java.awt.event.MouseEvent e)
-
handleWindowEvent
protected void handleWindowEvent(java.awt.event.WindowEvent e)
-
getRealParent
protected javax.swing.JComponent getRealParent(javax.swing.RootPaneContainer rootPaneContainer)
-
handleComponentEvent
protected void handleComponentEvent(java.awt.event.ComponentEvent e)
This method will process component event. By default, if popup's ancestor is hidden, we will hide the popup as well if the popup is transient (isTransient returns true). If popup's ancestor is moved, we will either move or hide the popup depending ongetDefaultMoveOperation()value.- Parameters:
e- the ComponentEvent.
-
ancestorHidden
protected void ancestorHidden()
This method will process component hidden event for the popup's ancestor. By default we will hide the popup immediately. You can override this to customize the behavior.
-
ancestorMoved
protected void ancestorMoved()
This method will process component moved event for the popup's ancestor. By default we will move the popup if getDefaultMoveOperation() is MOVE_ON_MOVED, or hide the popup if getDefaultMoveOperation() is HIDE_ON_MOVED. You can override this to customize the behavior.
-
hidePopup
public void hidePopup()
-
hidePopup
public void hidePopup(boolean cancelled)
-
isPopupVisible
public boolean isPopupVisible()
-
getPopupBounds
public java.awt.Rectangle getPopupBounds()
-
hidePopupImmediately
public void hidePopupImmediately(boolean cancelled)
-
hidePopupImmediately
public void hidePopupImmediately()
Hides the popup immediately (compare tohidePopup()could use animation to hide the popup).
-
shouldAWTEventListenerBeUsed
protected boolean shouldAWTEventListenerBeUsed()
Returns whether the AWTEventEventListener should be used to handle event processing- Returns:
- true to use the AWT event listener; false otherwise
-
getOwner
public java.awt.Component getOwner()
Gets the owner of the popup.- Returns:
- the owner of the popup.
-
setOwner
public void setOwner(java.awt.Component owner)
Sets the owner of the popup. By default, we will call addExcludedComponent(owner) so that clicking on the owner will not hide the popup. If you prefer to hide the popup when the owner is clicked, please callremoveExcludedComponent(java.awt.Component)to remove it explicitly after setOwner is called.- Parameters:
owner- the new owner.
-
isMovable
public boolean isMovable()
Checks if the popup is movable. If yes, it will show the gripper so that user can grab it and move the popup. If the popup is attached to its owner, moving it will detach from the owner.- Returns:
- true if gripper is visible
-
setMovable
public void setMovable(boolean movable)
Sets the movable attribute.- Parameters:
movable- true or false.
-
isResizable
public boolean isResizable()
Checks if the popup is resizable. By default, resizable option is true. Depending on the detached/attached mode, the resizing behavior may be different. If a popup is detached to a component, it only allows you to resize from bottom, bottom right and right It obviously doesn't make sense to resize from top and top side is aligned with the attached component. (Notes: in the future we will allow resize from different corner if the popup is shown above owner due to not enough space on the screen).- Returns:
- if the popup is resizable.
-
setResizable
public void setResizable(boolean resizable)
Sets the resizable option.- Parameters:
resizable- true or false.
-
isAttachable
public boolean isAttachable()
Checks if the popup is attachable. By default, attachable option is true.- Returns:
- if the popup is attachable.
-
setAttachable
public void setAttachable(boolean attachable)
Sets the attachable option.- Parameters:
attachable- true or false.
-
isDetached
public boolean isDetached()
Checks if the popup is detached. A popup has detached and attached mode. When a popup is in attached, it will act like it's part of the owner (which can be set usingsetOwner(java.awt.Component). When owner is moved, the popup will be moved. If the owner is hidden, the popup will hidden. In the other word, it is attached with the owner. In detached mode, popup becomes an independent floating window. It will stay at the same location regardless if owner is moved. It could still be visible when owner is hidden.- Returns:
- true if it's ddetached Otherwise false.
-
setDetached
public void setDetached(boolean detached)
Changes the popup's detached mode.- Parameters:
detached- true or false.
-
getPopupBorder
public javax.swing.border.Border getPopupBorder()
Gets the popup border set bysetPopupBorder(javax.swing.border.Border).- Returns:
- the border for this popup.
-
setPopupBorder
public void setPopupBorder(javax.swing.border.Border popupBorder)
Sets the border for this popup. Please note a non-empty border is needed if you want the popup to be resizable.- Parameters:
popupBorder- the border for the popup.
-
isTransient
public boolean isTransient()
Checks if the popup is transient.- Returns:
- true if transient.
- See Also:
setTransient(boolean)
-
setTransient
public void setTransient(boolean isTransient)
Sets the transient attribute. If a popup is transient, it will hide automatically when mouse is clicked outside the popup. Otherwise, it will stay visible until timeout or hidePopup() is called.- Parameters:
isTransient- true or false.
-
getTimeout
public int getTimeout()
Gets the time out value, in milliseconds.- Returns:
- the time out value, in milliseconds.
-
setTimeout
public void setTimeout(int timeout)
Sets the time out value, in milliseconds. If you don't want the popup hide after the time out, set the value to 0. By default it's 0 meaning it will never time out. Typically, you call setTimeOut before the popup is visible. But if you do call setTimeOut when popup is already visible (which means the timer is running), we will restart the timer using the new time out value you just set, even the new time out value is the same as the old one. In the other word, this setTimeOut call will always restart the timer if the timer is running.- Parameters:
timeout- new time out value, in milliseconds. 0 if you don't want popup automatically hides.
-
getDefaultFocusComponent
public java.awt.Component getDefaultFocusComponent()
Gets the default focus component.- Returns:
- the default focus component.
-
setDefaultFocusComponent
public void setDefaultFocusComponent(java.awt.Component defaultFocusComponent)
Sets the default focus component. Default focus component should be a child component on this popup. It will get focus when popup is shown. By setting a non-null component as default focus component, the JWindow that contains the JidePopup will be set focusable. Otherwise the JWindow will be non-focusable.- Parameters:
defaultFocusComponent- the default focus component.
-
addPopupMenuListener
public void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
Adds aPopupMenulistener which will listen to notification messages from the popup portion of the combo box. For all standard look and feels shipped with Java 2, the popup list portion of combo box is implemented as aJPopupMenu. A custom look and feel may not implement it this way and will therefore not receive the notification.- Parameters:
l- thePopupMenuListenerto add
-
removePopupMenuListener
public void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
Removes aPopupMenuListener.- Parameters:
l- thePopupMenuListenerto remove- Since:
- 1.4
- See Also:
addPopupMenuListener(javax.swing.event.PopupMenuListener)
-
getPopupMenuListeners
public javax.swing.event.PopupMenuListener[] getPopupMenuListeners()
Returns an array of all thePopupMenuListeners added to this JComboBox with addPopupMenuListener().- Returns:
- all of the
PopupMenuListeners added or an empty array if no listeners have been added
-
firePopupMenuWillBecomeVisible
public void firePopupMenuWillBecomeVisible()
NotifiesPopupMenuListeners that the popup portion of the combo box will become visible. This method is public but should not be called by anything other than the UI delegate.
-
firePopupMenuWillBecomeInvisible
public void firePopupMenuWillBecomeInvisible()
NotifiesPopupMenuListeners that the popup portion of the combo box has become invisible. This method is public but should not be called by anything other than the UI delegate.
-
firePopupMenuCanceled
public void firePopupMenuCanceled()
NotifiesPopupMenuListeners that the popup portion of the combo box has been canceled. This method is public but should not be called by anything other than the UI delegate.
-
getDefaultMoveOperation
public int getDefaultMoveOperation()
Gets the default operation when the owner is moved. The valid values are eitherHIDE_ON_MOVED,MOVE_ON_MOVEDorDO_NOTHING_ON_MOVED.- Returns:
- the default operation when the owner is moved.
-
setDefaultMoveOperation
public void setDefaultMoveOperation(int defaultMoveOperation)
Sets the default operation when the owner is moved. The valid could be eitherHIDE_ON_MOVED,MOVE_ON_MOVEDorDO_NOTHING_ON_MOVED.- Parameters:
defaultMoveOperation- the default operation when the owner is moved.
-
addExcludedComponent
public void addExcludedComponent(java.awt.Component component)
Adds a component as excluded component. If a component is an excluded component or descendant of an excluded component, clicking on it will not hide the popup. For example, AbstractComboBox uses JidePopup to display the popup. If you want to show a JDialog from the popup, you will have to add the dialog as excluded component. See below for an example.JDialog dialog =new JDialog((Frame) JideSwingUtilities.getWindowForComponent(this), true); dialog.add(new JTable(10, 4)); dialog.pack(); Container ancestorOfClass = SwingUtilities.getAncestorOfClass(JidePopup.class, this); // try to find the JidePopup if(ancestorOfClass instanceof JidePopup) { ((JidePopup) ancestorOfClass).addExcludedComponent(dialog); } dialog.setVisible(true); if(ancestorOfClass instanceof JidePopup) { ((JidePopup) ancestorOfClass).removeExcludedComponent(dialog); }- Parameters:
component- the component should be excluded.
-
removeExcludedComponent
public void removeExcludedComponent(java.awt.Component component)
Removes a component from the excluded component list. If a component is an excluded component, clicking on it will not hide the popup.- Parameters:
component- the component was excluded before.
-
removeAllExcludedComponents
public void removeAllExcludedComponents()
Removes all excluded components that were added before.
-
isExcludedComponent
public boolean isExcludedComponent(java.awt.Component component)
Checks if a component is an excluded component. If a component is an excluded component, clicking on it will not hide the popup. By default, owner is always the excluded component.- Parameters:
component- a component.- Returns:
- true if the component is an excluded component.
-
getGripperLocation
public int getGripperLocation()
-
setGripperLocation
public void setGripperLocation(int gripperLocation)
Sets the gripper location. The valid values areSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST, andSwingConstants.WEST.- Parameters:
gripperLocation- the new gripper location.
-
getPopupType
public int getPopupType()
-
setPopupType
public void setPopupType(int popupType)
-
isClickOnPopup
public boolean isClickOnPopup(java.awt.event.MouseEvent e)
Checks if the mouse event is on the popup. By default, we will check if popup is an ancestor of the clicked component. If it returns true, the popup will not be hidden. If false, the popup will be hidden as we consider the mouse click is outside the popup.- Parameters:
e- the mouse event- Returns:
- true or false.
-
getActualOwner
protected java.awt.Component getActualOwner()
Gets the actual owner. User can set owner usingsetOwner(java.awt.Component)method. But when one of the showPopup methods with owner parameter is called, the actual owner will be changed to this component.- Returns:
- the actual owner.
-
setPreferredPopupSize
public void setPreferredPopupSize(java.awt.Dimension size)
Sets the preferred popup size. This method can be used when you want to keep the popup size to be the same as when it was closed.- Parameters:
size- the size of the popup when it was shown last time.
-
getPreferredPopupSize
public java.awt.Dimension getPreferredPopupSize()
-
isPopupAncestorOf
public static boolean isPopupAncestorOf(JidePopup popup, java.awt.Component c)
-
isReturnFocusToOwner
public boolean isReturnFocusToOwner()
gets the flag. If true, it will return focus to the owner when the popup is hidden.- Returns:
- true or false.
-
setReturnFocusToOwner
public void setReturnFocusToOwner(boolean returnFocusToOwner)
Sets the flag to return focus to the owner when the popup is hidden.- Parameters:
returnFocusToOwner- true or false.
-
isEnsureInOneScreen
public boolean isEnsureInOneScreen()
Checks if the popup will be shown in one screen.- Returns:
- true or false.
- Since:
- 3.6.3
-
setEnsureInOneScreen
public void setEnsureInOneScreen(boolean ensureInOneScreen)
Sets the flag if the popup should appear within one screen. True in one screen. False to allow cross two screens.- Parameters:
ensureInOneScreen- true or false.- Since:
- 3.6.3
-
-