01: package jimm.datavision.gui.cmd;
02:
03: import jimm.datavision.UserColumn;
04: import jimm.util.I18N;
05:
06: /**
07: * A command for changing a {@link UserColumn}'s code text.
08: *
09: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
10: */
11: public class UserColumnEditCommand extends CommandAdapter {
12:
13: protected UserColumn userColumn;
14: protected String newExpression;
15: protected String oldExpression;
16:
17: public UserColumnEditCommand(UserColumn userColumn,
18: String expression) {
19: super (I18N.get("UserColumnEditCommand.name"));
20: this .userColumn = userColumn;
21: newExpression = expression;
22: oldExpression = userColumn.getExpression();
23: }
24:
25: public void perform() {
26: userColumn.setEditableExpression(newExpression);
27: }
28:
29: public void undo() {
30: userColumn.setEditableExpression(oldExpression);
31: }
32:
33: }
|