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