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

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



  protected UndoEntry moveDataFactories(final AbstractReportDefinition report, final Object element)
          throws ReportDataFactoryException
  {
    final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
    final int dataFactoryCount = collection.size();
    for (int j = 0; j < dataFactoryCount - 1; j++)
    {
      final DataFactory dataFactory = collection.getReference(j);
      if (element == dataFactory)
      {
        collection.remove(j);
        collection.add(dataFactory);

        report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
        return new CompoundUndoEntry(new DataSourceEditUndoEntry(j, dataFactory, null),
                new DataSourceEditUndoEntry(collection.size()-1, null, dataFactory));
      }
    }
    return null;
  }
View Full Code Here


      {
        final DataFactory dataFactory = reportRenderContext.getMasterReportElement().getDataFactory();
        LocationInfo queryLocation;
        if (dataFactory instanceof CompoundDataFactory)
        {
          final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
          final DataFactory element = cdf.getDataFactoryForQuery(query);
          if (element == null)
          {
            queryLocation = new LocationInfo(dataFactory);
          }
          else
View Full Code Here


  protected UndoEntry moveDataFactories(final AbstractReportDefinition report, final Object element)
      throws ReportDataFactoryException
  {
    final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
    final int dataFactoryCount = collection.size();
    for (int j = 1; j < dataFactoryCount; j++)
    {
      final DataFactory dataFactory = collection.getReference(j);
      if (element == dataFactory)
      {
        collection.remove(j);
        collection.add(0, dataFactory);

        report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
        return new CompoundUndoEntry
            (new DataSourceEditUndoEntry(j, dataFactory, null), new DataSourceEditUndoEntry(0, null, dataFactory));
      }
View Full Code Here

          undos.add(new ParameterEditUndoEntry(index, null, insertParam));
        }
        else if (insertResult instanceof DataFactory)
        {
          final DataFactory insertDataFactory = (DataFactory) insertResult;
          final CompoundDataFactory compoundDataFactory = (CompoundDataFactory) activeContext.getReportDefinition().getDataFactory();
          final int index = compoundDataFactory.size() - 1;
          undos.add(new DataSourceEditUndoEntry(index, null, insertDataFactory));
        }

      }
      getSelectionModel().setSelectedElements(selectedElements);
View Full Code Here

      }
    }

    if (fromClipboard instanceof DataFactory)
    {
      final CompoundDataFactory element = (CompoundDataFactory) report.getDataFactory();
      final DataFactory df = (DataFactory) fromClipboard;
      final DataFactory dataFactory = df.derive();
      element.add(dataFactory);
      report.notifyNodeChildAdded(dataFactory);
      return dataFactory;
    }

    if (fromClipboard instanceof Element == false)
View Full Code Here

    if (data instanceof DataFactory)
    {
      final AbstractReportDefinition report = context.getReportDefinition();
      // should be safe. If not, then the report-open functionality is wrong.
      final CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
      final int count = dataFactory.size();
      for (int i = 0; i < count; i++)
      {
        final DataFactory df = dataFactory.getReference(i);
        if (df == data)
        {
          dataFactory.remove(i);
          report.notifyNodeStructureChanged();
          return new DataSourceEditUndoEntry(i, df, null);
        }
      }
      return null;
View Full Code Here

    if (data instanceof DataFactory)
    {
      final AbstractReportDefinition report = context.getReportDefinition();
      // should be safe. If not, then the report-open functionality is wrong.
      final CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
      final int count = dataFactory.size();
      for (int i = 0; i < count; i++)
      {
        final DataFactory df = dataFactory.getReference(i);
        if (df == data)
        {
          return df.derive();
        }
      }
View Full Code Here

    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
    if (newElement != null)
    {
      cdf.remove(position);
      abstractReportDefinition.notifyNodeChildRemoved(newElement);
    }
    if (oldElement != null)
    {
      try
      {
        cdf.add(position, oldElement);
        abstractReportDefinition.notifyNodeChildAdded(oldElement);
      }
      catch (ReportDataFactoryException e)
      {
        throw new IllegalStateException();
View Full Code Here

    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
    if (oldElement != null)
    {
      cdf.remove(position);
      abstractReportDefinition.notifyNodeChildRemoved(oldElement);
    }
    if (newElement != null)
    {
      try
      {
        cdf.add(position, newElement);
        abstractReportDefinition.notifyNodeChildAdded(newElement);
      }
      catch (ReportDataFactoryException e)
      {
        throw new IllegalStateException();
View Full Code Here

        final ParameterDefinitionEntry entry = entries[i];
        inspectParameter(designerContext, reportRenderContext, resultHandler, columnNames, parameters, entry);
      }
    }

    final CompoundDataFactory dataFactory = CompoundDataFactory.normalize(reportDefinition.getDataFactory());
    final int size = dataFactory.size();
    for (int i = 0; i < size; i++)
    {
      inspectDataSource(designerContext, reportRenderContext, resultHandler, columnNames, dataFactory);
    }
View Full Code Here

TOP

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

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.