01: package net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent;
02:
03: /**
04: * @author gwg
05: *
06: * This interface allows sections of the DataType objects to operate on
07: * both RestorableJTextField and RestorableJTextArea components.
08: *
09: * In those components,the original contents of the cell is saved whenever
10: * the setText() method is called. The original text is restored to the
11: * component by calling restoreText(), and the contents of the cell is
12: * updated without changing the original text by calling updateText().
13: *
14: * This is the only way that I could find to handle saving/restoring the
15: * initial data in the cell. The problem is that the CellEditor component is created
16: * without any data, then the same component is reused for every cell
17: * in the column.
18: */
19: public interface IRestorableTextComponent {
20:
21: /*
22: * Restore the contents to the original value.
23: */
24: public void restoreText();
25:
26: /*
27: * Set the contents of the component without resetting the
28: * original value.
29: */
30: public void updateText(String text);
31: }
|