1 package jimm.datavision.gui.cmd; 2 import jimm.datavision.Report; 3 import jimm.util.I18N; 4 5 10 public class SummaryCommand extends CommandAdapter { 11 12 protected Report report; 13 protected String origName; 14 protected String origTitle; 15 protected String origAuthor; 16 protected String origDescription; 17 protected String newName; 18 protected String newTitle; 19 protected String newAuthor; 20 protected String newDescription; 21 22 public SummaryCommand(Report report, String newName, String newTitle, 23 String newAuthor, String newDescription) 24 { 25 super(I18N.get("SummaryCommand.name")); 26 this.report = report; 27 this.newName = newName; 28 this.newTitle = newTitle; 29 this.newAuthor = newAuthor; 30 this.newDescription = newDescription; 31 32 origName = report.getName(); 33 origTitle = report.getTitle(); 34 origAuthor = report.getAuthor(); 35 origDescription = report.getDescription(); 36 } 37 38 public void perform() { 39 report.setName(newName); 40 report.setTitle(newTitle); 41 report.setAuthor(newAuthor); 42 report.setDescription(newDescription); 43 } 44 45 public void undo() { 46 report.setName(origName); 47 report.setTitle(origTitle); 48 report.setAuthor(origAuthor); 49 report.setDescription(origDescription); 50 } 51 52 } 53 | Popular Tags |