com.jidesoft.grid
Class CheckBoxTreeComboBoxCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
com.jidesoft.grid.AbstractJideCellEditor
com.jidesoft.grid.ContextSensitiveCellEditor
com.jidesoft.grid.ExComboBoxCellEditor
com.jidesoft.grid.CheckBoxTreeComboBoxCellEditor
- All Implemented Interfaces:
- ConverterContextSupport, EditorContextSupport, EditorStyleSupport, JideCellEditor, ActionListener, Serializable, EventListener, CellEditor, PopupMenuListener, TableCellEditor
public class CheckBoxTreeComboBoxCellEditor
- extends ExComboBoxCellEditor
This class is for any cell editor where one needs to choose values from a tree. It used CheckBoxTreeExComboBox as the editor.
To let the CheckBoxTreeComboBoxCellEditor work well with a custom class other than String.class, please first register an
ObjectConverter for that class and register a CheckBoxTreeComboBoxCellEditor 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 CheckBoxTreeComboBoxCellEditor(getDefaultTreeModel()) {
protected TreeExComboBox createTreeComboBox() {
CheckBoxTreeComboBoxCellEditor treeComboBox = new CheckBoxTreeComboBoxCellEditor() {
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"));
- See Also:
- Serialized Form
Methods inherited from class com.jidesoft.grid.ExComboBoxCellEditor |
actionPerformed, createExComboBox, customizeExComboBox, getCellEditorValue, getComboBox, getTableCellEditorComponent, isEditorStyleSupported, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, setCellEditorValue, setConverter, setType, stopCellEditing |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTEXT
public static final EditorContext CONTEXT
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor()
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(Object[] objects)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
objects
- the objects in the tree model
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(Vector<?> objects)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
objects
- the objects in the tree model
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(Hashtable<?,?> objects)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
objects
- the objects in the tree model
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(TreeNode root)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
root
- the tree root node
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(TreeNode root,
boolean asksAllowsChildren)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
root
- the tree root nodeasksAllowsChildren
- the flag indicating if allows children
CheckBoxTreeComboBoxCellEditor
public CheckBoxTreeComboBoxCellEditor(TreeModel model)
- Creates a new
CheckBoxTreeComboBoxCellEditor
.
- Parameters:
model
- the tree model
createExComboBox
public ExComboBox createExComboBox()
- Description copied from class:
ExComboBoxCellEditor
- Creates an ExComboBox or its subclass used by this cell editor.
- Specified by:
createExComboBox
in class ExComboBoxCellEditor
- Returns:
- an ExComboBox.