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

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


      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


      else if (element instanceof DataFactory)
      {
        try
        {
          final AbstractReportDefinition report = activeContext.getReportDefinition();
          final DataFactory dataFactory = ((DataFactory)element);
          performEdit(dataFactory, report.getQuery());
        }
        catch (ReportDataFactoryException e1)
        {
          UncaughtExceptionsModel.getInstance().addException(e1);
View Full Code Here

    {
      return;
    }

    final DataSourcePlugin dataSourcePlugin = metadata.createEditor();
    final DataFactory storedFactory = dataFactory.derive();
    if (dataSourcePlugin.canHandle(dataFactory))
    {
      final ReportDocumentContext activeContext = getActiveContext();
      final AbstractReportDefinition report = activeContext.getReportDefinition();
      final boolean editingActiveQuery = contains(report.getQuery(), dataFactory.getQueryNames());

      final ReportDesignerDesignTimeContext designTimeContext = new ReportDesignerDesignTimeContext(getReportDesignerContext());
      editedDataFactory = dataSourcePlugin.performEdit(designTimeContext, dataFactory, queryName, null);
      if (editedDataFactory == null)
      {
        return;
      }

      final Window parentWindow = designTimeContext.getParentWindow();
      parentWindow.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

      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)
        {
          collection.remove(j);

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

          report.notifyNodeChildRemoved(originalDataFactory);
View Full Code Here

      final int result = JOptionPane.showConfirmDialog(ProvisionDataSourcePanel.this,
          Messages.getString("ParameterDialog.DeleteDataSourceWarningMessage"),
          Messages.getString("ParameterDialog.DeleteDataSourceWarningTitle"), JOptionPane.YES_NO_OPTION);
      if (result == JOptionPane.YES_OPTION)
      {
        final DataFactory theSelectedDataFactory = getSelectedDataSource();

        // Delete data-source from structure panel
        reportDesignerContext.getActiveContext().getSelectionModel().setSelectedElements(new Object[]{theSelectedDataFactory});

        final DeleteAction deleteAction = new DeleteAction();
View Full Code Here

      setEnabled(true);
    }

    public void actionPerformed(final ActionEvent e)
    {
      final DataFactory dataFactory = getSelectedDataSource();
      if (dataFactory == null)
      {
        return;
      }
      final DataFactoryMetaData metadata = dataFactory.getMetaData();
      if (metadata.isEditable() == false)
      {
        return;
      }
View Full Code Here

    {
      return;
    }

    final AbstractReportDefinition report = context.getReportDefinition();
    final DataFactory dataFactory = ModelUtility.findDataFactoryForQuery(report, report.getQuery());
    if (dataFactory == null)
    {
      return;
    }

    final DataFactoryMetaData data = dataFactory.getMetaData();
    if (data.isFormattingMetaDataSource())
    {
      visualElement.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.TRUE);
      visualElement.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.TRUE);
    }
View Full Code Here

      if (editor == null)
      {
        return;
      }

      final DataFactory dataFactory = editor.performEdit(new DataSourceDesignTimeContext(), null, null, null);

      if (dataFactory == null)
      {
        return;
      }
View Full Code Here

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

  }

  public void undo(final ReportDocumentContext renderContext)
  {
    final AbstractReportDefinition abstractReportDefinition = renderContext.getReportDefinition();
    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
View Full Code Here

  }

  public void redo(final ReportDocumentContext renderContext)
  {
    final AbstractReportDefinition abstractReportDefinition = renderContext.getReportDefinition();
    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
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.