Package org.pentaho.reporting.engine.classic.core

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


    public void undo(final ReportDocumentContext renderContext)
    {
      final RelationalGroup selectedGroup = (RelationalGroup)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      final GroupBody bodyElement = selectedGroup.getBody();
      if (bodyElement instanceof SubGroupBody == false)
      {
        throw new IllegalStateException();
      }
View Full Code Here


    public void redo(final ReportDocumentContext renderContext)
    {
      final RelationalGroup selectedGroup = (RelationalGroup)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);

      final GroupBody bodyElement = selectedGroup.getBody();
      if (bodyElement instanceof SubGroupBody == false)
      {
        throw new IllegalStateException();
      }
View Full Code Here

    public void undo(final ReportDocumentContext renderContext)
    {
      final RelationalGroup selectedGroup = (RelationalGroup)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);

      final GroupBody bodyElement = selectedGroup.getBody();
      if (bodyElement instanceof SubGroupBody == false)
      {
        throw new IllegalStateException();
      }
      final SubGroupBody sgb = (SubGroupBody) bodyElement;
      final GroupBody maybeDataBody = sgb.getGroup().getBody();
      if (maybeDataBody instanceof GroupDataBody == false)
      {
        throw new IllegalStateException();
      }
View Full Code Here

    public void redo(final ReportDocumentContext renderContext)
    {
      final RelationalGroup selectedGroup = (RelationalGroup)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);

      final GroupBody bodyElement = selectedGroup.getBody();
      if (bodyElement instanceof GroupDataBody == false)
      {
        throw new IllegalStateException();
      }
View Full Code Here

      if (selectedElement instanceof CrosstabOtherGroup)
      {
        // execution order is important here.
        // first unlink the old root-group by setting a new one ...
        final CrosstabOtherGroup selectedGroup = (CrosstabOtherGroup) selectedElement;
        final GroupBody oldGroupBody = selectedGroup.getBody();
        final CrosstabOtherGroupBody newGroupBody = new CrosstabOtherGroupBody(newGroup);
        selectedGroup.setBody(newGroupBody);
        newGroup.setBody(oldGroupBody);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabOtherGroupAction.UndoName"),
            new InsertGroupBodyOnGroupUndoEntry(selectedGroup.getObjectID(), oldGroupBody, newGroupBody));
      }
      if (selectedElement instanceof CrosstabGroup)
      {
        final CrosstabGroup selectedGroup = (CrosstabGroup) selectedElement;
        final GroupBody oldGroupBody = selectedGroup.getBody();
        final CrosstabOtherGroupBody newGroupBody = new CrosstabOtherGroupBody(newGroup);
        selectedGroup.setBody(newGroupBody);
        newGroup.setBody(oldGroupBody);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabOtherGroupAction.UndoName"),
View Full Code Here

        return footer;
      }

      if (insert instanceof GroupBody)
      {
        final GroupBody body = (GroupBody) insert.derive();
        try
        {
          g.setBody(body);
          return body;
        }
        catch (final Exception e)
        {
          return null;
        }
      }
      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

  }

  private static UndoEntry deleteGroupBody(final GroupBody data)
  {
    final GroupBody subgroup = (GroupBody) data;
    final RelationalGroup parent = (RelationalGroup) subgroup.getParentSection();
    if (parent != null)
    {
      final GroupBody body = parent.getBody();
      final GroupDataBody newBody = new GroupDataBody();
      parent.setBody(newBody);
      return new SectionEditUndoEntry
          (parent.getObjectID(), ModelUtility.findIndexOf(parent, newBody), body, newBody);
    }
View Full Code Here

      final CrosstabElement crosstabElement = (CrosstabElement)reportDefinition;
      final Group group = crosstabElement.getRootGroup();
      if (group instanceof CrosstabGroup)
      {
        final CrosstabGroup crosstabGroup = (CrosstabGroup)group;
        final GroupBody crosstabGroupBody = crosstabGroup.getBody();

        // Start with the other group and work our way deeper recursively.
        // Note: Other Group is optional.
        if (crosstabGroupBody instanceof CrosstabOtherGroupBody)
        {
View Full Code Here

    buildCrosstabElementsList(crosstabTitleHeader, columnGroupBodyList);
    buildCrosstabElementsList(crosstabHeader, columnGroupBodyList);
    buildCrosstabElementsList(crosstabSummaryHeader, columnGroupBodyList);

    final GroupBody body = crosstabColumnGroup.getBody();
    if (body instanceof CrosstabColumnGroupBody)
    {
      // Recurse to the next column-group
      buildCrosstabColumnGroupBands((CrosstabColumnGroupBody)body);
    }
View Full Code Here

    buildCrosstabElementsList(crosstabTitleHeader, rowGroupBodyList);
    buildCrosstabElementsList(crosstabHeader, rowGroupBodyList);
    buildCrosstabElementsList(crosstabSummaryHeader, rowGroupBodyList);

    final GroupBody body = crosstabRowGroup.getBody();
    if (body instanceof CrosstabRowGroupBody)
    {
      // Recurse to add additional row-groups
      buildCrosstabRowGroupBands((CrosstabRowGroupBody)body);
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.GroupBody

Copyright © 2018 www.massapicom. 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.