01: package jimm.datavision.gui.cmd;
02:
03: import jimm.datavision.Section;
04: import jimm.util.I18N;
05:
06: /**
07: * Toggles the state of a section's page break flag.
08: *
09: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
10: */
11: public class SectionPageBreakCommand extends CommandAdapter {
12:
13: protected Section section;
14:
15: public SectionPageBreakCommand(Section section) {
16: super (
17: I18N
18: .get(section.hasPageBreak() ? "SectionPageBreakCommand.off_name"
19: : "SectionPageBreakCommand.on_name"));
20: this .section = section;
21: }
22:
23: public void perform() {
24: boolean newState = !section.hasPageBreak();
25: section.setPageBreak(newState);
26: }
27:
28: public void undo() {
29: perform();
30: }
31:
32: }
|