|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.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. |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
|
boolean |
isCellEditable(EventObject anEvent)
|
boolean |
stopCellEditing()
|
Methods inherited from class com.jidesoft.grid.ExComboBoxCellEditor |
---|
actionPerformed, createExComboBox, customizeExComboBox, getCellEditorValue, getComboBox, isEditorStyleSupported, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, setCellEditorValue, setConverter, setType |
Methods inherited from class com.jidesoft.grid.ContextSensitiveCellEditor |
---|
getConverter, getConverterContext, getEditorContext, getEditorStyle, getType, isUseConverterContext, setConverterContext, setEditorContext, setEditorStyle, setUseConverterContext |
Methods inherited from class com.jidesoft.grid.AbstractJideCellEditor |
---|
addValidationListener, getClickCountToStart, getDefaultErrorBehavior, getValidationListeners, isAutoStopCellEditing, 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, 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 nodepublic TreeComboBoxCellEditor(TreeNode root, boolean asksAllowsChildren)
TreeComboBoxCellEditor
.
root
- the tree root nodeasksAllowsChildren
- the flag indicating if allows childrenpublic TreeComboBoxCellEditor(TreeModel model)
TreeComboBoxCellEditor
.
model
- the tree modelMethod Detail |
---|
public boolean isCellEditable(EventObject anEvent)
isCellEditable
in interface CellEditor
isCellEditable
in class AbstractJideCellEditor
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
getTableCellEditorComponent
in class ExComboBoxCellEditor
public boolean stopCellEditing()
stopCellEditing
in interface CellEditor
stopCellEditing
in class ExComboBoxCellEditor
public ExComboBox createExComboBox()
ExComboBoxCellEditor
createExComboBox
in class ExComboBoxCellEditor
protected TreeExComboBox createTreeComboBox()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |