|
JIDE 3.4.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractCellEditor
com.jidesoft.grid.AbstractJideCellEditor
com.jidesoft.grid.ContextSensitiveCellEditor
com.jidesoft.grid.ExComboBoxCellEditor
com.jidesoft.grid.TreeComboBoxCellEditor
public class TreeComboBoxCellEditor
This class is for any cell editor where one needs to choose value from a tree. It used TreeExComboBox as the editor.
To let the TreeComboBoxCellEditor work well with a custom class other than String.class, please first register an ObjectConverter for that class and register a TreeComboBoxCellEditor for the class with the following code. While constructing the tree nodes, please make sure ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject() is an instance of the custom class.
CellEditorManager.registerEditor(ConnectItem.class, new CellEditorFactory() {
public CellEditor create() {
return new TreeComboBoxCellEditor(getDefaultTreeModel()) {
protected TreeExComboBox createTreeComboBox() {
TreeExComboBox treeComboBox = new TreeExComboBox() {
protected TreeChooserPanel createTreeChooserPanel(TreeModel model) {
TreeChooserPanel panel = super.createTreeChooserPanel(model);
panel.setSearchUserObjectToSelect(true);
return panel;
}
};
treeComboBox.setEditable(false);
treeComboBox.setType(YourCustomClass.class);
return treeComboBox;
}
};
}
}, new EditorContext("Tree"));
| Field Summary |
|---|
| Fields inherited from class com.jidesoft.grid.ExComboBoxCellEditor |
|---|
_comboBox |
| Fields inherited from class com.jidesoft.grid.ContextSensitiveCellEditor |
|---|
DEFAULT_CELL_EDITOR_BORDER |
| Fields inherited from class com.jidesoft.grid.AbstractJideCellEditor |
|---|
_clickCountToStart |
| Fields inherited from class javax.swing.AbstractCellEditor |
|---|
changeEvent, listenerList |
| Constructor Summary | |
|---|---|
TreeComboBoxCellEditor(Hashtable<?,?> objects)
Creates a new TreeComboBoxCellEditor. |
|
TreeComboBoxCellEditor(Object[] objects)
Creates a new TreeComboBoxCellEditor. |
|
TreeComboBoxCellEditor(TreeModel model)
Creates a new TreeComboBoxCellEditor. |
|
TreeComboBoxCellEditor(TreeNode root)
Creates a new TreeComboBoxCellEditor. |
|
TreeComboBoxCellEditor(TreeNode root,
boolean asksAllowsChildren)
Creates a new TreeComboBoxCellEditor. |
|
TreeComboBoxCellEditor(Vector<?> objects)
Creates a new TreeComboBoxCellEditor. |
|
| Method Summary | |
|---|---|
ExComboBox |
createExComboBox()
Creates an ExComboBox or its subclass used by this cell editor. |
protected TreeExComboBox |
createTreeComboBox()
Creates the tree combobox. |
| Methods inherited from class com.jidesoft.grid.ExComboBoxCellEditor |
|---|
actionPerformed, createExComboBox, customizeExComboBox, getCellEditorValue, getComboBox, getTableCellEditorComponent, isEditorStyleSupported, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, setCellEditorValue, setConverter, stopCellEditing |
| Methods inherited from class com.jidesoft.grid.ContextSensitiveCellEditor |
|---|
getConverter, getConverterContext, getEditorContext, getEditorStyle, getType, isUseConverterContext, setConverterContext, setEditorContext, setEditorStyle, setType, setUseConverterContext |
| Methods inherited from class com.jidesoft.grid.AbstractJideCellEditor |
|---|
addValidationListener, getClickCountToStart, getDefaultErrorBehavior, getValidationListeners, isAutoStopCellEditing, isCellEditable, isPassEnterKeyToTable, removeValidationListener, setAutoStopCellEditing, setClickCountToStart, setDefaultErrorBehavior, setPassEnterKeyToTable, validate |
| Methods inherited from class javax.swing.AbstractCellEditor |
|---|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.CellEditor |
|---|
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell |
| Constructor Detail |
|---|
public TreeComboBoxCellEditor(Object[] objects)
TreeComboBoxCellEditor.
objects - the objects in the tree modelpublic TreeComboBoxCellEditor(Vector<?> objects)
TreeComboBoxCellEditor.
objects - the objects in the tree modelpublic TreeComboBoxCellEditor(Hashtable<?,?> objects)
TreeComboBoxCellEditor.
objects - the objects in the tree modelpublic TreeComboBoxCellEditor(TreeNode root)
TreeComboBoxCellEditor.
root - the tree root node
public TreeComboBoxCellEditor(TreeNode root,
boolean asksAllowsChildren)
TreeComboBoxCellEditor.
root - the tree root nodeasksAllowsChildren - the flag indicating if allows childrenpublic TreeComboBoxCellEditor(TreeModel model)
TreeComboBoxCellEditor.
model - the tree model| Method Detail |
|---|
public ExComboBox createExComboBox()
ExComboBoxCellEditor
createExComboBox in class ExComboBoxCellEditorprotected TreeExComboBox createTreeComboBox()
|
JIDE 3.4.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||