quick.dbtable
Class DBTableCellEditor

java.lang.Object
  extended byquick.dbtable.DBTableCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, java.io.Serializable, javax.swing.table.TableCellEditor

Deprecated. This class should not be directly used, instead use the setCellComponent method in DBTable.

public class DBTableCellEditor
extends java.lang.Object
implements javax.swing.table.TableCellEditor, java.io.Serializable

Cell editor for image, checkbox, radiobutton, combo box, text field

See Also:
DBTable.setCellComponent(Column, int, Hashtable), Serialized Form

Constructor Summary
DBTableCellEditor(CellComponent cc, DBTable dBTable)
          Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.
DBTableCellEditor(int cellType, java.util.Hashtable cellValueToDisplayHashtable, DBTable dBTable)
          Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.
DBTableCellEditor(int cellType, java.util.Hashtable cellValueToDisplayHashtable, DBTable dBTable, boolean addClearOption)
          Deprecated.  
DBTableCellEditor(int cellType, java.util.Hashtable cellValueToDisplayHashtable, java.lang.Object[] keysSortOrder, DBTable dBTable, boolean addClearOption)
          Deprecated.  
DBTableCellEditor(javax.swing.JComboBox jc, DBTable dBTable)
          Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.
DBTableCellEditor(javax.swing.JTextArea jt, DBTable dBTable)
          Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.
DBTableCellEditor(javax.swing.JTextField jt, DBTable dBTable)
          Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.
 
Method Summary
 void addCellEditorListener(javax.swing.event.CellEditorListener l)
          Deprecated.  
 void cancelCellEditing()
          Deprecated.  
 java.lang.Object convertDisplayToActual(java.lang.Object input)
          Deprecated.  
 java.lang.Object getCellEditorValue()
          Deprecated.  
 int getCellType()
          Deprecated.  
 int getClickCountToStart()
          Deprecated. ClickCountToStart controls the number of clicks required to start editing.
 java.awt.Component getComponent()
          Deprecated. Returns the a reference to the editor component.
 java.awt.Component getSecondaryEditorComponent()
          Deprecated.  
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Deprecated.  
 boolean isCellEditable(java.util.EventObject anEvent)
          Deprecated.  
 void removeCellEditorListener(javax.swing.event.CellEditorListener l)
          Deprecated.  
 void setClickCountToStart(int count)
          Deprecated. Specifies the number of clicks needed to start editing.
 boolean shouldSelectCell(java.util.EventObject anEvent)
          Deprecated.  
 boolean stopCellEditing()
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTableCellEditor

public DBTableCellEditor(javax.swing.JTextField jt,
                         DBTable dBTable)
Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.

Creates the cell editor with the given text field as the editor.
  editor properties like color, font, alignmnet etc are decided by the
  cellproperties model of the quicktable
  example
    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(yourTextField, yourQuickTable));

 Its not advisable to use this class or method directly, try to use the
 setCellComponent(Column c, int cellType, Hashtable cellValueToDisplayHash)
 method in DBTable, because that method sets both the celleditor & cell renderer,
 so both will be in sync. see DBTable#setCellComponent(Column , int , Hashtable)
 If you are a experienced programmer and if you know what you are doing, you can use this.
 

Parameters:
jt - textfield which should be used as editor
dBTable - quicktable in which this cell is used
See Also:
DBTable.setCellComponent(Column , int , Hashtable)

DBTableCellEditor

public DBTableCellEditor(javax.swing.JTextArea jt,
                         DBTable dBTable)
Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.

Creates the cell editor with the given text Area as the editor.
  editor properties like color, font, alignmnet etc are decided by the
  cellproperties model of the quicktable
  example
    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(yourTextArea, yourQuickTable));

 Its not advisable to use this class or method directly, try to use the
 setCellComponent(Column c, int cellType, Hashtable cellValueToDisplayHash)
 method in DBTable, because that method sets both the celleditor & cell renderer,
 so both will be in sync. see DBTable#setCellComponent(Column , int , Hashtable)
 If you are a experienced programmer and if you know what you are doing, you can use this.
 

Parameters:
jt - textarea which should be used as editor
dBTable - quicktable in which this cell is used
See Also:
DBTable.setCellComponent(Column , int , Hashtable)

DBTableCellEditor

public DBTableCellEditor(CellComponent cc,
                         DBTable dBTable)
Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.

