JComponentPack 1.5.0

com.zfqjava.swing.cell
Class DefaultCellEditor

java.lang.Object
  extended by com.zfqjava.swing.cell.AbstractCellEditor
      extended by com.zfqjava.swing.cell.DefaultCellEditor
All Implemented Interfaces:
ActionListener, FocusListener, EventListener, CellEditor, ComboBoxEditor, TableCellEditor, TreeCellEditor
Direct Known Subclasses:
FileCellEditor, ZipEntryCellEditor

public class DefaultCellEditor
extends AbstractCellEditor

DefaultCellEditor provides a Default editor, can be used as JTable, JTree cell editor.


Field Summary
protected  JLabel iconLabel
          The label to set icon.
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
DefaultCellEditor()
          Constructs a DefaultCellEditor
 
Method Summary
protected  void commitEdit()
          Commits the editing.
 Component getComponent()
          Returns the component for this editor.
protected  Object getValue()
          Returns the value for current editor
 boolean isCellEditable(EventObject e)
          Returns true.
protected  void setValue(Object value)
          Sets the value for current editor.
protected  void setValue(Object value, boolean isSelected)
          Sets the value.
 
Methods inherited from class com.zfqjava.swing.cell.AbstractCellEditor
actionPerformed, addActionListener, addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, focusGained, focusLost, getCellEditorComponent, getCellEditorComponentType, getCellEditorListeners, getCellEditorValue, getCellProvider, getClickCountToStart, getEditingStopBehavior, getEditingValue, getEditorComponent, getFocusLostBehavior, getItem, getListCellEditorComponent, getTableCellEditorComponent, getTreeCellEditorComponent, isOpaque, removeActionListener, removeCellEditorListener, selectAll, setCellEditorComponentType, setCellProvider, setClickCountToStart, setEditingStopBehavior, setFocusLostBehavior, setItem, setOpaque, shouldSelectCell, stopCellEditing, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iconLabel

protected JLabel iconLabel
The label to set icon.


textField

protected JTextField textField
The text field to set text.

Constructor Detail

DefaultCellEditor

public DefaultCellEditor()
Constructs a DefaultCellEditor

Method Detail

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,
                        boolean isSelected)
Description copied from class: AbstractCellEditor
Sets the value.

Overrides:
setValue in class AbstractCellEditor
Parameters:
value - the value
isSelected - the select state

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

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

isCellEditable

public boolean isCellEditable(EventObject e)
Description copied from class: AbstractCellEditor
Returns true.

Specified by:
isCellEditable in interface CellEditor
Overrides:
isCellEditable in class AbstractCellEditor
Parameters:
e - an event object
Returns:
true

JComponentPack 1.5.0

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