jigcell.compare.ui
Class BasicTable.BasicEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by javax.swing.DefaultCellEditor
          extended by jigcell.compare.ui.BasicTable.BasicEditor
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.CellEditor, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
Enclosing class:
BasicTable

public static class BasicTable.BasicEditor
extends javax.swing.DefaultCellEditor
implements java.beans.PropertyChangeListener

Default editor for a BasicTable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.DefaultCellEditor
javax.swing.DefaultCellEditor.EditorDelegate
 
Field Summary
static java.lang.String CONFIG_FOREGROUNDMODIFIED
          Configuration property key for the modified cell foreground color
protected static java.awt.Color DEFAULT_FOREGROUNDMODIFIED
          Default foreground color for modified cells
private  IBasicTableHost host
          Host view of this table
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
BasicTable.BasicEditor()
          Creates a new editor.
BasicTable.BasicEditor(IBasicTableHost host)
          Creates a new editor.
BasicTable.BasicEditor(IBasicTableHost host, javax.swing.JCheckBox checkBox)
          Creates a new editor.
BasicTable.BasicEditor(IBasicTableHost host, javax.swing.JComboBox comboBox)
          Creates a new editor.
BasicTable.BasicEditor(IBasicTableHost host, javax.swing.JTextField textField)
          Creates a new editor.
 
Method Summary
 java.awt.Color getColor(java.lang.String key)
          A color for use with this table.
protected  java.awt.Color getColorFromConfig(java.lang.String key, java.awt.Color defaultColor)
          Color specified by the configuration of the host view.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean selected, int row, int column)
           
private  java.lang.String mungeKey(java.lang.String key)
          Creates the actual key value based on a generic key value.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void putColor(java.lang.String key, java.awt.Color color)
          Sets a color for use with this editor.
 void readConfiguration(java.lang.String state)
           
private  void registerHost(IBasicTableHost host)
          Hooks this editor up to the host so that configuration data can be obtained.
 
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
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, removeCellEditorListener
 

Field Detail

CONFIG_FOREGROUNDMODIFIED

public static final java.lang.String CONFIG_FOREGROUNDMODIFIED
Configuration property key for the modified cell foreground color

See Also:
Constant Field Values

DEFAULT_FOREGROUNDMODIFIED

protected static final java.awt.Color DEFAULT_FOREGROUNDMODIFIED
Default foreground color for modified cells


host

private IBasicTableHost host
Host view of this table

Constructor Detail

BasicTable.BasicEditor

public BasicTable.BasicEditor()
Creates a new editor.


BasicTable.BasicEditor

public BasicTable.BasicEditor(IBasicTableHost host)
Creates a new editor.

Parameters:
host - Host view of this table

BasicTable.BasicEditor

public BasicTable.BasicEditor(IBasicTableHost host,
                              javax.swing.JCheckBox checkBox)
Creates a new editor.

Parameters:
host - Host view of this table
checkBox - Editor control

BasicTable.BasicEditor

public BasicTable.BasicEditor(IBasicTableHost host,
                              javax.swing.JComboBox comboBox)
Creates a new editor.

Parameters:
host - Host view of this table
comboBox - Editor control

BasicTable.BasicEditor

public BasicTable.BasicEditor(IBasicTableHost host,
                              javax.swing.JTextField textField)
Creates a new editor.

Parameters:
host - Host view of this table
textField - Editor control
Method Detail

getColor

public java.awt.Color getColor(java.lang.String key)
A color for use with this table.

Parameters:
key - Color key

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean selected,
                                                      int row,
                                                      int column)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Overrides:
getTableCellEditorComponent in class javax.swing.DefaultCellEditor

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

putColor

public void putColor(java.lang.String key,
                     java.awt.Color color)
Sets a color for use with this editor.

Parameters:
key - Color key
color - Color

readConfiguration

public void readConfiguration(java.lang.String state)
See Also:
ITab.readConfiguration(java.lang.String)

getColorFromConfig

protected java.awt.Color getColorFromConfig(java.lang.String key,
                                            java.awt.Color defaultColor)
Color specified by the configuration of the host view.

Parameters:
key - Configuration key
defaultColor - Color to use if configuration does not specify a value

mungeKey

private java.lang.String mungeKey(java.lang.String key)
Creates the actual key value based on a generic key value.

Parameters:
key - Key

registerHost

private void registerHost(IBasicTableHost host)
Hooks this editor up to the host so that configuration data can be obtained. This method should only be called once and before any configuration data is needed.

Parameters:
host - Host view of this table