Creates the cell editor with the given CellComponent.
  editor properties like color, font, alignmnet etc are decided by the
  cellproperties model of the quicktable

 Its not advisable to use this class or method directly,
 use Column#setUserCellEditor(CellComponent)
 

Parameters:
cc - CellComponent should be used as editor
dBTable - quicktable in which this cell is used
See Also:
DBTable.setCellComponent(Column , int , Hashtable)

DBTableCellEditor

public DBTableCellEditor(javax.swing.JComboBox jc,
                         DBTable dBTable)
Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.

Creates the cell editor with the given combo box as the editor.
  editor properties like color, font, alignmnet etc are decided by the
  cellproperties model of the quicktable
  example
    JComboBox yourComboBox = new JComboBox();
    yourComboBox.addItem("A");
    yourComboBox.addItem("D");
    yourComboBox.addItem("L");
    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(yourComboBox, yourQuickTable));

  In the above case database values "A", "D","L" & combo box listed values are same
  but sometimes the database values "A", "D" are diffrenet from the combo box listed
  values "Alive","Dead" ,in that case, use the other constructor
  see #DBTableCellEditor(int, Hashtable, DBTable)
  with Column.COMBOBOX_CELL as cellType and passing the hash of database values
  to listed values

 Its not advisable to use this class directly, try to use the
 setCellComponent(Column c, int cellType, Hashtable cellValueToDisplayHash) method
 in DBTable, because that method sets both the celleditor & cell renderer, so both
 will be in sync. @see DBTable#setCellComponent(Column , int , Hashtable)
 If you are a experienced programmer and if you know what you are doing, you can use this.
 

Parameters:
jc - comboBox which should be used as editor
dBTable - quicktable in which this cell is used
See Also:
DBTable.setCellComponent(Column , int , Hashtable)

DBTableCellEditor

public DBTableCellEditor(int cellType,
                         java.util.Hashtable cellValueToDisplayHashtable,
                         DBTable dBTable)
Deprecated. This constructor should not be directly used, instead use the setCellComponent method in DBTable.

