Update git submodules
[LibreOffice.git] / reportbuilder / java / org / libreoffice / report / pentaho / model / OfficeGroup.java
blobe632cc938435dc158dc3f8222d90c7d997d8d61a
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package org.libreoffice.report.pentaho.model;
20 import org.libreoffice.report.pentaho.OfficeNamespaces;
22 import org.jfree.report.JFreeReportInfo;
23 import org.jfree.report.expressions.Expression;
24 import org.jfree.report.structure.Section;
26 /**
27 * An office group is a virtual section that contains the group header, footer
28 * and either a detail section or another group.
30 * @since 02.03.2007
32 public class OfficeGroup extends Section
35 public OfficeGroupSection getHeader()
37 final OfficeGroupInstanceSection instanceSection =
38 (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance");
39 if (instanceSection == null)
41 return null;
43 return (OfficeGroupSection) instanceSection.findFirstChild(OfficeNamespaces.OOREPORT_NS, "group-header");
47 public OfficeGroupSection getFooter()
49 final OfficeGroupInstanceSection instanceSection =
50 (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance");
51 if (instanceSection == null)
53 return null;
55 return (OfficeGroupSection) instanceSection.findFirstChild(OfficeNamespaces.OOREPORT_NS, "group-footer");
59 public Expression getGroupingExpression()
61 final OfficeGroupInstanceSection instanceSection =
62 (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance");
63 if (instanceSection == null)
65 return null;
67 return instanceSection.getGroupingExpression();
70 public String getSortingExpression()
72 final OfficeGroupInstanceSection instanceSection =
73 (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance");
74 if (instanceSection == null)
76 return null;
78 return instanceSection.getSortingExpression();