Package org.pentaho.reporting.designer.core.editor

Examples of org.pentaho.reporting.designer.core.editor.ReportDocumentContext


  /**
   * Invoked when an action occurs.
   */
  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }

View Full Code Here


  public void actionPerformed(final ActionEvent e)
  {
    final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext();
    if (tabIndex == -1)
    {
      final ReportDocumentContext activeContext = getActiveContext();
      if (activeContext == null)
      {
        return;
      }
View Full Code Here

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

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

  /**
   * Invoked when an action occurs.
   */
  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }

    final DataSourcePlugin editor = dataSourcePlugin.createEditor();
    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)
      {
        UncaughtExceptionsModel.getInstance().addException(dataSchemaModel.getDataFactoryException());
      }

View Full Code Here

  private DocumentContextSelectionModel getSelectionModel()
  {
    if (selectionModel == null)
    {
      final ReportDesignerContext reportDesignerContext = getReportDesignerContext();
      final ReportDocumentContext activeContext = reportDesignerContext.getActiveContext();
      selectionModel = activeContext.getSelectionModel();
    }

    return selectionModel;
  }
View Full Code Here

    }

    // Clear lists just in case something changed.
    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

          return;
        }

        if (result == 0)
        {
          final ReportDocumentContext context = dragContext.getRenderContext();
          final UndoManager undo = context.getUndo();
          undo.addChange(Messages.getString("SubreportReportElementDragHandler.UndoEntry"),
              new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
          parent.addElement(subReport);
        }
        else
        {
          final AbstractRootLevelBand arb = (AbstractRootLevelBand) parent;

          final ReportDocumentContext context = dragContext.getRenderContext();
          final UndoManager undo = context.getUndo();
          undo.addChange(Messages.getString("SubreportReportElementDragHandler.UndoEntry"),
              new BandedSubreportEditUndoEntry(parent.getObjectID(), arb.getSubReportCount(), null, subReport));
          arb.addSubReport(subReport);
        }
      }
      else
      {
        final ReportDocumentContext context = dragContext.getRenderContext();
        final UndoManager undo = context.getUndo();
        undo.addChange(Messages.getString("SubreportReportElementDragHandler.UndoEntry"),
            new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
        parent.addElement(subReport);
      }
View Full Code Here

    return parentReportContext.getReportDataSchemaModel().getColumnNames();
  }

  private ReportDocumentContext findParentContext(final ReportDesignerContext context)
  {
    final ReportDocumentContext activeContext = context.getActiveContext();
    final Section parentSection = activeContext.getReportDefinition().getParentSection();
    if (parentSection == null)
    {
      return null;
    }
    final ReportDefinition parentReport = parentSection.getReportDefinition();
View Full Code Here

  /**
   * Invoked when an action occurs.
   */
  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }

View Full Code Here

    if (selectionModel1 == null)
    {
      return;
    }

    final ReportDocumentContext activeContext = getActiveContext();
    final Object[] selectedElements = selectionModel1.getSelectedElements();
    if (selectedElements.length == 0)
    {
      return;
    }

    final ArrayList<Object> preparedElements = new ArrayList<Object>(selectedElements.length);
    final ArrayList<UndoEntry> undoEntries = new ArrayList<UndoEntry>(selectedElements.length);
    try
    {
      for (int i = 0; i < selectedElements.length; i++)
      {
        final Object selectedElement = selectedElements[i];
        final Object preparedElement = InsertationUtil.prepareForCopy(activeContext, selectedElement);
        if (preparedElement == null)
        {
          continue;
        }

        final UndoEntry undoEntry = InsertationUtil.delete(activeContext, selectedElement);
        if (undoEntry != null)
        {
          preparedElements.add(preparedElement);
          undoEntries.add(undoEntry);
        }
      }

      ClipboardManager.getManager().setContents(preparedElements.toArray());
    }
    finally
    {
      activeContext.getUndo().addChange(ActionMessages.getString("CutAction.Text"),
          new CompoundUndoEntry((UndoEntry[]) undoEntries.toArray(new UndoEntry[undoEntries.size()])));
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.editor.ReportDocumentContext

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.