java.lang.Object
javax.swing.AbstractCellEditor
org.bzdev.swing.CSSCellEditor
- All Implemented Interfaces:
ActionListener
,Serializable
,EventListener
,CellEditor
,TableCellEditor
,TreeCellEditor
public class CSSCellEditor
extends AbstractCellEditor
implements TableCellEditor, TreeCellEditor, ActionListener
Table cell editor for CSS color specifications.
The color is stored in a table as text, but will be edited using a
color chooser. The color chooser can use CSS named colors if desired.
An example of when this class might be used is when an instance of
ConfigPropertyEditor
includes entries providing colors:
while a color should be displayed, it has to be stored as text for
the property editor to save its configuration.
The code is based on an example in the Java swing tutorial.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
getTableCellEditorComponent
(JTable table, Object value, boolean isSelected, int row, int column) getTreeCellEditorComponent
(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
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, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
Constructor Details
-
CSSCellEditor
public CSSCellEditor()Constructor.
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
getCellEditorValue
- Specified by:
getCellEditorValue
in interfaceCellEditor
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) - Specified by:
getTableCellEditorComponent
in interfaceTableCellEditor
-
getTreeCellEditorComponent
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) - Specified by:
getTreeCellEditorComponent
in interfaceTreeCellEditor
-