Package com.portal.ctrl
Class PTableCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
javax.swing.DefaultCellEditor
com.portal.ctrl.PTableCellEditor
- All Implemented Interfaces:
ActionListener
,ItemListener
,Serializable
,EventListener
,CellEditor
,TableCellEditor
,TreeCellEditor
A generic editor for table cells
- Version:
- $Version$
- Author:
- Kapono Carter
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.DefaultCellEditor
DefaultCellEditor.EditorDelegate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
static Class
getClassType
(int id) static int
Get the 'enumValues' property.getTableCellEditorComponent
(JTable table, Object value, boolean isSelected, int row, int column) void
void
setCurrencyFormat
(NumberFormat newformat) Changes the format of the editor component.void
setEnumValues
(Dictionary enumValues) Set the 'enumValues' property.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 Details
-
TEXT
public static final int TEXT- See Also:
-
INTEGER
public static final int INTEGER- See Also:
-
DECIMAL
public static final int DECIMAL- See Also:
-
CURRENCY
public static final int CURRENCY- See Also:
-
ENUM_VAL
public static final int ENUM_VAL- See Also:
-
DATE
public static final int DATE- See Also:
-
-
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
-
getEditorType
-
setCurrencyFormat
Changes the format of the editor component.- Parameters:
newformat
- the new format
-
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
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
- Specified by:
actionPerformed
in interfaceActionListener
-
itemStateChanged
- Specified by:
itemStateChanged
in interfaceItemListener
-
getCellEditorValue
- Specified by:
getCellEditorValue
in interfaceCellEditor
- Overrides:
getCellEditorValue
in classDefaultCellEditor
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) - Specified by:
getTableCellEditorComponent
in interfaceTableCellEditor
- Overrides:
getTableCellEditorComponent
in classDefaultCellEditor
-