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

Examples of org.pentaho.reporting.engine.classic.core.designtime.DefaultDataFactoryChangeRecorder


    if (dataSourcePlugin.canHandle(dataFactory) == false)
    {
      return;
    }

    final DefaultDataFactoryChangeRecorder recorder = new DefaultDataFactoryChangeRecorder();
    final DataFactory editedDataFactory = dataSourcePlugin.performEdit
        (new ReportDesignerDesignTimeContext(getReportDesignerContext()), dataFactory, null, recorder);
    if (editedDataFactory == null)
    {
      return;
    }

    final ReportDocumentContext activeContext = getActiveContext();
    final AbstractReportDefinition report = activeContext.getReportDefinition();
    final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
    final int j = collection.indexOfByReference(dataFactory);
    if (j == -1)
    {
      throw new IllegalStateException("Edited data-source does not exist in the report anymore.");
    }

    DefaultDataFactoryChangeRecorder.applyChanges(collection, recorder.getChanges());

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


    if (editor == null)
    {
      return;
    }

    final DefaultDataFactoryChangeRecorder recorder = new DefaultDataFactoryChangeRecorder();
    final ReportDesignerDesignTimeContext designTimeContext = new ReportDesignerDesignTimeContext(getReportDesignerContext());
    final DataFactory dataFactory = editor.performEdit(designTimeContext, null, null, recorder);
    if (dataFactory == null)
    {
      return;
    }

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

      addDataFactory(activeContext, dataFactory, recorder.getChanges());
    }
    finally
    {
      final ContextAwareDataSchemaModel dataSchemaModel = activeContext.getReportDataSchemaModel();
      if (dataSchemaModel.getDataFactoryException() != null)
View Full Code Here

    if (o.isHidden())
    {
      return;
    }

    final DefaultDataFactoryChangeRecorder changeRecorder = new DefaultDataFactoryChangeRecorder();
    final DataFactory editDataFactory = grabAndRemoveEditDataFactory(o);
    final DataSourcePlugin dataSourcePlugin = o.createEditor();
    final DataFactory generatedDataFactory =
        dataSourcePlugin.performEdit(getDesignTimeContext(), editDataFactory, null, changeRecorder);
    if (generatedDataFactory != null)
    {
      final DataFactoryChange[] changes = changeRecorder.getChanges();
      DefaultDataFactoryChangeRecorder.applyChanges(cdf, changes);

      cdf.add(generatedDataFactory);
      cdf = CompoundDataFactory.normalize(cdf);
      updateDatasourceTree();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.designtime.DefaultDataFactoryChangeRecorder

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.