01: package jimm.datavision.gui.cmd;
02:
03: import jimm.datavision.Report;
04: import jimm.datavision.Group;
05: import jimm.datavision.Selectable;
06: import jimm.datavision.gui.Designer;
07: import jimm.util.I18N;
08:
09: public class NewGroupCommand extends CommandAdapter {
10:
11: protected Designer designer;
12: protected Report report;
13: protected Group group;
14:
15: public NewGroupCommand(Designer designer, Report report,
16: Selectable selectable, int sortOrder) {
17: super (I18N.get("NewGroupCommand.name"));
18:
19: this .designer = designer;
20: this .report = report;
21: group = Group.create(report, selectable);
22: group.setSortOrder(sortOrder);
23: }
24:
25: public void perform() {
26: report.addGroup(group);
27: designer.rebuildGroups();
28: }
29:
30: public void undo() {
31: report.removeGroup(group);
32: designer.rebuildGroups();
33: }
34:
35: }
|