001: /**
002: * ===========================================
003: * JFreeReport : a free Java reporting library
004: * ===========================================
005: *
006: * Project Info: http://reporting.pentaho.org/
007: *
008: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009: *
010: * This library is free software; you can redistribute it and/or modify it under the terms
011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
012: * either version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: * See the GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License along with this
019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: *
022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023: * in the United States and other countries.]
024: *
025: * ------------
026: * FlowHtmlOutputProcessor.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.modules.output.table.html;
030:
031: import org.jfree.report.layout.model.LogicalPageBox;
032: import org.jfree.report.layout.output.ContentProcessingException;
033: import org.jfree.report.layout.output.DisplayAllFlowSelector;
034: import org.jfree.report.layout.output.FlowSelector;
035: import org.jfree.report.layout.output.LogicalPageKey;
036: import org.jfree.report.layout.output.OutputProcessorMetaData;
037: import org.jfree.report.modules.output.table.base.AbstractTableOutputProcessor;
038: import org.jfree.report.modules.output.table.base.TableContentProducer;
039: import org.jfree.report.modules.output.table.html.helper.HtmlOutputProcessorMetaData;
040: import org.jfree.util.Configuration;
041:
042: /**
043: * Creation-Date: 04.05.2007, 16:36:31
044: *
045: * @author Thomas Morgner
046: */
047: public class FlowHtmlOutputProcessor extends
048: AbstractTableOutputProcessor implements HtmlOutputProcessor {
049: private HtmlPrinter printer;
050: private OutputProcessorMetaData metaData;
051: private FlowSelector flowSelector;
052:
053: public FlowHtmlOutputProcessor(final Configuration configuration) {
054: this .metaData = new HtmlOutputProcessorMetaData(configuration,
055: HtmlOutputProcessorMetaData.PAGINATION_MANUAL);
056: this .flowSelector = new DisplayAllFlowSelector();
057: }
058:
059: public FlowSelector getFlowSelector() {
060: return flowSelector;
061: }
062:
063: public void setFlowSelector(final FlowSelector flowSelector) {
064: this .flowSelector = flowSelector;
065: }
066:
067: public OutputProcessorMetaData getMetaData() {
068: return metaData;
069: }
070:
071: public HtmlPrinter getPrinter() {
072: return printer;
073: }
074:
075: public void setPrinter(final HtmlPrinter printer) {
076: this .printer = printer;
077: }
078:
079: protected void processTableContent(
080: final LogicalPageKey logicalPageKey,
081: final LogicalPageBox logicalPage,
082: final TableContentProducer contentProducer)
083: throws ContentProcessingException {
084: if (printer == null) {
085: return;
086: }
087:
088: printer.print(logicalPageKey, logicalPage, contentProducer,
089: metaData, false);
090: }
091:
092: protected void updateTableContent(
093: final LogicalPageKey logicalPageKey,
094: final LogicalPageBox logicalPageBox,
095: final TableContentProducer tableContentProducer,
096: final boolean performOutput)
097: throws ContentProcessingException {
098: if (printer == null) {
099: return;
100: }
101:
102: printer.print(logicalPageKey, logicalPageBox,
103: tableContentProducer, metaData, true);
104: }
105: }
|