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

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


    // 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.notifyNodeChildRemoved(df);
        return new DataSourceEditUndoEntry(i, df, null);
View Full Code Here


      // 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();
        }
      }
      return null;
    }
View Full Code Here

    {
      return getExpressions().getExpression(index);
    }
    if (parent instanceof DataFactory)
    {
      final DataFactory dataFactory = (DataFactory) parent;
      final String[] queryNames = dataFactory.getQueryNames();
      return new ReportQueryNode(dataFactory, queryNames[index], true);
    }
    if (parent instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) parent;
      if (isSelectedDataSource(queryNode))
      {
        final String[] names = getDataFactoryColumns();
        final String name = names[index];
        final ContextAwareDataSchemaModel model = context.getReportDataSchemaModel();
        final DataAttributes attributes = model.getDataSchema().getAttributes(name);
        final Class type = (Class) attributes.getMetaAttribute
            (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.TYPE, Class.class, model.getDataAttributeContext());
        final DataFactory dataFactory = queryNode.getDataFactory();
        return new ReportFieldNode(context, dataFactory, name, type);
      }

      throw new IndexOutOfBoundsException();
    }
View Full Code Here

      return getExpressions().size();
    }
    if (parent instanceof DataFactory)
    {
      // a DataFactory is a leaf if it has no columns defined
      final DataFactory df = (DataFactory) parent;
      return df.getQueryNames().length;
    }
    if (parent instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) parent;
      if (isSelectedDataSource(queryNode))
View Full Code Here

      return false;
    }

    if (node instanceof DataFactory)
    {
      final DataFactory dataFactory = (DataFactory) node;
      return dataFactory.getQueryNames().length == 0;
    }

    if (node instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) node;
View Full Code Here

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

      return new TreePath(new Object[]{getRoot(), functions, node});
    }

    if (node instanceof DataFactory)
    {
      final DataFactory dataFactoryElement = getDataFactoryElement();
      if (getIndexOfChild(dataFactoryElement, node) < 0)
      {
        return null;
      }
      return new TreePath(new Object[]{getRoot(), dataFactoryElement, node});
View Full Code Here

  {
    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);
View Full Code Here

      if (selectedObject instanceof ReportQueryNode == false)
      {
        continue;
      }
      final ReportQueryNode queryNode = (ReportQueryNode) selectedObject;
      final DataFactory dataFactory = queryNode.getDataFactory();
      final DataFactoryMetaData metadata = dataFactory.getMetaData();
      if (metadata.isEditable())
      {
        setEnabled(true);
        return;
      }
View Full Code Here

          final int index = definition.getParameterCount() - 1;
          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));
        }
View Full Code Here

TOP

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

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.