unbbayes.gui.table
Class ReplaceTextCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by javax.swing.DefaultCellEditor
          extended by unbbayes.gui.table.ReplaceTextCellEditor
All Implemented Interfaces:
Serializable, CellEditor, TableCellEditor, TreeCellEditor

public class ReplaceTextCellEditor
extends DefaultCellEditor

Class responsible for replacing the old value by the new value typed instead of appending it. However, if the focus is gained by something different than by typing a new value, then it just selects all the text inside the text field component.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.DefaultCellEditor
DefaultCellEditor.EditorDelegate
 
Field Summary
protected  String previousValue
           
protected  JTextField textField
           
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
ReplaceTextCellEditor()
           
 
Method Summary
 Object getCellEditorValue()
           
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
           
 void setValue(Object value)
           
 
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getClickCountToStart, getComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell, stopCellEditing
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
 
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, removeCellEditorListener
 

Field Detail

textField

protected JTextField textField

previousValue

protected String previousValue
Constructor Detail

ReplaceTextCellEditor

public ReplaceTextCellEditor()
Method Detail

setValue

public void setValue(Object value)

getCellEditorValue

public Object getCellEditorValue()
Specified by:
getCellEditorValue in interface CellEditor
Overrides:
getCellEditorValue in class DefaultCellEditor

getTableCellEditorComponent

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


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.