01: package org.swingml.tablebrowser.ext;
02:
03: import java.awt.*;
04: import java.util.*;
05: import javax.swing.*;
06: import javax.swing.event.*;
07: import javax.swing.table.*;
08:
09: public class TableBrowserCellEditor extends JPanel implements
10: TableCellEditor {
11:
12: private TableCellEditor originalEditor;
13:
14: public TableBrowserCellEditor(TableCellEditor anEditor) {
15: super ();
16: this .originalEditor = anEditor;
17: }
18:
19: public void addCellEditorListener(CellEditorListener l) {
20: originalEditor.addCellEditorListener(l);
21: }
22:
23: public void cancelCellEditing() {
24: originalEditor.cancelCellEditing();
25: }
26:
27: public Object getCellEditorValue() {
28: return originalEditor.getCellEditorValue();
29: }
30:
31: public Component getTableCellEditorComponent(JTable table,
32: Object value, boolean isSelected, int row, int column) {
33: Component component = originalEditor
34: .getTableCellEditorComponent(table, value, isSelected,
35: row, column);
36: component.setFont(table.getFont());
37: return component;
38: }
39:
40: public boolean isCellEditable(EventObject anEvent) {
41: return originalEditor.isCellEditable(anEvent);
42: }
43:
44: public void removeCellEditorListener(CellEditorListener l) {
45: originalEditor.removeCellEditorListener(l);
46: }
47:
48: public boolean shouldSelectCell(EventObject anEvent) {
49: return originalEditor.shouldSelectCell(anEvent);
50: }
51:
52: public boolean stopCellEditing() {
53: return originalEditor.stopCellEditing();
54: }
55: }
|