KickJava   Java API By Example, From Geeks To Geeks.

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


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 adding a aggregate to a field for a particular section.
9  *
10  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
11  */

12 public class NewAggregateCommand extends AbstractAggregateCommand {
13
14 /**
15  * Constructor.
16  *
17  * @param report the report containing the field and the aggregate
18  * @param fw the field widget to which we are adding a aggregate
19  * @param group if <code>null</code>, the aggregate is added to the
20  * report footer; else the aggregate is added to the first section in
21  * the group's footer.
22  * @param functionName the aggregate function name
23  */

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