|
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.TreeChooserPanel
public class TreeChooserPanel
TreeChooserPanel is a PopupPanel that can choose a value from a tree.
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 TreeModel |
_model
|
protected KeyListener |
keyListener
This protected field is implementation specific. |
protected MouseListener |
mouseListener
This protected field is implementation specific. |
protected MouseMotionListener |
mouseMotionListener
This protected field is implementation specific. |
protected MouseListener |
treeMouseListener
This protected field is implementation specific. |
protected MouseMotionListener |
treeMouseMotionListener
This protected field is implementation specific. |
protected TreeSelectionListener |
treeSelectionListener
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 | |
---|---|
TreeChooserPanel()
Creates a new TreeChooserPanel . |
|
TreeChooserPanel(Hashtable<?,?> objects)
Creates a new JPanel with a double buffer and a flow layout. |
|
TreeChooserPanel(Object object)
Creates a new TreeChooserPanel . |
|
TreeChooserPanel(Object[] objects)
Creates a new TreeChooserPanel . |
|
TreeChooserPanel(TreeModel model)
Creates a new JPanel with a double buffer and a flow layout. |
|
TreeChooserPanel(Vector<?> objects)
Creates a new JPanel with a double buffer and a flow layout. |
Method Summary | |
---|---|
protected MouseEvent |
convertMouseEvent(MouseEvent e)
|
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 ListDataListener |
createListDataListener()
Creates a list data listener which will be added to the ComboBoxModel . |
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 JTree |
createTree(TreeModel model)
Subclass can override this method to create a custom tree. |
static TreeModel |
createTreeModel(Object value)
Returns a TreeModel wrapping the specified object. |
protected MouseListener |
createTreeMouseListener()
Creates a mouse listener that watches for mouse events in the popup's list. |
protected MouseMotionListener |
createTreeMouseMotionListener()
Creates a mouse motion listener that watches for mouse motion events in the popup's list. |
protected TreeSelectionListener |
createTreeSelectionListener()
Creates a list selection listener that watches for selection changes in the popup's list. |
protected void |
customizeScroller(JScrollPane scroller)
Configures the scrollable portion which holds the tree within the combo box popup. |
TreeCellRenderer |
getCellRenderer()
Returns the renderer used to display the selected item in the JComboBox field. |
protected static TreeModel |
getDefaultTreeModel()
Creates and returns a sample TreeModel . |
int |
getMaximumRowCount()
Gets the maximum number of rows the JTree displays |
JTree |
getTree()
Gets the JTree. |
protected void |
initComponents()
|
protected void |
installTreeListeners()
Adds the listeners to the list control. |
boolean |
isDoubleClickExpand()
Get the flag indicating if the mouse double click would expand the tree path instead of just select it. |
boolean |
isSearchUserObjectToSelect()
Gets the flag indicating if TreeChooserPanel will search all its tree path's userObject to make the selection if the selected object is set to a non-TreePath value. |
protected boolean |
isValidSelection(TreePath path)
Checks if a given tree path is a valid selection for combobox. |
void |
itemStateChanged(ItemEvent e)
|
void |
setCellRenderer(TreeCellRenderer cellRenderer)
Sets the renderer that paints the tree items and the item selected from the tree in the JComboBox field. |
void |
setDoubleClickExpand(boolean doubleClickExpand)
Set the flag indicating if the mouse double click would expand the tree path instead of just select it. |
void |
setMaximumRowCount(int count)
Sets the maximum number of rows the JTree displays. |
void |
setSearchUserObjectToSelect(boolean searchUserObjectToSelect)
Sets the flag indicating if TreeChooserPanel will search all its tree path's userObject to make the selection if the selected object is set to a non-TreePath value. |
protected void |
setupTree(JTree tree)
Configures the tree. |
protected void |
updateTreeSelectionForEvent(MouseEvent anEvent,
boolean shouldScroll)
A utility method used by the event listeners. |
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 TreeModel _model
protected MouseMotionListener mouseMotionListener
protected MouseListener mouseListener
protected KeyListener keyListener
createKeyListener()
protected TreeSelectionListener treeSelectionListener
createTreeSelectionListener()
protected MouseListener treeMouseListener
createTreeMouseListener()
protected MouseMotionListener treeMouseMotionListener
createTreeMouseMotionListener()
Constructor Detail |
---|
public TreeChooserPanel()
TreeChooserPanel
.
public TreeChooserPanel(Object object)
TreeChooserPanel
.
object
- the object to create tree modelpublic TreeChooserPanel(Object[] objects)
TreeChooserPanel
.
objects
- the objects to create tree modelpublic TreeChooserPanel(Vector<?> objects)
JPanel
with a double buffer and a flow layout.
objects
- the objects to create tree modelpublic TreeChooserPanel(Hashtable<?,?> objects)
JPanel
with a double buffer and a flow layout.
objects
- the objects to create tree modelpublic TreeChooserPanel(TreeModel model)
JPanel
with a double buffer and a flow layout.
model
- the tree modelMethod Detail |
---|
protected void initComponents()
protected void customizeScroller(JScrollPane scroller)
scroller
- the JScrollPane.protected JTree createTree(TreeModel model)
model
- the tree model.
protected void setupTree(JTree tree)
tree
- the JTreepublic void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
public int getMaximumRowCount()
JTree
displays
JTree
displays.public void setMaximumRowCount(int count)
JTree
displays. If the number of objects in the model is greater
than count, the tree uses a scrollbar.
count
- an integer specifying the maximum number of items to display in the tree before using a scrollbarpublic TreeCellRenderer getCellRenderer()
JComboBox
field.
public void setCellRenderer(TreeCellRenderer cellRenderer)
aRenderer.getTreeCellRendererComponent
is called, passing the tree
object and an index of -1.
cellRenderer
- the TreeCellRenderer
that displays the selected itempublic JTree getTree()
protected static TreeModel getDefaultTreeModel()
TreeModel
. Used primarily for beanbuilders to show something
interesting.
TreeModel
public static TreeModel createTreeModel(Object value)
TreeModel
wrapping the specified object. If the object is:Object
s, Hashtable
, or Vector
value
- the Object
used as the foundation for the TreeModel
TreeModel
wrapping the specified objectprotected boolean isValidSelection(TreePath path)
path
- the tree path
public boolean isDoubleClickExpand()
public void setDoubleClickExpand(boolean doubleClickExpand)
doubleClickExpand
- the flagisDoubleClickExpand()
public boolean isSearchUserObjectToSelect()
setSearchUserObjectToSelect(boolean)
public void setSearchUserObjectToSelect(boolean searchUserObjectToSelect)
searchUserObjectToSelect
- the flagprotected MouseEvent convertMouseEvent(MouseEvent e)
protected void updateTreeSelectionForEvent(MouseEvent anEvent, boolean shouldScroll)
anEvent
- the mouse eventshouldScroll
- the flag indicating if the tree should be scrolled to visible rectangleprotected 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 TreeSelectionListener createTreeSelectionListener()
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 createTreeMouseListener()
MouseListener
or nullprotected MouseMotionListener createTreeMouseMotionListener()
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 void installTreeListeners()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |