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