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

Examples of org.pentaho.reporting.engine.classic.core.AbstractReportDefinition$ResourceBundleChangeHandler


    {
      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));

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


    this.id = id;
  }

  public void undo(final ReportDocumentContext context)
  {
    final AbstractReportDefinition abstractReportDefinition = context.getReportDefinition();
    final Band band = (Band) ModelUtility.findElementById(abstractReportDefinition, id);
    final LinealModel linealModel = ModelUtility.getVerticalLinealModel(band);
    linealModel.updateGuideLine(index, oldGuideLine);
  }
View Full Code Here

    linealModel.updateGuideLine(index, oldGuideLine);
  }

  public void redo(final ReportDocumentContext context)
  {
    final AbstractReportDefinition abstractReportDefinition = context.getReportDefinition();
    final Band band = (Band) ModelUtility.findElementById(abstractReportDefinition, id);
    final LinealModel linealModel = ModelUtility.getVerticalLinealModel(band);
    linealModel.updateGuideLine(index, guideLine);
  }
View Full Code Here

    if (dataFactory == null)
    {
      throw new NullPointerException();
    }

    final AbstractReportDefinition report = activeContext.getReportDefinition();
    final DataFactory originalDataFactory = report.getDataFactory();
    if (originalDataFactory == null)
    {
      throw new IllegalStateException("A report in design-mode should have its data-factory normalized.");
    }

    final String queryAttribute = (String) report.getAttribute(AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.QUERY);
    if (StringUtils.isEmpty(queryAttribute) && dataFactory.getQueryNames().length > 0)
    {
      final String queryName = dataFactory.getQueryNames()[0];
      report.setAttribute(AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.QUERY, queryName);
      activeContext.getUndo().addChange(ActionMessages.getString("AddDataFactoryAction.SetQuery.UndoText"),
          new AttributeEditUndoEntry(report.getObjectID(),
              AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.QUERY,
              queryAttribute, queryName));
    }


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

    initialize();

    final ReportDocumentContext activeContext = reportDesignerContext.getActiveContext();
    selectionModel = getSelectionModel();

    final AbstractReportDefinition reportDefinition = activeContext.getReportDefinition();
    if (reportDefinition instanceof CrosstabElement)
    {
      final CrosstabElement crosstabElement = (CrosstabElement)reportDefinition;
      final Group group = crosstabElement.getRootGroup();
      if (group instanceof CrosstabGroup)
View Full Code Here

    this.newElement = newElement;
  }

  public void undo(final ReportDocumentContext renderContext)
  {
    final AbstractReportDefinition abstractReportDefinition = renderContext.getReportDefinition();
    if (abstractReportDefinition instanceof MasterReport == false)
    {
      return;
    }
    final MasterReport report = (MasterReport) abstractReportDefinition;
View Full Code Here

    }
  }

  public void redo(final ReportDocumentContext renderContext)
  {
    final AbstractReportDefinition abstractReportDefinition = renderContext.getReportDefinition();
    if (abstractReportDefinition instanceof MasterReport == false)
    {
      return;
    }
    final MasterReport report = (MasterReport) abstractReportDefinition;
View Full Code Here

        parent.addElement(subReport);
      }

      final ReportDesignerContext designerContext = dragContext.getDesignerContext();
      final Window window = LibSwingUtil.getWindowAncestor(designerContext.getView().getParent());
      final AbstractReportDefinition reportDefinition = designerContext.getActiveContext().getReportDefinition();

      try
      {
        // Create the new subreport tab and update the active context to point to new subreport.
        subReport.setDataFactory(reportDefinition.getDataFactory());

        final int idx = designerContext.addSubReport(designerContext.getActiveContext(), subReport);
        designerContext.setActiveDocument(designerContext.getReportRenderContext(idx));
      }
      catch (ReportDataFactoryException e)
View Full Code Here

    final LoadReportTask target = new LoadReportTask(selectedFile);
    final Thread loadThread = new Thread(target);
    loadThread.setDaemon(true);
    BackgroundCancellableProcessHelper.executeProcessWithCancelDialog
        (loadThread, null, context.getView().getParent(), ActionMessages.getString("OpenReportAction.LoadReportMessage"));
    final AbstractReportDefinition report = target.getReport();
    if (report instanceof MasterReport)
    {
      try
      {
        context.addMasterReport((MasterReport) report);
View Full Code Here

    {
      return null;
    }


    final AbstractReportDefinition reportDefinition = getActiveContext().getReportDefinition();
    final GroupDataEntry[] entries = EditGroupsUndoEntry.buildGroupData(reportDefinition);
    final ArrayList<GroupDataEntry> list = new ArrayList<GroupDataEntry>(entries.length);
    int index = -1;
    for (int i = 0; i < entries.length; i++)
    {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.AbstractReportDefinition$ResourceBundleChangeHandler

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.