IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.gui
Class SpTableCellEditor

java.lang.Object
  extended byjavax.swing.AbstractCellEditor
      extended byjavax.swing.DefaultCellEditor
          extended bycom.ibm.dse.gui.SpTableCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, java.util.EventListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.io.Serializable, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor

public class SpTableCellEditor
extends javax.swing.DefaultCellEditor
implements java.awt.event.FocusListener, java.awt.event.KeyListener

The SpTableCellEditor class is a Bean that provides a editor for SpTable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.DefaultCellEditor
javax.swing.DefaultCellEditor.EditorDelegate
 
Field Summary
(package private)  ColumnFormatter myConverter
           
(package private)  java.lang.String strValue
           
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
SpTableCellEditor(javax.swing.JTextField x, ColumnFormatter aConverter)
          This constructor creates a SpTableCellEditor object.
 
Method Summary
protected  void evaluateValue(SpTable table)
          Gets selected value in SpTable and evaluates its color and format.
 void focusGained(java.awt.event.FocusEvent e)
          Handles events for the FocusListener interface.
 void focusLost(java.awt.event.FocusEvent e)
          Handles events for the FocusListener interface.
 Converter getConverter()
          Gets the converter associated to the SpTableCellEditor.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Sets an initial value for the editor.
 void keyPressed(java.awt.event.KeyEvent e)
          Invoked when a key has been pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          Invoked when a key has been released.
 void keyTyped(java.awt.event.KeyEvent e)
          Invoked when a key has been typed.
 void setRequired(boolean required)
          Sets the required property (boolean) value.
 
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getCellEditorValue, 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

myConverter

ColumnFormatter myConverter

strValue

java.lang.String strValue
Constructor Detail

SpTableCellEditor

public SpTableCellEditor(javax.swing.JTextField x,
                         ColumnFormatter aConverter)
This constructor creates a SpTableCellEditor object.

Parameters:
x - JTextField, the text field associated to the table cells
aConverter - com.ibm.dse.gui.ColumnFormatter, the converter associated to the cell
Method Detail

evaluateValue

protected void evaluateValue(SpTable table)
Gets selected value in SpTable and evaluates its color and format.


focusGained

public void focusGained(java.awt.event.FocusEvent e)
Handles events for the FocusListener interface.

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - java.awt.event.FocusEvent

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Handles events for the FocusListener interface.

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - java.awt.event.FocusEvent

getConverter

public Converter getConverter()
Gets the converter associated to the SpTableCellEditor.

Returns:
com.ibm.dse.gui.Converter - the converter associated to the SpTableCellEditor

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Sets an initial value for the editor. This will cause the editor to stopEditing and lose any partially edited value if the editor is editing when this method is called.

Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Parameters:
table - JTable, the JTable that is asking the editor to edit This parameter can be null.
value - Object, the value of the cell to be edited. It is up to the specific editor to interpret and draw the value. eg. if value is the String "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid value.
isSelected - boolean, true is the cell is to be renderer with selection highlighting
row - int, the row of the cell being edited
column - int, the column of the cell being edited
Returns:
java.awt.Component - the component for editing

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - java.awt.event.KeyEvent

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - java.awt.event.KeyEvent

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. This event occurs when a key press is followed by a key release.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - java.awt.event.KeyEvent

setRequired

public void setRequired(boolean required)
Sets the required property (boolean) value.

Parameters:
required - boolean, the new value for the property

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005