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 intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponentFields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic ClassgetClassType(int id) static intGet the 'enumValues' property.getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) voidvoidsetCurrencyFormat(NumberFormat newformat) Changes the format of the editor component.voidsetEnumValues(Dictionary enumValues) Set the 'enumValues' property.Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getClickCountToStart, getComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell, stopCellEditingMethods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
actionPerformedin interfaceActionListener
-
itemStateChanged
- Specified by:
itemStateChangedin interfaceItemListener
-
getCellEditorValue
- Specified by:
getCellEditorValuein interfaceCellEditor- Overrides:
getCellEditorValuein classDefaultCellEditor
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) - Specified by:
getTableCellEditorComponentin interfaceTableCellEditor- Overrides:
getTableCellEditorComponentin classDefaultCellEditor
-