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 deleting a aggregate to a field from a particular section.
10: *
11: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
12: */
13: public class DeleteAggregateCommand extends AbstractAggregateCommand {
14:
15: /**
16: * Constructor.
17: *
18: * @param report the report containing the field and the aggregate
19: * @param fw the field widget from which we are deleting the aggregate
20: * @param aggregateWidget the aggregate's field widget
21: * @param funcName current function of aggregate, in case we undo
22: * @param group if <code>null</code>, the aggregate is deleted from the
23: * report footer; else the aggregate is deleted from the group's footer.
24: */
25: public DeleteAggregateCommand(Report report, FieldWidget fw,
26: FieldWidget aggregateWidget, String funcName, Group group) {
27: super (report, fw, group, funcName, I18N
28: .get("DeleteAggregateCommand.name"));
29: this .aggregateWidget = aggregateWidget;
30: }
31:
32: public void perform() {
33: deleteAggregate();
34: }
35:
36: public void undo() {
37: createAggregate();
38: }
39:
40: }
|