KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jimm > datavision > gui > cmd > DeleteAggregateCommand


1 package jimm.datavision.gui.cmd;
2 import jimm.datavision.Report;
3 import jimm.datavision.Group;
4 import jimm.datavision.gui.FieldWidget;
5 import jimm.util.I18N;
6
7 /**
8  * A command for deleting a aggregate to a field from a particular section.
9  *
10  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
11  */

12 public class DeleteAggregateCommand extends AbstractAggregateCommand {
13
14 /**
15  * Constructor.
16  *
17  * @param report the report containing the field and the aggregate
18  * @param fw the field widget from which we are deleting the aggregate
19  * @param aggregateWidget the aggregate's field widget
20  * @param funcName current function of aggregate, in case we undo
21  * @param group if <code>null</code>, the aggregate is deleted from the
22  * report footer; else the aggregate is deleted from the group's footer.
23  */

24 public DeleteAggregateCommand(Report report, FieldWidget fw,
25                  FieldWidget aggregateWidget, String JavaDoc funcName,
26                   Group group)
27 {
28     super(report, fw, group, funcName,
29       I18N.get("DeleteAggregateCommand.name"));
30     this.aggregateWidget = aggregateWidget;
31 }
32
33 public void perform() {
34     deleteAggregate();
35 }
36
37 public void undo() {
38     createAggregate();
39 }
40
41 }
42
Popular Tags