Class PTableCellEditor

All Implemented Interfaces:
ActionListener, ItemListener, Serializable, EventListener, CellEditor, TableCellEditor, TreeCellEditor

public class PTableCellEditor extends DefaultCellEditor implements ActionListener, ItemListener
A generic editor for table cells
Version:
$Version$
Author:
Kapono Carter
See Also:
  • Field Details

  • Constructor Details

    • PTableCellEditor

      public PTableCellEditor()
    • PTableCellEditor

      public PTableCellEditor(int type)
      Parameters:
      type - The type of data this editor will be modifying. This determines the appropriate editor to use.
  • Method Details

    • getClassType

      public static Class getClassType(int id)
    • getEditorType

      public static int getEditorType(Class c)
    • setCurrencyFormat

      public void setCurrencyFormat(NumberFormat newformat)
      Changes the format of the editor component.
      Parameters:
      newformat - the new format
    • getEnumValues

      public Dictionary getEnumValues()
      Get the 'enumValues' property. If not null, then any integer value to be displayed is assumed to be an enum. The value is passed to the map as a 'key' to lookup a string value to display instead.
      Returns:
      A Map of integer values to display strings.
    • setEnumValues

      public void setEnumValues(Dictionary enumValues)
      Set the 'enumValues' property. If not null, then any integer value to be displayed is assumed to be an enum. The value is passed to the map as a 'key' to lookup a string value to display instead.
      Parameters:
      enumValues - An enum to string map or null.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • 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