Creates a celleditor based on the cellType
 Currently QuickTable supports the following components
 Icon, CheckBox, RadioButton, ComboBox.

 Its not advisable to use this class directly, try to use the
 setCellComponent(Column c, int cellType, Hashtable cellValueToDisplayHash) method
 in DBTable, because that method sets both the celleditor & cell renderer, so both
 will be in sync. @see DBTable#setCellComponent(Column , int , Hashtable)
 If you are a experienced programmer and if you know what you are doing, you can use this.

 Setting Icon Editor
  Icon editor displays a list of icons in a combobox, user can select one of the icon from combo box

 set the celltype argument as Column.IMAGE_CELL
 set the cellValueToDisplayHash to hashtable which contains a mapping of actual cell data
 to the icon that need to be displayed
 For example, lets say the database contains "A" for employee alive, "D" for employee dead
 and "L" for employee on Leave and you have three gif files to represent these states alive.gif, dead.gif, leave.gif
 Hashtable imageHash = new Hashtable();
 imageHash.put("A",new ImageIcon(this.getClass().getResource("images/alive.gif")));
 imageHash.put("D",new ImageIcon(this.getClass().getResource("images/dead.gif")));
 imageHash.put("L",new ImageIcon(this.getClass().getResource("images/leave.gif")));
 //Note: make sure you have the images directory in classpath

    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(Column.IMAGE_CELL, imageHash, yourQuickTable));

 Checkbox editor
 checkbox editor displayes a checkbox, user will be able to edit the check box by
 checking or unchecking

 set the celltype argument as Column.CHECKBOX_CELL
 set the cellValueToDisplayHash to hashtable which contains a mapping of actual cell data to the
 checkbox selection state
 For example, lets say the database contains "A" for employee alive, "D" for employee dead
 and if you want to set the checkbox selected when "A" and unselected when "D"
 Hashtable checkHash = new Hashtable();
 checkHash.put("A",new Boolean(true));
 checkHash.put("D",new Boolean(false));

    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(Column.CHECKBOX_CELL, checkHash, yourQuickTable));

 radiobutton editor
 radiobutton editor displayes a radiobutton, user will be able to edit the radiobutton by selecting or deselecting

 set the celltype argument as Column.RADIOBUTTON_CELL
 set the cellValueToDisplayHash to hashtable which contains a mapping of actual cell data to the
 checkbox selection state
 For example, lets say the database contains "A" for employee alive, "D" for employee dead
 and if you want to set the radiobutton selected when "A" and unselected when "D"
 Hashtable radioHash = new Hashtable();
 radioHash.put("A",new Boolean(true));
 radioHash.put("D",new Boolean(false));

    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(Column.RADIOBUTTON_CELL, radioHash, yourQuickTable));

 comboBox editor
 combox editor displayes a list of values in a combo box where user can select a value

 For example, lets say the database contains "A" for employee alive, "D" for employee dead
 and if you want to show "Alive" instead of "A" in the combo box list and "Dead" instead of "D"
 Hashtable comboHash = new Hashtable();
 comboHash.put("A","Alive");
 comboHash.put("D","Dead");
    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(Column.COMBOBOX_CELL, comboHash, yourQuickTable));

  In the above case the database values "A", "D" are diffrenet from the combo box listed values "Alive","Dead".
  But in some cases database values & combo box listed values are same in that case, use the other constructor @see #DBTableCellEditor(JComboBox, CellPropertiesModel)

 To create a combo box editor which contains the listed items from a Sql query use
 yourQuickTable.getColumn(1).setBoundSql("select distinct status from employee:);

 Date editor
 Date editor displays a calendar from which the user can select a date
 You have to pass the string date format in which you want the date to be displayed
 Example
  Hashtable datePatternHash = new Hashtable();
  datePatternHash.put("pattern","DD-MM-YYYY");
    yourQuickTable.getColumn(1).setCellEditor( new DBTableCellEditor(Column.DATE_CELL, datePatternHash, yourQuickTable));


 

Parameters:
cellType - Any one of Column.IMAGE_CELL or Column.CHECKBOX_CELL or Column.RADIOBUTTON_CELL or Column.COMBOBOX_CELL or Column.DATE_CELL
cellValueToDisplayHashtable - hashtable which contains a mapping of actual cell data to the display data
dBTable - quicktable in which this cell is used
See Also:
Column.setDateFormat(String), DBTable.setCellComponent(Column , int , Hashtable)

DBTableCellEditor

public DBTableCellEditor(int cellType,
                         java.util.Hashtable cellValueToDisplayHashtable,
                         DBTable dBTable,
                         boolean addClearOption)
Deprecated. 

DBTableCellEditor

public DBTableCellEditor(int cellType,
                         java.util.Hashtable cellValueToDisplayHashtable,
                         java.lang.Object[] keysSortOrder,
                         DBTable dBTable,
                         boolean addClearOption)
Deprecated. 
Method Detail

getCellType

public int getCellType()
Deprecated. 

getComponent

public java.awt.Component getComponent()
Deprecated. 
Returns the a reference to the editor component.

Returns:
the editor Component

getSecondaryEditorComponent

public java.awt.Component getSecondaryEditorComponent()
Deprecated. 

setClickCountToStart

public void setClickCountToStart(int count)
Deprecated. 
Specifies the number of clicks needed to start editing.

Parameters:
count - an int specifying the number of clicks needed to start editing
See Also:
getClickCountToStart()

getClickCountToStart

public int getClickCountToStart()
Deprecated. 
ClickCountToStart controls the number of clicks required to start editing.


getCellEditorValue

public java.lang.Object getCellEditorValue()
Deprecated. 
Specified by:
getCellEditorValue in interface javax.swing.CellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Deprecated. 
Specified by:
isCellEditable in interface javax.swing.CellEditor

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject anEvent)
Deprecated. 
Specified by:
shouldSelectCell in interface javax.swing.CellEditor

stopCellEditing

public boolean stopCellEditing()
Deprecated. 
Specified by:
stopCellEditing in interface javax.swing.CellEditor

cancelCellEditing

public void cancelCellEditing()
Deprecated. 
Specified by:
cancelCellEditing in interface javax.swing.CellEditor

convertDisplayToActual

public java.lang.Object convertDisplayToActual(java.lang.Object input)
Deprecated. 

addCellEditorListener

public void addCellEditorListener(javax.swing.event.CellEditorListener l)
Deprecated. 
Specified by:
addCellEditorListener in interface javax.swing.CellEditor

removeCellEditorListener

public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Deprecated. 
Specified by:
removeCellEditorListener in interface javax.swing.CellEditor

getTableCellEditorComponent

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