Examples of SubGroupBody


Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

    GroupBody body = crosstabGroup.getBody();
    while (body != null)
    {
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody sgBody = (SubGroupBody) body;
        final Group g = sgBody.getGroup();
        body = g.getBody();
        continue;
      }

      if (body instanceof CrosstabOtherGroupBody)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

    {
      group.setFooter((GroupFooter) footerReadHandler.getBand());
    }
    if (groupReadHandler != null)
    {
      final SubGroupBody subGroupBody = new SubGroupBody();
      subGroupBody.setGroup(groupReadHandler.getGroup());
      group.setBody(subGroupBody);
    }
    else
    {
      group.setBody(new GroupDataBody());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

    final CrosstabElement element = new CrosstabElement();

    CrosstabGroup rootGroup = new CrosstabGroup();

    RelationalGroup relGroup = new RelationalGroup();
    relGroup.setBody(new SubGroupBody(rootGroup));
    element.setRootGroup(relGroup);

    report.getReportHeader().addElement(element);

    final TestReportDesignerContext rdc = new TestReportDesignerContext();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

      return null;
    }

    if (rawLeadSelection instanceof SubGroupBody)
    {
      final SubGroupBody body = (SubGroupBody) rawLeadSelection;
      if (insert instanceof RelationalGroup || insert instanceof CrosstabGroup)
      {
        try
        {
          final Group group = (Group) insert.derive();
          body.setGroup(group);
          return group;
        }
        catch (Exception cne)
        {
          UncaughtExceptionsModel.getInstance().addException(cne);
          return null;
        }
      }
      return null;
    }

    if (rawLeadSelection instanceof GroupDataBody)
    {
      final GroupDataBody body = (GroupDataBody) rawLeadSelection;
      if (insert instanceof DetailsHeader)
      {
        final DetailsHeader detailsHeader = (DetailsHeader) insert.derive();
        body.setDetailsHeader(detailsHeader);
        return detailsHeader;
      }
      if (insert instanceof DetailsFooter)
      {
        final DetailsFooter footer = (DetailsFooter) insert.derive();
        body.setDetailsFooter(footer);
        return footer;
      }
      if (insert instanceof ItemBand)
      {
        final ItemBand itemBand = (ItemBand) insert.derive();
        body.setItemBand(itemBand);
        return itemBand;
      }
      if (insert instanceof NoDataBand)
      {
        final NoDataBand noDataBand = (NoDataBand) insert.derive();
        body.setNoDataBand(noDataBand);
        return noDataBand;
      }
      return null;
    }

    if (rawLeadSelection instanceof CrosstabCellBody)
    {
      final CrosstabCellBody body = (CrosstabCellBody) rawLeadSelection;
      if (insert instanceof CrosstabCell)
      {
        final CrosstabCell crosstabCell = (CrosstabCell) insert.derive();
        body.addElement(crosstabCell);
        return crosstabCell;
      }
    }

    return null;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

  {
    // deleting this group means, that the body moves down one level.
    final Section parent = groupElement.getParentSection();
    if (parent instanceof SubGroupBody)
    {
      final SubGroupBody parentBody = (SubGroupBody) groupElement.getParentSection();
      final Group oldGroup = parentBody.getGroup();
      final RelationalGroup newRootGroup = new RelationalGroup();
      parentBody.setGroup(newRootGroup);
      return new SectionEditUndoEntry
          (parentBody.getObjectID(), ModelUtility.findIndexOf(parentBody, newRootGroup), oldGroup, newRootGroup);
    }
    if (parent instanceof AbstractReportDefinition)
    {
      final AbstractReportDefinition report = (AbstractReportDefinition) parent;
      final Group oldGroup = report.getRootGroup();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

      list.add(group);

      final Element bodyElement = group.getBody();
      if (bodyElement instanceof SubGroupBody)
      {
        final SubGroupBody body = (SubGroupBody) bodyElement;
        group = body.getGroup();
        continue;
      }
      else if (bodyElement instanceof CrosstabOtherGroupBody)
      {
        final CrosstabOtherGroupBody body = (CrosstabOtherGroupBody) bodyElement;
        group = body.getGroup();
        continue;
      }
      group = null;
    }
    return list.toArray(new Group[list.size()]);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

      data.add(new GroupDataEntry(group.getObjectID(), group.getName(), rgroup.getFieldsArray()));

      final GroupBody body = rgroup.getBody();
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody subGroupBody = (SubGroupBody) body;
        group = subGroupBody.getGroup();
      }
      else
      {
        group = null;
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

      groups.put(group.getObjectID(), rgroup);

      final GroupBody body = rgroup.getBody();
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody subGroupBody = (SubGroupBody) body;
        group = subGroupBody.getGroup();
      }
      else
      {
        group = null;
      }
    }

    final RelationalGroup[] resultGroups = new RelationalGroup[newEntries.length];
    for (int i = 0; i < newEntries.length; i++)
    {
      final GroupDataEntry o = newEntries[i];
      final RelationalGroup sourceGroup = groups.get(o.getInstanceID());
      if (sourceGroup == null)
      {
        resultGroups[i] = new RelationalGroup();
      }
      else
      {
        resultGroups[i] = sourceGroup;
      }

      resultGroups[i].setName(o.getName());
      resultGroups[i].setFieldsArray(o.getFields());
    }

    final GroupBody innermostBody;
    if (innermostGroup == null)
    {
      innermostBody = new SubGroupBody(abstractReportDefinition.getRootGroup());
    }
    else
    {
      innermostBody = innermostGroup.getBody();
    }

    if (resultGroups.length > 0)
    {
      for (int i = 0; i < resultGroups.length; i++)
      {
        final RelationalGroup resultGroup = resultGroups[i];
        if (i == 0)
        {
          abstractReportDefinition.setRootGroup(resultGroup);
        }
        else
        {
          final RelationalGroup prevGroup = resultGroups[i - 1];
          final GroupBody body = prevGroup.getBody();
          if (body instanceof SubGroupBody)
          {
            final SubGroupBody sgb = (SubGroupBody) body;
            sgb.setGroup(resultGroup);
          }
          else
          {
            final SubGroupBody sgb = new SubGroupBody();
            sgb.setGroup(resultGroup);
            prevGroup.setBody(sgb);
          }
        }
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

  public static GroupDataBody installCrosstabIntoLastGroup(final RelationalGroup selectedGroup,
                                                           final CrosstabGroup newGroup)
  {
    final GroupDataBody oldBody = (GroupDataBody) selectedGroup.getBody();
    // install the new crosstab group into the group
    selectedGroup.setBody(new SubGroupBody(newGroup));
    return oldBody;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.SubGroupBody

      this.newRootGroup = newRootGroup.derive(true);
    }

    public void undo(final ReportDocumentContext renderContext)
    {
      final SubGroupBody bodyElement = (SubGroupBody)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      if (bodyElement == null)
      {
        throw new IllegalStateException("Expected to find a sub-group-body on the specified ID.");
      }

      bodyElement.setGroup(oldRootGroup.derive(true));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.