JComponentPack 1.5.0

com.zfqjava.swing.cell
Class ObjectCellEditor

java.lang.Object
  extended by com.zfqjava.swing.cell.AbstractCellEditor
      extended by com.zfqjava.swing.cell.ObjectCellEditor
All Implemented Interfaces:
ActionListener, FocusListener, EventListener, CellEditor, ComboBoxEditor, TableCellEditor, TreeCellEditor
Direct Known Subclasses:
BigDecimalCellEditor, BigIntegerCellEditor, BooleanCellEditor, CellCellEditor, DateCellEditor, FormulaCellEditor, NumberCellEditor, StringCellEditor, URLCellEditor

public class ObjectCellEditor
extends AbstractCellEditor

ObjectCellEditor provides a object editor, can be used as JTable, JTree cell editor.


Field Summary
static int A_COMBO_BOX
          Identifies the com.zfqjava.swing.AComboBox component type.
static int COMBO_BOX
          Identifies the combobox component type.
protected  int defaultHorizontalAlignment
          The default horizontal alignment.
static int TEXT_FIELD
          Identifies the textfield component type.
protected  JTextField textField
          The text field to set text.
 
Fields inherited from class com.zfqjava.swing.cell.AbstractCellEditor
CANCEL_EDITING_ON_FOCUS_LOST, changeEvent, COMMIT, COMMIT_OR_EDITING, COMMIT_OR_REVERT, DO_NOTHING_ON_FOCUS_LOST, listenerList, STOP_EDITING_ON_FOCUS_LOST, useSelectionColor
 
Constructor Summary
ObjectCellEditor()
          Constructs a DateCellEditor
 
Method Summary
protected  void commitEdit()
          Commits the editing.
protected  AComboBox createAComboBox()
          Factory methods to create AComboBox.
protected  JComboBox createComboBox()
          Factory methods to create JComboBox.
protected  ComboBoxModel createComboBoxModel()
          Creates a default ComboBoxModel for JComboBox.
protected  JTextField createTextField()
          Creates the text field.
 Component getComponent()
          Returns the component for this editor.
 int getComponentType()
          Returns the component type for this renderer.
 int getDefaultHorizontalAlignment()
          Returns the default horizontal alignment.
protected  Object getEditingValue()
          Returns the current editing value for this editor
protected  Object getValue()
          Returns the value for current editor
 void setComponentType(int componentType)
          Sets the component type for this renderer.
 void setDefaultHorizontalAlignment(int alignment)
          Sets the default horizontal alignment.
 void setOpaque(boolean opaque)
          Sets the opaque property.
protected  void setValue(Object value)
          Sets the value for current editor.
 void updateUI()
          Updates UI.
 
Methods inherited from class com.zfqjava.swing.cell.AbstractCellEditor
actionPerformed, addActionListener, addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, focusGained, focusLost, getCellEditorComponent, getCellEditorComponentType, getCellEditorListeners, getCellEditorValue, getCellProvider, getClickCountToStart, getEditingStopBehavior, getEditorComponent, getFocusLostBehavior, getItem, getListCellEditorComponent, getTableCellEditorComponent, getTreeCellEditorComponent, isCellEditable, isOpaque, removeActionListener, removeCellEditorListener, selectAll, setCellEditorComponentType, setCellProvider, setClickCountToStart, setEditingStopBehavior, setFocusLostBehavior, setItem, setValue, shouldSelectCell, stopCellEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textField

protected JTextField textField
The text field to set text.

Since:
JDataGrid 1.6.1

defaultHorizontalAlignment

protected int defaultHorizontalAlignment
The default horizontal alignment.

The default value is SwingConstants.LEADING.

Since:
JDataGrid 1.6.1

TEXT_FIELD

public static final int TEXT_FIELD
Identifies the textfield component type.

Since:
JDataGrid 2.1.6
See Also:
Constant Field Values

COMBO_BOX

public static final int COMBO_BOX
Identifies the combobox component type.

Since:
JDataGrid 2.1.6
See Also:
Constant Field Values

A_COMBO_BOX

public static final int A_COMBO_BOX
Identifies the com.zfqjava.swing.AComboBox component type.

Since:
JComponentPack 1.3 JDataGrid 2.7
See Also:
Constant Field Values
Constructor Detail

ObjectCellEditor

public ObjectCellEditor()
Constructs a DateCellEditor

Method Detail

createTextField

protected JTextField createTextField()
Creates the text field.

Returns:
the text field
Since:
JDataGrid 1.6.1

createComboBox

protected JComboBox createComboBox()
Factory methods to create JComboBox.

Returns:
a JComboBox
Since:
JComponentPack 1.3

createComboBoxModel

protected ComboBoxModel createComboBoxModel()
Creates a default ComboBoxModel for JComboBox.

Returns:
a default ComboBoxModel for JComboBox

createAComboBox

protected AComboBox createAComboBox()
Factory methods to create AComboBox.

Returns:
a AComboBox
Since:
JComponentPack 1.3

setDefaultHorizontalAlignment

public void setDefaultHorizontalAlignment(int alignment)
Sets the default horizontal alignment.

Parameters:
alignment - the default horizontal alignment
Since:
JDataGrid 1.6.1
See Also:
getDefaultHorizontalAlignment()

getDefaultHorizontalAlignment

public int getDefaultHorizontalAlignment()
Returns the default horizontal alignment.

Returns:
the default horizontal alignment
Since:
JDataGrid 1.6.1
See Also:
setDefaultHorizontalAlignment(int)

setComponentType

public void setComponentType(int componentType)
Sets the component type for this renderer.

Parameters:
componentType - the component type
Since:
JDataGrid 2.1.6

getComponentType

public int getComponentType()
Returns the component type for this renderer.

Returns:
the component type
Since:
JDataGrid 2.1.6

getComponent

public Component getComponent()
Description copied from class: AbstractCellEditor
Returns the component for this editor.

Specified by:
getComponent in class AbstractCellEditor
Returns:
the component for this editor

setValue

protected void setValue(Object value)
Description copied from class: AbstractCellEditor
Sets the value for current editor.

Specified by:
setValue in class AbstractCellEditor
Parameters:
value - the value to editor

getValue

protected Object getValue()
Description copied from class: AbstractCellEditor
Returns the value for current editor

Specified by:
getValue in class AbstractCellEditor
Returns:
the value for current editor

getEditingValue

protected Object getEditingValue()
Description copied from class: AbstractCellEditor
Returns the current editing value for this editor

Overrides:
getEditingValue in class AbstractCellEditor
Returns:
the current editing value for this editor

commitEdit

protected void commitEdit()
                   throws ParseException
Description copied from class: AbstractCellEditor
Commits the editing. This invoke by AbstractCellEditor.stopCellEditing(), if cannot commit current editing, should throws exception.

Specified by:
commitEdit in class AbstractCellEditor
Throws:
ParseException - if cannot commit the editing

updateUI

public void updateUI()
Description copied from class: AbstractCellEditor
Updates UI.

Overrides:
updateUI in class AbstractCellEditor

setOpaque

public void setOpaque(boolean opaque)
Description copied from class: AbstractCellEditor
Sets the opaque property.

Overrides:
setOpaque in class AbstractCellEditor
Parameters:
opaque - the opaque property

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.