/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2001 - 2013 Object Refinery Ltd, Pentaho Corporation and Contributors.. All rights reserved. */ package org.pentaho.reporting.engine.classic.core; import org.pentaho.reporting.engine.classic.core.filter.types.bands.GroupFooterType; import org.pentaho.reporting.engine.classic.core.style.BandStyleKeys; /** * A band that appears at the end of each instance of a group. A group-footer can be marked as repeating footer causing * the footer to be printed at the bottom of each page as long as the group is active. If the footer is marked sticky, * the footer will even be printed for all sub-report pages. * <p/> * Subreports defined for a repeating group footer will be ignored for all repeating instances. * * @author David Gilbert */ public class GroupFooter extends AbstractRootLevelBand { /** * Constructs a group footer band, containing no elements. */ public GroupFooter() { setElementType( new GroupFooterType() ); } /** * Checks whether this group header should be repeated on new pages. * * @return true, if the header will be repeated, false otherwise */ public boolean isRepeat() { return getStyle().getBooleanStyleProperty( BandStyleKeys.REPEAT_HEADER ); } /** * Defines, whether this group header should be repeated on new pages. * * @param repeat * true, if the header will be repeated, false otherwise */ public void setRepeat( final boolean repeat ) { getStyle().setBooleanStyleProperty( BandStyleKeys.REPEAT_HEADER, repeat ); notifyNodePropertiesChanged(); } /** * Returns true if the footer should be shown on all subreports. * * @return true or false. */ public boolean isSticky() { return getStyle().getBooleanStyleProperty( BandStyleKeys.STICKY, false ); } /** * Defines whether the footer should be shown on all subreports. * * @param b * a flag indicating whether or not the footer is shown on the first page. */ public void setSticky( final boolean b ) { getStyle().setBooleanStyleProperty( BandStyleKeys.STICKY, b ); notifyNodePropertiesChanged(); } }