|
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 com.jidesoft.combobox.ListChooserPanel
public class ListChooserPanel
ListChooserPanel is a PopupPanel that can choose a value from a list.
Nested Class Summary | |
---|---|
protected class |
ListChooserPanel.Handler
|
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 Class<?> |
_class
|
protected JList |
_list
|
protected KeyListener |
keyListener
This protected field is implementation specific. |
protected MouseListener |
listMouseListener
This protected field is implementation specific. |
protected MouseMotionListener |
listMouseMotionListener
This protected field is implementation specific. |
protected ListSelectionListener |
listSelectionListener
This protected field is implementation specific. |
protected MouseListener |
mouseListener
This protected field is implementation specific. |
protected MouseMotionListener |
mouseMotionListener
This protected field is implementation specific. |
Fields inherited from class com.jidesoft.combobox.PopupPanel |
---|
_previousSelectedObject, 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 | |
---|---|
ListChooserPanel()
|
|
ListChooserPanel(ComboBoxModel model,
Class<?> clazz)
Creates a new ListChooserPanel . |
|
ListChooserPanel(ComboBoxModel model,
Class<?> clazz,
ConverterContext elementConverterContext)
Creates a new ListChooserPanel . |
|
ListChooserPanel(ComboBoxModel model,
Class<?> clazz,
ObjectConverter converter,
ConverterContext elementConverterContext)
Creates a new ListChooserPanel . |
|
ListChooserPanel(Object[] objects,
Class<?> clazz)
Creates a new ListChooserPanel . |
|
ListChooserPanel(Vector<?> objects,
Class<?> clazz)
Creates a new ListChooserPanel . |
Method Summary | |
---|---|
void |
contentsChanged(ListDataEvent e)
|
protected MouseEvent |
convertMouseEvent(MouseEvent e)
|
protected ListChooserPanel.Handler |
createHandler()
Creates the handler to handle mouse events and property change events |
protected ItemListener |
createItemListener()
Creates an ItemListener which will be added to the combo box. |
protected KeyListener |
createKeyListener()
Creates the key listener that will be added to the combo box. |
protected JList |
createList(ComboBoxModel comboBoxModel)
Subclass can override this method to create a custom JList. |
protected ListDataListener |
createListDataListener()
Creates a list data listener which will be added to the ComboBoxModel . |
protected MouseListener |
createListMouseListener()
Creates a mouse listener that watches for mouse events in the popup's list. |
protected MouseMotionListener |
createListMouseMotionListener()
Creates a mouse motion listener that watches for mouse motion events in the popup's list. |
protected ListSelectionListener |
createListSelectionListener()
Creates a list selection listener that watches for selection changes in the popup's list. |
protected MouseListener |
createMouseListener()
Creates a listener that will watch for mouse-press and release events on the combo box. |
protected MouseMotionListener |
createMouseMotionListener()
Creates the mouse motion listener which will be added to the combo box. |
protected PropertyChangeListener |
createPropertyChangeListener()
Creates a PropertyChangeListener which will be added to the combo box. |
protected void |
customizeScroller(JScrollPane scroller)
Configures the scrollable portion which holds the list within the combo box popup. |
ObjectConverter |
getConverter()
Gets the converter that will convert the element in the ListModel to String that can be displayed on the JList. |
ConverterContext |
getConverterContext()
Gets the converter context that used to convert the element in the list to/from string. |
int |
getHorizontalAlignment()
Returns the horizontal alignment of the content. |
JList |
getList()
Gets the JList. |
int |
getMaximumRowCount()
Gets the maximum number of rows the JList displays |
int |
getMaximumWidth()
Gets the maximum width of the ListChooserPanel |
MouseListener |
getMouseListener()
|
MouseMotionListener |
getMouseMotionListener()
|
ListCellRenderer |
getRenderer()
Returns the renderer used to display the selected item in the JComboBox field. |
int |
getVerticalAlignment()
Returns the vertical alignment of the content. |
protected void |
initComponents()
|
protected void |
installListListeners()
Adds the listeners to the list control. |
void |
intervalAdded(ListDataEvent e)
|
void |
intervalRemoved(ListDataEvent e)
|
protected boolean |
isAutoScroll()
|
void |
itemStateChanged(ItemEvent e)
|
void |
removeAllListeners()
Removes all listeners it created. |
void |
setConverter(ObjectConverter converter)
Sets a new converter that will convert the element in the ListModel to String that can be displayed on the JList. |
void |
setConverterContext(ConverterContext converterContext)
Sets the converter context that used to convert the element in the list to/from string. |
void |
setHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment of the content. |
void |
setMaximumRowCount(int count)
Sets the maximum number of rows the JList displays. |
void |
setMaximumWidth(int maximumWidth)
Sets the maximum width of the ListChooserPanel |
void |
setRenderer(ListCellRenderer renderer)
Sets the renderer that paints the list items and the item selected from the list in the JComboBox field. |
void |
setSelectedObject(Object selectedObject)
Sets the selected object and fire ItemEvent . |
protected void |
setupList(JList list)
Configures the list. |
void |
setVerticalAlignment(int verticalAlignment)
Sets the vertical alignment of the content. |
protected void |
updateListSelection(Object selectedObject,
boolean shouldScroll)
|
protected void |
updateListSelectionWithoutFiringEvent()
|
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 |
---|
protected JList _list
protected Class<?> _class
protected MouseMotionListener mouseMotionListener
protected MouseListener mouseListener
protected KeyListener keyListener
createKeyListener()
protected ListSelectionListener listSelectionListener
createListSelectionListener()
protected MouseListener listMouseListener
createListMouseListener()
protected MouseMotionListener listMouseMotionListener
createListMouseMotionListener()
Constructor Detail |
---|
public ListChooserPanel()
public ListChooserPanel(Object[] objects, Class<?> clazz)
ListChooserPanel
.
objects
- the objectsclazz
- the class typepublic ListChooserPanel(Vector<?> objects, Class<?> clazz)
ListChooserPanel
.
objects
- the objectsclazz
- the class typepublic ListChooserPanel(ComboBoxModel model, Class<?> clazz)
ListChooserPanel
.
model
- the combo box modelclazz
- the class typepublic ListChooserPanel(ComboBoxModel model, Class<?> clazz, ConverterContext elementConverterContext)
ListChooserPanel
.
model
- the combo box modelclazz
- the class typeelementConverterContext
- the converter contextpublic ListChooserPanel(ComboBoxModel model, Class<?> clazz, ObjectConverter converter, ConverterContext elementConverterContext)
ListChooserPanel
.
model
- the combo box modelclazz
- the class typeconverter
- the convereterelementConverterContext
- the converter contextMethod Detail |
---|
public void removeAllListeners()
PopupPanel
removeAllListeners
in class PopupPanel
protected void initComponents()
protected boolean isAutoScroll()
protected void customizeScroller(JScrollPane scroller)
scroller
- the scroll pane to customizeprotected JList createList(ComboBoxModel comboBoxModel)
comboBoxModel
- the combo box model used to create list
public void intervalAdded(ListDataEvent e)
intervalAdded
in interface ListDataListener
public void intervalRemoved(ListDataEvent e)
intervalRemoved
in interface ListDataListener
public void contentsChanged(ListDataEvent e)
contentsChanged
in interface ListDataListener
protected void updateListSelectionWithoutFiringEvent()
protected void setupList(JList list)
list
- the list to configurepublic void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
protected void updateListSelection(Object selectedObject, boolean shouldScroll)
public int getMaximumRowCount()
JList
displays
JList
displays.public void setMaximumRowCount(int count)
JList
displays. If the number of objects in the model is greater
than count, the list uses a scrollbar.
count
- an integer specifying the maximum number of items to display in the list before using a scrollbarpublic int getMaximumWidth()
public void setMaximumWidth(int maximumWidth)
maximumWidth
- the maximum widthpublic ListCellRenderer getRenderer()
JComboBox
field.
public void setRenderer(ListCellRenderer renderer)
aRenderer.getListCellRendererComponent
is called, passing the list
object and an index of -1.
renderer
- the ListCellRenderer
that displays the selected itempublic ConverterContext getConverterContext()
public void setConverterContext(ConverterContext converterContext)
converterContext
- the converter contextpublic ObjectConverter getConverter()
public void setConverter(ObjectConverter converter)
converter
- the converterpublic JList getList()
public void setSelectedObject(Object selectedObject)
PopupPanel
ItemEvent
. It will still fire event even the new selected object
is the same as old selected object.
setSelectedObject
in class PopupPanel
selectedObject
- new selected objectprotected MouseEvent convertMouseEvent(MouseEvent e)
protected MouseListener createMouseListener()
MouseListener
which will be added to the combo box or nullprotected MouseMotionListener createMouseMotionListener()
MouseMotionListener
which will be added to the combo box or nullprotected KeyListener createKeyListener()
KeyListener
or nullprotected ListSelectionListener createListSelectionListener()
ListSelectionListener
or nullprotected ListDataListener createListDataListener()
ComboBoxModel
. If this method returns null
then it will not be added to the combo box model.
ListDataListener
or nullprotected MouseListener createListMouseListener()
MouseListener
or nullprotected MouseMotionListener createListMouseMotionListener()
MouseMotionListener
or nullprotected PropertyChangeListener createPropertyChangeListener()
PropertyChangeListener
which will be added to the combo box. If this method returns null
then it will not be added to the combo box.
PropertyChangeListener
or nullprotected ItemListener createItemListener()
ItemListener
which will be added to the combo box. If this method returns null then it
will not be added to the combo box.
Subclasses may override this method to return instances of their own ItemEvent handlers.
ItemListener
or nullprotected ListChooserPanel.Handler createHandler()
protected void installListListeners()
public MouseMotionListener getMouseMotionListener()
getMouseMotionListener
in class PopupPanel
public MouseListener getMouseListener()
getMouseListener
in class PopupPanel
public int getHorizontalAlignment()
AlignmentSupport
AbstractButton
's default is SwingConstants.CENTER
,
but subclasses such as JCheckBox
may use a different default.
getHorizontalAlignment
in interface AlignmentSupport
horizontalAlignment
property,
one of the following values:
SwingConstants.RIGHT
SwingConstants.LEFT
SwingConstants.CENTER
SwingConstants.LEADING
SwingConstants.TRAILING
public void setHorizontalAlignment(int horizontalAlignment)
AlignmentSupport
AbstractButton
's default is SwingConstants.CENTER
,
but subclasses such as JCheckBox
may use a different default.
setHorizontalAlignment
in interface AlignmentSupport
horizontalAlignment
- the alignment value, one of the following values:
SwingConstants.RIGHT
SwingConstants.LEFT
SwingConstants.CENTER
SwingConstants.LEADING
SwingConstants.TRAILING
public int getVerticalAlignment()
AlignmentSupport
getVerticalAlignment
in interface AlignmentSupport
verticalAlignment
property, one of the
following values:
SwingConstants.CENTER
(the default)
SwingConstants.TOP
SwingConstants.BOTTOM
public void setVerticalAlignment(int verticalAlignment)
AlignmentSupport
setVerticalAlignment
in interface AlignmentSupport
verticalAlignment
- one of the following values:
SwingConstants.CENTER
(the default)
SwingConstants.TOP
SwingConstants.BOTTOM
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |