1 package jimm.datavision.gui.cmd; 2 import jimm.datavision.Nameable; 3 import jimm.util.I18N; 4 5 10 public class NameableRenameCommand extends CommandAdapter { 11 12 protected Nameable nameable; 13 protected String oldName; 14 protected String newName; 15 16 public NameableRenameCommand(Nameable nameable, String oldName, String newName) 17 { 18 super(I18N.get("NameableRenameCommand.name")); 19 this.nameable = nameable; 20 this.oldName = oldName; 21 this.newName = newName; 22 } 23 24 public void perform() { 25 nameable.setName(newName); 26 } 27 28 public void undo() { 29 nameable.setName(oldName); 30 } 31 32 } 33 | Popular Tags |