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; j++)
    {
      final DataFactory dataFactory = collection.getReference(j);
      if (element == dataFactory)
      {
        if (collection.size() > j + 1)
        {
          collection.remove(j);
          collection.add(j + 1, dataFactory);

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


      if (getModel() != treeModel)
      {
        return;
      }

      final CompoundDataFactory compoundDataFactory = treeModel.getDataFactoryElement();
      final int size = compoundDataFactory.size();
      for (int i = 0; i < size; i++)
      {
        final DataFactory df = compoundDataFactory.getReference(i);
        final TreePath path = TreeSelectionHelper.getPathForNode(treeModel, df);
        if (path == null)
        {
          return;
        }
View Full Code Here

      }
    }
    else if (parent instanceof ParentDataFactoryNode)
    {
      final ParentDataFactoryNode pdfn = (ParentDataFactoryNode) parent;
      final CompoundDataFactory compoundDataFactory = pdfn.getDataFactory();
      if (index == compoundDataFactory.size())
      {
        if (pdfn.isSubReport())
        {
          return pdfn.getParentNode();
        }
        throw new IndexOutOfBoundsException();
      }
      return new InheritedDataFactoryWrapper(compoundDataFactory.getReference(index));
    }
    else if (parent instanceof InheritedDataFactoryWrapper)
    {
      final InheritedDataFactoryWrapper idf = (InheritedDataFactoryWrapper) parent;
      final DataFactory dataFactory = idf.getDataFactory();
View Full Code Here

      return reportElement.getExportMappings().length;
    }
    if (parent instanceof ParentDataFactoryNode)
    {
      final ParentDataFactoryNode pdfn = (ParentDataFactoryNode) parent;
      final CompoundDataFactory compoundDataFactory = pdfn.getDataFactory();
      if (pdfn.isSubReport())
      {
        return compoundDataFactory.size() + 1;
      }
      return compoundDataFactory.size();
    }
    if (parent instanceof InheritedDataFactoryWrapper)
    {
      final InheritedDataFactoryWrapper idf = (InheritedDataFactoryWrapper) parent;
      return idf.getDataFactory().getQueryNames().length;
View Full Code Here

      return -1;
    }
    if (parent instanceof ParentDataFactoryNode)
    {
      final ParentDataFactoryNode pdfn = (ParentDataFactoryNode) parent;
      final CompoundDataFactory compoundDataFactory = pdfn.getDataFactory();
      if (child instanceof ParentDataFactoryNode)
      {
        return compoundDataFactory.size();
      }
      if (child instanceof InheritedDataFactoryWrapper == false)
      {
        return -1;
      }

      final InheritedDataFactoryWrapper wrapper = (InheritedDataFactoryWrapper) child;
      final CompoundDataFactory dataFactoryElement = getDataFactoryElement();
      for (int i = 0; i < dataFactoryElement.size(); i++)
      {
        final DataFactory dataFactory = dataFactoryElement.getReference(i);
        if (dataFactory == wrapper.getDataFactory())
        {
          return i;
        }
      }
View Full Code Here

        return;
      }


      final AbstractReportDefinition report = getActiveContext().getReportDefinition();
      final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
      final int dataFactoryCount = collection.size();
      for (int j = 0; j < dataFactoryCount; j++)
      {
        final DataFactory originalDataFactory = collection.getReference(j);
        if (originalDataFactory == dataFactory)
        {
          try
          {
            collection.remove(j);

            final DataFactory editedClone = editedDataFactory.derive();
            collection.add(j, editedDataFactory);
            activeContext.getUndo().addChange
                (ActionMessages.getString("EditDataSourceAction.UndoName"), new DataSourceEditUndoEntry(j, storedFactory, editedClone));

            report.notifyNodeChildRemoved(originalDataFactory);
            report.notifyNodeChildAdded(editedDataFactory);
View Full Code Here

      {
        element.setDataFactory(CompoundDataFactory.normalize(dataFactory));
      }
      else
      {
        final CompoundDataFactory reportDf = CompoundDataFactory.normalize(originalDataFactory);
        final int position = reportDf.size();
        reportDf.add(dataFactory);
        activeContext.getUndo().addChange(ActionMessages.getString("AddDataFactoryAction.UndoText"),
            new DataSourceEditUndoEntry(position, null, dataFactory.derive()));
        element.setDataFactory(reportDf);
      }
    }
View Full Code Here

    AbstractReportDefinition definition = reportContext.getReportDefinition();
    final LinkedHashSet<String> names = new LinkedHashSet<String>();
    while (definition != null)
    {
      final CompoundDataFactory dataFactoryElement = (CompoundDataFactory) definition.getDataFactory();
      final int dataFactoryCount = dataFactoryElement.size();
      for (int i = 0; i < dataFactoryCount; i++)
      {
        final DataFactory dataFactory = dataFactoryElement.getReference(i);
        final String[] queryNames = dataFactory.getQueryNames();
        names.addAll(Arrays.asList(queryNames));
      }
      if (definition instanceof SubReport)
      {
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(j - 1, dataFactory);

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

  public void actionPerformed(final ActionEvent e)
  {
    try
    {
      final MasterReport report = new MasterReport();
      report.setDataFactory(new CompoundDataFactory());
      report.setQuery(null);
      report.getRootGroup().getHeader().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);
      report.getRootGroup().getFooter().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);
      report.getDetailsFooter().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);
      report.getDetailsHeader().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);
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.