|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.combobox.PopupPanel
public class PopupPanel
This PopupPanel
is part of AbstractComboBox
. ComboBox usually needs a popup panel, either
as drop down or a dialog. In either case, it is used to select something. All subclasses of
AbstractComboBox
should use PopupPanel
or subclass of PopupPanel
to create a
panel that can be used by AbstractComboBox
.
PopupPanel
extends JPanel
. In
addition, it implements ItemSelectable
interface. It also can take ItemListener
so that any
selection change event can be fired.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected Object |
_previousSelectedObject
|
static String |
SELECTED_BY_MOUSE_ROLLOVER
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PopupPanel()
Creates a PopupPanel with FlowLayout . |
|
PopupPanel(LayoutManager layout)
Creates a PopupPanel with the specified layout. |
Method Summary | |
---|---|
void |
addItemListener(ItemListener l)
Adds an ItemListener . |
void |
addItemListener(ItemListener l,
int index)
Adds an ItemListener . |
protected void |
fireItemStateChanged(ItemEvent e)
Notifies all listeners that have registered interest for notification on this event type. |
Dimension |
getActualPreferredSize()
|
Component |
getDefaultFocusComponent()
Gets the default focus component. |
ItemListener[] |
getItemListeners()
Returns an array of all the ItemListener s added to this JComboBox with addItemListener(). |
MouseListener |
getMouseListener()
|
MouseMotionListener |
getMouseMotionListener()
|
Dimension |
getPreferredSize()
|
Object |
getPreviousSelectedObject()
Gets the previously selected object. |
int |
getResizableCorners()
Gets the resizable corners. |
Object |
getSelectedObject()
Gets the selected object. |
Object[] |
getSelectedObjects()
Returns the selected items or null if no items are selected. |
String |
getTitle()
Gets the title of the popup panel. |
boolean |
isResetButtonVisible()
Checks if reset button is visible when popup panel is display in dialog in DIALOG type AbstractComboBox. |
boolean |
isResizable()
Checks if popup panel is resizable. |
boolean |
isStretchToFit()
Checks if the popup panel should be stretched be the same width as the combobox. |
boolean |
needsButtons()
Some popup panel doesn't have a OK or Cancel button to confirm the selection. |
void |
removeAllListeners()
Removes all listeners it created. |
void |
removeItemListener(ItemListener aListener)
Removes an ItemListener . |
void |
requestFocus()
|
void |
setDefaultFocusComponent(Component defaultFocusComponent)
Sets the default focus component. |
void |
setNeedButtons(boolean needButtons)
Configure if buttons are needed. |
void |
setPreferredSize(Dimension preferredSize)
|
void |
setResizable(boolean resizable)
Sets the resizable property. |
void |
setResizableCorners(int resizableCorners)
Sets resizable corners. |
void |
setSelectedObject(Object selectedObject)
Sets the selected object and fire ItemEvent . |
void |
setSelectedObject(Object selectedObject,
AbstractComboBox comboBox)
Deprecated. replaced by setSelectedObject(Object) |
void |
setSelectedObject(Object selectedObject,
AbstractComboBox comboBox,
boolean fireEvent)
Deprecated. replaced by setSelectedObject(Object, boolean) |
void |
setSelectedObject(Object selectedObject,
boolean fireEvent)
Sets the selected object and fire ItemEvent . |
void |
setStretchToFit(boolean stretchToFit)
Sets the flag if the popup panel should be stretched or shrunk to be the same width as the combobox. |
void |
setTitle(String title)
Sets the title of the popup panel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SELECTED_BY_MOUSE_ROLLOVER
protected Object _previousSelectedObject
Constructor Detail |
---|
public PopupPanel()
PopupPanel
with FlowLayout
.
public PopupPanel(LayoutManager layout)
PopupPanel
with the specified layout.
layout
- the layoutMethod Detail |
---|
public Object getSelectedObject()
public void removeAllListeners()
public void setSelectedObject(Object selectedObject)
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
selectedObject
- new selected objectpublic void setSelectedObject(Object selectedObject, boolean fireEvent)
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
selectedObject
- new selected objectfireEvent
- if fire the ItemEvent@Deprecated public void setSelectedObject(Object selectedObject, AbstractComboBox comboBox)
setSelectedObject(Object)
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
selectedObject
- new selected objectcomboBox
- the corresponding combo box instance@Deprecated public void setSelectedObject(Object selectedObject, AbstractComboBox comboBox, boolean fireEvent)
setSelectedObject(Object, boolean)
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
selectedObject
- new selected objectcomboBox
- the corresponding comboBox instancefireEvent
- if fire the ItemEvent for popupPanel. It will fire ItemEvent for comboBox anywaypublic void addItemListener(ItemListener l)
ItemListener
.
aListener
will receive one or two ItemEvent
s when the selected item changes.
addItemListener
in interface ItemSelectable
l
- the ItemListener
that is to be notifiedsetSelectedObject(java.lang.Object)
public void addItemListener(ItemListener l, int index)
ItemListener
.
aListener
will receive one or two ItemEvent
s when the selected item changes.
l
- the ItemListener
that is to be notifiedindex
- the index of the ItemListenersetSelectedObject(java.lang.Object)
public void removeItemListener(ItemListener aListener)
ItemListener
.
removeItemListener
in interface ItemSelectable
aListener
- the ItemListener
to removegetItemListeners()
public ItemListener[] getItemListeners()
ItemListener
s added to this JComboBox with addItemListener().
ItemListener
s added or an empty array if no listeners have been addedprotected void fireItemStateChanged(ItemEvent e)
e
- the event of interestEventListenerList
public Object[] getSelectedObjects()
null
if no items are selected.
getSelectedObjects
in interface ItemSelectable
public boolean isStretchToFit()
public void setStretchToFit(boolean stretchToFit)
stretchToFit
- true or false.public boolean needsButtons()
setNeedButtons(boolean)
public void setNeedButtons(boolean needButtons)
needButtons
- the flagpublic boolean isResetButtonVisible()
public Component getDefaultFocusComponent()
public void setDefaultFocusComponent(Component defaultFocusComponent)
defaultFocusComponent
- a component inside the popup panel.public void requestFocus()
requestFocus
in class JComponent
public String getTitle()
public void setTitle(String title)
title
- title of the popup panelpublic Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void setPreferredSize(Dimension preferredSize)
setPreferredSize
in class JComponent
public Dimension getActualPreferredSize()
public boolean isResizable()
public void setResizable(boolean resizable)
resizable
- true or false. True to make the popup panel resizable. If the popup panel is shown as popup, the
popup will be resizable. If the popup panel is shown as a dialog, the dialog will be resizable.isResizable()
public int getResizableCorners()
Resizable
.
public void setResizableCorners(int resizableCorners)
resizableCorners
- new resizable corners. The value is a bitwise OR of eight constants defined in Resizable
.public MouseMotionListener getMouseMotionListener()
public MouseListener getMouseListener()
public Object getPreviousSelectedObject()
setSelectedObject(Object, boolean)
is called
with fireEvent parameter set to true.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |