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

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


              new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
          parent.addElement(subReport);
        }
        else
        {
          final AbstractRootLevelBand arb = (AbstractRootLevelBand) parent;

          final ReportRenderContext context = dragContext.getRenderContext();
          final UndoManager undo = context.getUndo();
          undo.addChange(Messages.getInstance().getString("TocElementDragHandler.UndoEntry"),
              new BandedSubreportEditUndoEntry(parent.getObjectID(), arb.getSubReportCount(), null, subReport));
          arb.addSubReport(subReport);
        }
      }
      else
      {
        final ReportRenderContext context = dragContext.getRenderContext();
View Full Code Here


              new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
          parent.addElement(subReport);
        }
        else
        {
          final AbstractRootLevelBand arb = (AbstractRootLevelBand) parent;

          final ReportRenderContext context = dragContext.getRenderContext();
          final UndoManager undo = context.getUndo();
          undo.addChange(Messages.getInstance().getString("TocElementDragHandler.UndoEntry"),
              new BandedSubreportEditUndoEntry(parent.getObjectID(), arb.getSubReportCount(), null, subReport));
          arb.addSubReport(subReport);
        }
      }
      else
      {
        final ReportRenderContext context = dragContext.getRenderContext();
View Full Code Here

    }

    if (element instanceof SubReport &&
        reportElement instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand re = (AbstractRootLevelBand) reportElement;
      final int count = re.getSubReportCount();
      for (int i = 1; i < count; i++)
      {
        final SubReport sr = re.getSubReport(i);
        if (sr == element)
        {
          re.removeSubreport(sr);
          re.addSubReport(i - 1, sr);

          return new CompoundUndoEntry
              (new BandedSubreportEditUndoEntry(re.getObjectID(), i, sr, null),
                  new BandedSubreportEditUndoEntry(re.getObjectID(), i - 1, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
View Full Code Here

      return null;
    }

    if (element instanceof SubReport && reportElement instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand re = (AbstractRootLevelBand) reportElement;
      final int count = re.getSubReportCount() - 1;
      for (int i = 0; i < count; i++)
      {
        final SubReport sr = re.getSubReport(i);
        if (sr == element)
        {
          re.removeSubreport(sr);
          re.addSubReport(i + 1, sr);

          return new CompoundUndoEntry
                  (new BandedSubreportEditUndoEntry(re.getObjectID(), i, sr, null),
                          new BandedSubreportEditUndoEntry(re.getObjectID(), i - 1, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
View Full Code Here

      return null;
    }

    if (element instanceof SubReport && reportElement instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand re = (AbstractRootLevelBand) reportElement;
      final int count = re.getSubReportCount();
      for (int i = 1; i < count; i++)
      {
        final SubReport sr = re.getSubReport(i);
        if (sr == element)
        {
          re.removeSubreport(sr);
          re.addSubReport(0, sr);

          return new CompoundUndoEntry
                  (new BandedSubreportEditUndoEntry(re.getObjectID(), i, sr, null),
                          new BandedSubreportEditUndoEntry(re.getObjectID(), 0, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
View Full Code Here

      return null;
    }

    if (element instanceof SubReport && reportElement instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand re = (AbstractRootLevelBand) reportElement;
      final int count = re.getSubReportCount() - 1;
      for (int i = 0; i < count; i++)
      {
        final SubReport sr = re.getSubReport(i);
        if (sr == element)
        {
          re.removeSubreport(sr);
          re.addSubReport(sr);

          return new CompoundUndoEntry
              (new BandedSubreportEditUndoEntry(re.getObjectID(), i, sr, null),
                  new BandedSubreportEditUndoEntry(re.getObjectID(), re.getElementCount() - 1, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
View Full Code Here

              new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
          parent.addElement(subReport);
        }
        else
        {
          final AbstractRootLevelBand arb = (AbstractRootLevelBand) parent;

          final ReportRenderContext context = dragContext.getRenderContext();
          final UndoManager undo = context.getUndo();
          undo.addChange(Messages.getString("SubreportReportElementDragHandler.UndoEntry"),
              new BandedSubreportEditUndoEntry(parent.getObjectID(), arb.getSubReportCount(), null, subReport));
          arb.addSubReport(subReport);
        }
      }
      else
      {
        final ReportRenderContext context = dragContext.getRenderContext();
View Full Code Here

        {
          if (Boolean.TRUE.equals(subreportHint))
          {
            if (target instanceof AbstractRootLevelBand)
            {
              final AbstractRootLevelBand rlb = (AbstractRootLevelBand) target;
              rlb.addSubReport((SubReport) element);
              return element;
            }
            else
            {
              return false;
View Full Code Here

    final Element veElement = (Element) data;
    final Section parent = veElement.getParentSection();
    if (data instanceof SubReport && parent instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand re = (AbstractRootLevelBand) parent;
      final SubReport report = (SubReport) data;
      final int index = ModelUtility.findSubreportIndexOf(re, report);
      if (index != -1)
      {
        re.removeSubreport(report);
      }
      if (veElement.getParent() == null)
      {
        // remove was a success ...
        return new BandedSubreportEditUndoEntry(re.getObjectID(), index, report, null);
      }
    }

    if (parent instanceof Band)
    {
View Full Code Here

    this.newElement = newElement;
  }

  public void undo(final ReportRenderContext renderContext)
  {
    final AbstractRootLevelBand elementById = (AbstractRootLevelBand)
        ModelUtility.findElementById(renderContext.getReportDefinition(), target);
    if (newElement != null)
    {
      elementById.removeSubreport(newElement);
    }
    if (oldElement != null)
    {
      elementById.addSubReport(position, oldElement);
    }
  }
View Full Code Here

TOP

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

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.