public class JidePopup
extends javax.swing.JComponent
implements javax.accessibility.Accessible, javax.swing.WindowConstants
JidePopup
is 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 call setDefaultFocusComponent(java.awt.Component)
to set a child component as the default focus component.Modifier and Type | Class and Description |
---|---|
protected class |
JidePopup.AccessiblePopup
This class implements accessibility support for the
Popup class. |
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.awt.Component |
_actualOwner |
protected java.awt.Point |
_actualOwnerLocation |
protected boolean |
_detached |
protected java.awt.Insets |
_insets |
protected ResizablePanel |
_panel |
protected java.awt.Dimension |
_previousSize |
protected ResizableSupport |
_resizableSupport |
protected ResizableWindow |
_window |
static java.lang.String |
ATTACHABLE_PROPERTY
Constrained property name indicating that the popup is attachable.
|
static 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.
|
static java.lang.String |
CONTENT_PANE_PROPERTY
Bound property name.
|
static java.lang.String |
DETACHED_PROPERTY
Bound property name for if the popup is detached.
|
int |
DISTANCE_TO_SCREEN_BORDER
The distance between alert and screen border.
|
static int |
DO_NOTHING_ON_MOVED
Hides the popup when the owner is moved.
|
static java.lang.String |
GLASS_PANE_PROPERTY
Bound property name.
|
static int |
HEAVY_WEIGHT_POPUP |
static int |
HIDE_ON_MOVED
Hides the popup when the owner is moved.
|
static java.lang.String |
LAYERED_PANE_PROPERTY
Bound property name.
|
static int |
LIGHT_WEIGHT_POPUP
Key used to indicate a light weight popup should be used.
|
static java.lang.String |
MENU_BAR_PROPERTY
Bound property name.
|
static java.lang.String |
MOVABLE_PROPERTY
Bound property name for gripper.
|
static int |
MOVE_ON_MOVED
Moves the popup along with owner when the owner is moved.
|
static java.lang.String |
OWNER_PROPERTY
Bound property name for owner.
|
static java.lang.String |
PROPERTY_GRIPPER_LOCATION |
static java.lang.String |
RESIZABLE_PROPERTY
Bound property name for resizable.
|
static java.lang.String |
ROOT_PANE_PROPERTY
Bound property name.
|
static java.lang.String |
TRANSIENT_PROPERTY |
static java.lang.String |
VISIBLE_PROPERTY
Bound property name.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
JidePopup()
Creates a Popup.
|
Modifier and Type | Method and Description |
---|---|
void |
addExcludedComponent(java.awt.Component component)
Adds a component as excluded component.
|
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.
|
void |
addPopupMenuListener(javax.swing.event.PopupMenuListener l)
Adds a
PopupMenu listener which will listen to notification messages from the popup portion of the
combo box. |
protected void |
ancestorHidden()
This method will process component hidden event for the popup's ancestor.
|
protected void |
ancestorMoved()
This method will process component moved event for the popup's ancestor.
|
protected void |
beginDragging(javax.swing.JComponent f,
int mouseX,
int mouseY,
double relativeX,
double relativeY) |
protected void |
contentResized() |
protected ResizableWindow |
createHeavyweightPopupContainer(java.awt.Component owner) |
protected ResizablePanel |
createLightweightPopupContainer(java.awt.Component owner)
Creates lightweight container for the popup.
|
protected javax.swing.JRootPane |
createRootPane()
Called by the constructor to set up the
JRootPane . |
protected void |
createWindow(java.awt.Component owner,
int x,
int y) |
protected void |
drag(javax.swing.JComponent f,
int newX,
int newY,
int mouseModifiers) |
protected void |
endDragging() |
void |
firePopupMenuCanceled()
Notifies
PopupMenuListener s that the popup portion of the combo box has been canceled. |
void |
firePopupMenuWillBecomeInvisible()
Notifies
PopupMenuListener s that the popup portion of the combo box has become invisible. |
void |
firePopupMenuWillBecomeVisible()
Notifies
PopupMenuListener s that the popup portion of the combo box will become visible. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the
AccessibleContext associated with this Popup . |
protected java.awt.Component |
getActualOwner()
Gets the actual owner.
|
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.
|
java.awt.Container |
getContentPane()
Returns the content pane for this Popup.
|
java.awt.Component |
getDefaultFocusComponent()
Gets the default focus component.
|
int |
getDefaultMoveOperation()
Gets the default operation when the owner is moved.
|
protected java.awt.Rectangle |
getDisplayScreenBounds(java.awt.Component owner) |
protected java.awt.Point |
getDisplayStartLocation(java.awt.Rectangle screenDim,
java.awt.Dimension size,
int location) |
protected static java.awt.Frame |
getFrame(java.awt.Component c) |
java.awt.Component |
getGlassPane()
Returns the glass pane for this popup.
|
int |
getGripperLocation() |
javax.swing.JMenuBar |
getJMenuBar()
Returns the current
JMenuBar for this Popup , or null if no menu bar has
been set. |
javax.swing.JLayeredPane |
getLayeredPane()
Returns the layered pane for this popup.
|
java.awt.Component |
getOwner() |
javax.swing.border.Border |
getPopupBorder()
Gets the popup border set by
setPopupBorder(javax.swing.border.Border) . |
java.awt.Rectangle |
getPopupBounds() |
protected java.awt.Point |
getPopupLocation(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 the
PopupMenuListener s added to this JComboBox with addPopupMenuListener(). |
int |
getPopupType() |
protected javax.swing.JComponent |
getRealParent(javax.swing.RootPaneContainer rootPaneContainer) |
javax.swing.JRootPane |
getRootPane()
Returns the
rootPane object for this popup. |
int |
getTimeout()
Gets the time out value, in milliseconds.
|
static java.awt.Component |
getTopLevelAncestor(java.awt.Component component) |
PopupUI |
getUI()
Returns the look-and-feel object that renders this component.
|
java.lang.String |
getUIClassID()
Returns the name of the look-and-feel class that renders this component.
|
protected void |
handleComponentEvent(java.awt.event.ComponentEvent e)
This method will process component event.
|
protected void |
handleMouseDragged(java.awt.event.MouseEvent e) |
protected void |
handleMouseEntered(java.awt.event.MouseEvent e) |
protected void |
handleMouseExited(java.awt.event.MouseEvent e) |
protected void |
handleMousePressed(java.awt.event.MouseEvent e) |
protected void |
handleMouseReleased(java.awt.event.MouseEvent e) |
protected void |
handleWindowEvent(java.awt.event.WindowEvent e) |
void |
hidePopup() |
void |
hidePopup(boolean cancelled) |
void |
hidePopupImmediately()
Hides the popup immediately (compare to
hidePopup() could use animation to hide the popup). |
void |
hidePopupImmediately(boolean cancelled) |
protected void |
installBorder() |
protected void |
installListeners() |
protected void |
internalShowPopup(int x,
int y) |
protected void |
internalShowPopup(int x,
int y,
java.awt.Component owner) |
boolean |
isAttachable()
Checks if the popup is attachable.
|
boolean |
isClickOnPopup(java.awt.event.MouseEvent e)
Checks if the mouse event is on the popup.
|
boolean |
isDetached()
Checks if the popup is detached.
|
protected boolean |
isDragging() |
boolean |
isExcludedComponent(java.awt.Component component)
Checks if a component is an excluded component.
|
boolean |
isKeepPreviousSize()
Get the flag indicating if JidePopup should keep the size last time it was popped up.
|
boolean |
isMovable()
Checks if the popup is movable.
|
static boolean |
isPopupAncestorOf(JidePopup popup,
java.awt.Component c) |
boolean |
isPopupVisible() |
boolean |
isResizable()
Checks if the popup is resizable.
|
protected boolean |
isRootPaneCheckingEnabled()
Returns whether calls to
add and setLayout cause an exception to be thrown. |
boolean |
isTransient()
Checks if the popup is transient.
|
protected void |
movePopup() |
void |
packPopup() |
void |
remove(java.awt.Component comp)
Removes the specified component from this container.
|
void |
removeAllExcludedComponents()
Removes all excluded components that were added before.
|
void |
removeExcludedComponent(java.awt.Component component)
Removes a component from the excluded component list.
|
void |
removePopupMenuListener(javax.swing.event.PopupMenuListener l)
Removes a
PopupMenuListener . |
void |
setAttachable(boolean attachable)
Sets the attachable option.
|
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.
|
void |
setContentPane(java.awt.Container c)
Sets this
Popup 's contentPane property. |
void |
setDefaultFocusComponent(java.awt.Component defaultFocusComponent)
Sets the default focus component.
|
void |
setDefaultMoveOperation(int defaultMoveOperation)
Sets the default operation when the owner is moved.
|
void |
setDetached(boolean detached)
Changes the popup's detached mode.
|
void |
setGlassPane(java.awt.Component glass)
Sets this
Popup 's glassPane property. |
void |
setGripperLocation(int gripperLocation)
Sets the gripper location.
|
void |
setJMenuBar(javax.swing.JMenuBar m)
Sets the
menuBar property for this Popup . |
void |
setKeepPreviousSize(boolean keepPreviousSize)
Set the flag indicating if JidePopup should keep the size last time it was popped up.
|
void |
setLayeredPane(javax.swing.JLayeredPane layered)
Sets this
Popup 's layeredPane property. |
void |
setLayout(java.awt.LayoutManager manager)
Ensures that, by default, the layout of this component cannot be set.
|
void |
setMovable(boolean movable)
Sets the movable attribute.
|
void |
setOwner(java.awt.Component owner) |
void |
setPopupBorder(javax.swing.border.Border popupBorder)
Sets the border for this popup.
|
void |
setPopupType(int popupType) |
void |
setPreferredPopupSize(java.awt.Dimension size)
Sets the preferred popup size.
|
void |
setResizable(boolean resizable)
Sets the resizable option.
|
protected void |
setRootPane(javax.swing.JRootPane root)
Sets the
rootPane property for this Popup . |
protected void |
setRootPaneCheckingEnabled(boolean enabled)
Determines whether calls to
add and setLayout cause an exception to be thrown. |
void |
setTimeout(int timeout)
Sets the time out value, in milliseconds.
|
void |
setTransient(boolean isTransient)
Sets the transient attribute.
|
void |
setUI(PopupUI ui)
Sets the UI delegate for this
Popup . |
void |
setupResizeCorner(int corner)
Setup Resizable's ResizeCorner.
|
void |
setVisible(boolean visible)
Makes the component visible or invisible.
|
protected boolean |
shouldAWTEventListenerBeUsed()
Returns whether the AWTEventEventListener should be used to handle event processing
|
void |
showPopup()
Shows the popup.
|
void |
showPopup(java.awt.Component owner)
Shows the popup.
|
void |
showPopup(java.awt.Insets insets)
Shows the popup.
|
void |
showPopup(java.awt.Insets insets,
java.awt.Component owner)
Shows the popup.
|
void |
showPopup(int location)
Shows the popup at the specified location relative to the screen.
|
void |
showPopup(int location,
java.awt.Component owner)
Shows the popup at the specified location relative to the owner.
|
void |
showPopup(int x,
int y)
Shows the popup at the specified x and y coordinates.
|
void |
showPopup(int x,
int y,
java.awt.Component owner)
Shows the popup at the specified x and y coordinates.
|
protected void |
showPopupImmediately() |
void |
updateUI()
Notification from the
UIManager that the look and feel has changed. |
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
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String CONTENT_PANE_PROPERTY
public static final java.lang.String MENU_BAR_PROPERTY
public static final java.lang.String LAYERED_PANE_PROPERTY
public static final java.lang.String ROOT_PANE_PROPERTY
public static final java.lang.String GLASS_PANE_PROPERTY
public static final java.lang.String VISIBLE_PROPERTY
public static final java.lang.String TRANSIENT_PROPERTY
public static final java.lang.String ATTACHABLE_PROPERTY
public static final java.lang.String MOVABLE_PROPERTY
public static final java.lang.String DETACHED_PROPERTY
protected boolean _detached
protected ResizableWindow _window
protected ResizablePanel _panel
protected ResizableSupport _resizableSupport
public static final java.lang.String CLIENT_PROPERTY_POPUP_ACTUAL_OWNER
JComponent c = JideSwingUtilities.getFirstJComponent(dialog);
if(c != null) {
c.putClientProperty(JidePopup.CLIENT_PROPERTY_POPUP_ACTUAL_OWNER, component);
}
public static final java.lang.String RESIZABLE_PROPERTY
public static final java.lang.String OWNER_PROPERTY
public static final int DO_NOTHING_ON_MOVED
public static final int HIDE_ON_MOVED
public static final int MOVE_ON_MOVED
public int DISTANCE_TO_SCREEN_BORDER
public static final java.lang.String PROPERTY_GRIPPER_LOCATION
protected java.awt.Dimension _previousSize
protected java.awt.Component _actualOwner
protected java.awt.Point _actualOwnerLocation
public static final int LIGHT_WEIGHT_POPUP
public static final int HEAVY_WEIGHT_POPUP
protected java.awt.Insets _insets
protected javax.swing.JRootPane createRootPane()
JRootPane
.JRootPane
JRootPane
public PopupUI getUI()
PopupUI
object that renders this componentpublic void setUI(PopupUI ui)
Popup
.ui
- the UI delegatepublic void updateUI()
UIManager
that the look and feel has changed. Replaces the current UI object
with the latest version from the UIManager
.updateUI
in class javax.swing.JComponent
JComponent.updateUI()
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JComponent
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
protected boolean isRootPaneCheckingEnabled()
add
and setLayout
cause an exception to be thrown.true
if add
and setLayout
are checkedaddImpl(java.awt.Component, java.lang.Object, int)
,
setLayout(java.awt.LayoutManager)
,
setRootPaneCheckingEnabled(boolean)
protected void setRootPaneCheckingEnabled(boolean enabled)
add
and setLayout
cause an exception to be thrown.enabled
- a boolean value, true
if checking is to be enabled, which cause the exceptions to be
thrownaddImpl(java.awt.Component, java.lang.Object, int)
,
setLayout(java.awt.LayoutManager)
,
isRootPaneCheckingEnabled()
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
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.
addImpl
in class java.awt.Container
comp
- the Component
to be addedconstraints
- the object containing the constraints, if anyindex
- the indexjava.lang.Error
- if called with isRootPaneChecking
true
setRootPaneCheckingEnabled(boolean)
public void remove(java.awt.Component comp)
remove
in class java.awt.Container
comp
- the component to be removedContainer.add(java.awt.Component)
public void setLayout(java.awt.LayoutManager manager)
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.
setLayout
in class java.awt.Container
manager
- the LayoutManager
java.lang.Error
- if called with isRootPaneChecking
true
setRootPaneCheckingEnabled(boolean)
public javax.swing.JMenuBar getJMenuBar()
JMenuBar
for this Popup
, or null
if no menu bar has
been set.JMenuBar
used by this Popup.setJMenuBar(javax.swing.JMenuBar)
public void setJMenuBar(javax.swing.JMenuBar m)
menuBar
property for this Popup
.m
- the JMenuBar
to use in this Popup.getJMenuBar()
public java.awt.Container getContentPane()
public void setContentPane(java.awt.Container c)
Popup
's contentPane
property.c
- the content pane for this popup.java.awt.IllegalComponentStateException
- (a runtime exception) if the content pane parameter is null
RootPaneContainer.getContentPane()
public javax.swing.JLayeredPane getLayeredPane()
JLayeredPane
objectRootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
,
RootPaneContainer.getLayeredPane()
public void setLayeredPane(javax.swing.JLayeredPane layered)
Popup
's layeredPane
property.layered
- the JLayeredPane
for this popupjava.awt.IllegalComponentStateException
- (a runtime exception) if the layered pane parameter is null
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)
public java.awt.Component getGlassPane()
RootPaneContainer.setGlassPane(java.awt.Component)
public void setGlassPane(java.awt.Component glass)
Popup
's glassPane
property.glass
- the glass pane for this popupRootPaneContainer.getGlassPane()
public javax.swing.JRootPane getRootPane()
rootPane
object for this popup.getRootPane
in class javax.swing.JComponent
rootPane
propertyRootPaneContainer.getRootPane()
protected void setRootPane(javax.swing.JRootPane root)
rootPane
property for this Popup
. This method is called by the constructor.root
- the new JRootPane
objectpublic void setVisible(boolean visible)
Component.setVisible
.setVisible
in class javax.swing.JComponent
visible
- true to make the component visible; false to make it invisiblepublic javax.accessibility.AccessibleContext getAccessibleContext()
AccessibleContext
associated with this Popup
. For popups, the
AccessibleContext
takes the form of an AccessiblePopup
object. A new
AccessiblePopup
instance is created if necessary.getAccessibleContext
in interface javax.accessibility.Accessible
getAccessibleContext
in class java.awt.Component
AccessiblePopup
that serves as the AccessibleContext
of this
Popup
JidePopup.AccessiblePopup
public boolean isKeepPreviousSize()
public void setKeepPreviousSize(boolean keepPreviousSize)
keepPreviousSize
- the flag.public java.awt.Insets getBackToOriginalInsets()
public void setBackToOriginalInsets(java.awt.Insets backToOriginalInsets)
backToOriginalInsets
- the insetspublic void showPopup()
public void showPopup(java.awt.Component owner)
owner
- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or
ContentContainerpublic void showPopup(java.awt.Insets insets)
insets
- the popup's insets RootPaneContainer(Applet) or ContentContainerpublic void showPopup(java.awt.Insets insets, java.awt.Component owner)
insets
- the popup's insetsowner
- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or
ContentContainerprotected java.awt.Point getPopupLocation(java.awt.Point point, java.awt.Dimension size, java.awt.Component owner)
point
- owner is top-left coordinate relative to screen.size
- the size of the popup window.owner
- the ownerpublic void setupResizeCorner(int corner)
corner
- the corner.public static java.awt.Component getTopLevelAncestor(java.awt.Component component)
public void showPopup(int location)
SwingConstants.CENTER
SwingConstants.SOUTH
SwingConstants.NORTH
SwingConstants.WEST
SwingConstants.EAST
SwingConstants.NORTH_EAST
SwingConstants.NORTH_WEST
SwingConstants.SOUTH_EAST
SwingConstants.SOUTH_WEST
DISTANCE_TO_SCREEN_BORDER
.location
- the new location.public void showPopup(int location, java.awt.Component owner)
SwingConstants.CENTER
SwingConstants.SOUTH
SwingConstants.NORTH
SwingConstants.WEST
SwingConstants.EAST
SwingConstants.NORTH_EAST
SwingConstants.NORTH_WEST
SwingConstants.SOUTH_EAST
SwingConstants.SOUTH_WEST
DISTANCE_TO_SCREEN_BORDER
.location
- the new locationowner
- the popup window's owner; if unspecified, it will default to the RootPaneContainer(Applet) or
ContentContainerprotected java.awt.Point getDisplayStartLocation(java.awt.Rectangle screenDim, java.awt.Dimension size, int location)
protected java.awt.Rectangle getDisplayScreenBounds(java.awt.Component owner)
public void packPopup()
protected void internalShowPopup(int x, int y)
protected void internalShowPopup(int x, int y, java.awt.Component owner)
protected void createWindow(java.awt.Component owner, int x, int y)
public void showPopup(int x, int y)
x
- the x position. It is screen position.y
- the y position. It is screen position.public void showPopup(int x, int y, java.awt.Component owner)
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
ContentContainerprotected static java.awt.Frame getFrame(java.awt.Component c)
protected ResizableWindow createHeavyweightPopupContainer(java.awt.Component owner)
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.protected ResizablePanel createLightweightPopupContainer(java.awt.Component owner)
owner
- the owner for this popup container. This parameter is not used in this method. It was there mainly
because the corresponding createHeavyweightPopupContainer(java.awt.Component)
has this
parameter.protected void installListeners()
protected void contentResized()
protected void installBorder()
protected void showPopupImmediately()
protected void movePopup()
protected void endDragging()
protected void beginDragging(javax.swing.JComponent f, int mouseX, int mouseY, double relativeX, double relativeY)
protected boolean isDragging()
protected void drag(javax.swing.JComponent f, int newX, int newY, int mouseModifiers)
protected void handleMousePressed(java.awt.event.MouseEvent e)
protected void handleMouseReleased(java.awt.event.MouseEvent e)
protected void handleMouseDragged(java.awt.event.MouseEvent e)
protected void handleMouseEntered(java.awt.event.MouseEvent e)
protected void handleMouseExited(java.awt.event.MouseEvent e)
protected void handleWindowEvent(java.awt.event.WindowEvent e)
protected javax.swing.JComponent getRealParent(javax.swing.RootPaneContainer rootPaneContainer)
protected void handleComponentEvent(java.awt.event.ComponentEvent e)
getDefaultMoveOperation()
value.e
- the ComponentEvent.protected void ancestorHidden()
protected void ancestorMoved()
public void hidePopup()
public void hidePopup(boolean cancelled)
public boolean isPopupVisible()
public java.awt.Rectangle getPopupBounds()
public void hidePopupImmediately(boolean cancelled)
public void hidePopupImmediately()
hidePopup()
could use animation to hide the popup).protected boolean shouldAWTEventListenerBeUsed()
public java.awt.Component getOwner()
public void setOwner(java.awt.Component owner)
public boolean isMovable()
public void setMovable(boolean movable)
movable
- true or false.public boolean isResizable()
public void setResizable(boolean resizable)
resizable
- true or false.public boolean isAttachable()
public void setAttachable(boolean attachable)
attachable
- true or false.public boolean isDetached()
setOwner(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.
public void setDetached(boolean detached)
detached
- true or false.public javax.swing.border.Border getPopupBorder()
setPopupBorder(javax.swing.border.Border)
.public void setPopupBorder(javax.swing.border.Border popupBorder)
popupBorder
- the border for the popup.public boolean isTransient()
setTransient(boolean)
public void setTransient(boolean isTransient)
isTransient
- true or false.public int getTimeout()
public void setTimeout(int timeout)
timeout
- new time out value, in milliseconds. 0 if you don't want popup automatically hides.public java.awt.Component getDefaultFocusComponent()
public void setDefaultFocusComponent(java.awt.Component defaultFocusComponent)
defaultFocusComponent
- the default focus component.public void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
PopupMenu
listener 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 a
JPopupMenu
. A custom look and feel may not implement it this way and will therefore not receive the
notification.l
- the PopupMenuListener
to addpublic void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
PopupMenuListener
.l
- the PopupMenuListener
to removeaddPopupMenuListener(javax.swing.event.PopupMenuListener)
public javax.swing.event.PopupMenuListener[] getPopupMenuListeners()
PopupMenuListener
s added to this JComboBox with addPopupMenuListener().PopupMenuListener
s added or an empty array if no listeners have been addedpublic void firePopupMenuWillBecomeVisible()
PopupMenuListener
s 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.public void firePopupMenuWillBecomeInvisible()
PopupMenuListener
s 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.public void firePopupMenuCanceled()
PopupMenuListener
s 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.public int getDefaultMoveOperation()
HIDE_ON_MOVED
, MOVE_ON_MOVED
or DO_NOTHING_ON_MOVED
.public void setDefaultMoveOperation(int defaultMoveOperation)
HIDE_ON_MOVED
, MOVE_ON_MOVED
or DO_NOTHING_ON_MOVED
.defaultMoveOperation
- the default operation when the owner is moved.public void addExcludedComponent(java.awt.Component component)
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);
}
component
- the component should be excluded.public void removeExcludedComponent(java.awt.Component component)
component
- the component was excluded before.public void removeAllExcludedComponents()
public boolean isExcludedComponent(java.awt.Component component)
component
- a component.public int getGripperLocation()
public void setGripperLocation(int gripperLocation)
SwingConstants.NORTH
, SwingConstants.SOUTH
,
SwingConstants.EAST
, and SwingConstants.WEST
.gripperLocation
- the new gripper location.public int getPopupType()
public void setPopupType(int popupType)
public boolean isClickOnPopup(java.awt.event.MouseEvent e)
e
- the mouse eventprotected java.awt.Component getActualOwner()
setOwner(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.public void setPreferredPopupSize(java.awt.Dimension size)
size
- the size of the popup when it was shown last time.public static boolean isPopupAncestorOf(JidePopup popup, java.awt.Component c)