JIDE 3.5.15

com.jidesoft.grid
Class ExComboBoxCellEditor

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
All Implemented Interfaces:
ConverterContextSupport, EditorContextSupport, EditorStyleSupport, JideCellEditor, ActionListener, Serializable, EventListener, CellEditor, PopupMenuListener, TableCellEditor
Direct Known Subclasses:
CheckBoxListComboBoxCellEditor, CheckBoxTreeComboBoxCellEditor, ColorCellEditor, DateCellEditor, FileCellEditor, FileNameCellEditor, FolderCellEditor, FolderNameCellEditor, FontCellEditor, InsetsCellEditor, ListComboBoxCellEditor, MonthCellEditor, MultilineStringCellEditor, StringArrayCellEditor, TableComboBoxCellEditor, TreeComboBoxCellEditor

public abstract class ExComboBoxCellEditor
extends ContextSensitiveCellEditor
implements TableCellEditor, ActionListener, PopupMenuListener

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

See Also:
Serialized Form

Field Summary
protected  ExComboBox _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
ExComboBoxCellEditor()
          Creates an ExComboBoxCellEditor.
ExComboBoxCellEditor(ComboBoxModel model, Class<?> type)
          Creates an ExComboBoxCellEditor.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
abstract  ExComboBox createExComboBox()
          Creates an ExComboBox or its subclass used by this cell editor.
 ExComboBox createExComboBox(ComboBoxModel model, Class<?> type)
          Creates an ExComboBox or its subclass used by this cell editor.
protected  void customizeExComboBox()
           
 Object getCellEditorValue()
          Gets the value of the cell editor.
 ExComboBox 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 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.
 void setType(Class<?> valueClass)
          Sets the class of the value.
 boolean 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

_comboBox

protected ExComboBox _comboBox
Constructor Detail

ExComboBoxCellEditor

public ExComboBoxCellEditor()
Creates an ExComboBoxCellEditor.


ExComboBoxCellEditor

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

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

customizeExComboBox

protected void customizeExComboBox()

createExComboBox

public abstract ExComboBox createExComboBox()
Creates an ExComboBox or its subclass used by this cell editor.

Returns:
an ExComboBox.

createExComboBox

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

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

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

setType

public void setType(Class<?> valueClass)
Description copied from interface: ConverterContextSupport
Sets the class of the value.

Specified by:
setType in interface ConverterContextSupport
Overrides:
setType in class ContextSensitiveCellEditor

stopCellEditing

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

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 ExComboBox 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