01: package jimm.datavision.gui.cmd;
02:
03: import jimm.datavision.Report;
04: import jimm.datavision.Group;
05: import jimm.datavision.gui.FieldWidget;
06: import jimm.util.I18N;
07:
08: /**
09: * A command for adding a aggregate to a field for a particular section.
10: *
11: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
12: */
13: public class NewAggregateCommand extends AbstractAggregateCommand {
14:
15: /**
16: * Constructor.
17: *
18: * @param report the report containing the field and the aggregate
19: * @param fw the field widget to which we are adding a aggregate
20: * @param group if <code>null</code>, the aggregate is added to the
21: * report footer; else the aggregate is added to the first section in
22: * the group's footer.
23: * @param functionName the aggregate function name
24: */
25: public NewAggregateCommand(Report report, FieldWidget fw,
26: Group group, String functionName) {
27: super (report, fw, group, functionName, I18N
28: .get("NewAggregateCommand.name"));
29: fieldWidget = fw;
30: this .group = group;
31: }
32:
33: public void perform() {
34: createAggregate();
35: }
36:
37: public void undo() {
38: deleteAggregate();
39: }
40:
41: }
|