JIDE 3.5.15

com.jidesoft.grid
Class AbstractComboBoxCellEditor

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.AbstractComboBoxCellEditor
All Implemented Interfaces:
ConverterContextSupport, EditorContextSupport, EditorStyleSupport, JideCellEditor, ActionListener, ItemListener, Serializable, EventListener, CellEditor, PopupMenuListener, TableCellEditor
Direct Known Subclasses:
CalculatorCellEditor, LegacyCheckBoxListComboBoxCellEditor, LegacyColorCellEditor, LegacyDateCellEditor, LegacyFileCellEditor, LegacyFileNameCellEditor, LegacyFolderCellEditor, LegacyFolderNameCellEditor, LegacyInsetsCellEditor, LegacyListComboBoxCellEditor, LegacyMonthCellEditor, LegacyMultilineStringCellEditor, LegacyStringArrayCellEditor, LegacyTableComboBoxCellEditor, LegacyTreeComboBoxCellEditor

public abstract class AbstractComboBoxCellEditor
extends ContextSensitiveCellEditor
implements TableCellEditor, ActionListener, PopupMenuListener, ItemListener

A cell editor based on AbstractComboBox. This is an abstract class. You need to implement createAbstractComboBox to create a subclass of AbstractComboBox.

See Also:
Serialized Form

Field Summary
protected  AbstractComboBox _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
AbstractComboBoxCellEditor()
          Creates an AbstractComboBoxCellEditor.
AbstractComboBoxCellEditor(ComboBoxModel model, Class<?> type)
          Creates an AbstractComboBoxCellEditor.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
abstract  AbstractComboBox createAbstractComboBox()
          Creates an AbstractComboBox or its subclass used by this cell editor.
 AbstractComboBox createAbstractComboBox(ComboBoxModel model, Class<?> type)
          Creates an AbstractComboBox or its subclass used by this cell editor.
protected  void customizeAbstractComboBox()
           
 Object getCellEditorValue()
          Gets the value of the cell editor.
 AbstractComboBox getComboBox()
          Gets the combobox used by this cell editor.
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
           
 boolean isEditorStyleSupported(int editorStyle)
          Checks if the editor style is supported by the cell editor.
 void itemStateChanged(ItemEvent e)
           
 void popupMenuCanceled(PopupMenuEvent e)
           
 void popupMenuWillBecomeInvisible(PopupMenuEvent e)
           
 void popupMenuWillBecomeVisible(PopupMenuEvent e)
           
 void setCellEditorValue(Object value)
          Sets the value to the combobox.
 void setConverter(ObjectConverter converter)
          Sets a new converter for the cell editor.
 boolean 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
 

Field Detail

_comboBox

protected AbstractComboBox _comboBox
Constructor Detail

AbstractComboBoxCellEditor

public AbstractComboBoxCellEditor()
Creates an AbstractComboBoxCellEditor.


AbstractComboBoxCellEditor

public AbstractComboBoxCellEditor(ComboBoxModel model,
                                  Class<?> type)
Creates an AbstractComboBoxCellEditor.

Parameters:
model - the combobox model.
type - the type of the element in the model.
Method Detail

customizeAbstractComboBox

protected void customizeAbstractComboBox()

createAbstractComboBox

public abstract AbstractComboBox createAbstractComboBox()
Creates an AbstractComboBox or its subclass used by this cell editor.

Returns:
an AbstractComboBox.

createAbstractComboBox

public AbstractComboBox createAbstractComboBox(ComboBoxModel model,
                                               Class<?> type)
Creates an AbstractComboBox or its subclass used by this cell editor. Different from createAbstractComboBox(), this method takes a ComboBoxModel and type. By default, this method will call createAbstractComboBox() but subclass can override it to create an AbstractComboBox.

Parameters:
model - the combobox model.
type - the type of the element in the model.
Returns:
an AbstractComboBox.

getTableCellEditorComponent

public Component getTableCellEditorComponent(JTable table,
                                             Object value,
                                             boolean isSelected,
                                             int row,
                                             int column)
Specified by:
getTableCellEditorComponent in interface TableCellEditor

setCellEditorValue

public void setCellEditorValue(Object value)
Sets the value to the combobox. By default, it will use setSelectedItem(value, false) to set the value.

Parameters:
value - the new value.

getCellEditorValue

public Object getCellEditorValue()
Gets the value of the cell editor.

Specified by:
getCellEditorValue in interface CellEditor
Returns:
the value of the cell editor

stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface CellEditor
Overrides:
stopCellEditing in class AbstractCellEditor

itemStateChanged

public void itemStateChanged(ItemEvent e)
Specified by:
itemStateChanged in interface ItemListener

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeVisible in interface PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeInvisible in interface PopupMenuListener

popupMenuCanceled

public void popupMenuCanceled(PopupMenuEvent e)
Specified by:
popupMenuCanceled in interface PopupMenuListener

getComboBox

public AbstractComboBox getComboBox()
Gets the combobox used by this cell editor.

Returns:
the abstract combobox.

setConverter

public void setConverter(ObjectConverter converter)
Description copied from class: ContextSensitiveCellEditor
Sets a new converter for the cell editor. Not all cell editor will consider this converter. Right now only ListCellEditor will consider this and use it to convert element to string in the JList when converter is not null. Otherwise, it will use whatever converter registered in ObjectConverterManager to do the conversion.

Overrides:
setConverter in class ContextSensitiveCellEditor
Parameters:
converter - the new converter

isEditorStyleSupported

public boolean isEditorStyleSupported(int editorStyle)
Description copied from interface: EditorStyleSupport
Checks if the editor style is supported by the cell editor.

Specified by:
isEditorStyleSupported in interface EditorStyleSupport
Overrides:
isEditorStyleSupported in class ContextSensitiveCellEditor
Parameters:
editorStyle - the editor style
Returns:
true if it is supported. Otherwise false.

JIDE 3.5.15