JIDE 3.5.15

com.jidesoft.grid
Class CheckBoxTreeComboBoxCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by com.jidesoft.grid.AbstractJideCellEditor
          extended by com.jidesoft.grid.ContextSensitiveCellEditor
              extended by com.jidesoft.grid.ExComboBoxCellEditor
                  extended by 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

Field Summary
static EditorContext CONTEXT
           
 
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
CheckBoxTreeComboBoxCellEditor()
           
CheckBoxTreeComboBoxCellEditor(Hashtable<?,?> objects)
          Creates a new CheckBoxTreeComboBoxCellEditor.
CheckBoxTreeComboBoxCellEditor(Object[] objects)
          Creates a new CheckBoxTreeComboBoxCellEditor.
CheckBoxTreeComboBoxCellEditor(TreeModel model)
          Creates a new CheckBoxTreeComboBoxCellEditor.
CheckBoxTreeComboBoxCellEditor(TreeNode root)
          Creates a new CheckBoxTreeComboBoxCellEditor.
CheckBoxTreeComboBoxCellEditor(TreeNode root, boolean asksAllowsChildren)
          Creates a new CheckBoxTreeComboBoxCellEditor.
CheckBoxTreeComboBoxCellEditor(Vector<?> objects)
          Creates a new CheckBoxTreeComboBoxCellEditor.
 
Method Summary
 ExComboBox createExComboBox()
          Creates an ExComboBox or its subclass used by this cell editor.
 
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.ContextSensitiveCellEditor
getConverter, getConverterContext, getEditorContext, getEditorStyle, getType, isUseConverterContext, setConverterContext, setEditorContext, setEditorStyle, 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
 

Field Detail

CONTEXT

public static final EditorContext CONTEXT
Constructor Detail

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 node
asksAllowsChildren - the flag indicating if allows children

CheckBoxTreeComboBoxCellEditor

public CheckBoxTreeComboBoxCellEditor(TreeModel model)
Creates a new CheckBoxTreeComboBoxCellEditor.

Parameters:
model - the tree model
Method Detail

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.

JIDE 3.5.15