01: package org.osbl.client.wings.form;
02:
03: import org.wings.*;
04: import org.wingx.table.EditableTableCellRenderer;
05:
06: import java.awt.event.ActionListener;
07: import java.awt.event.ActionEvent;
08:
09: public class StringEditableCellRenderer extends STextField implements
10: EditableTableCellRenderer, ActionListener {
11: public StringEditableCellRenderer() {
12: addActionListener(this );
13: }
14:
15: public Object getValue() {
16: String s = getText();
17: if ("".equals(s))
18: return null;
19: return s;
20: }
21:
22: public SComponent getTableCellRendererComponent(STable table,
23: Object value, boolean isSelected, int row, int column) {
24: setEditable(table.isEnabled());
25: setText((String) value);
26: return this ;
27: }
28:
29: public LowLevelEventListener getLowLevelEventListener(STable table,
30: int row, int column) {
31: return this ;
32: }
33:
34: public void actionPerformed(ActionEvent e) {
35: }
36: }
|