Package org.pentaho.reporting.designer.core.util.undo

Examples of org.pentaho.reporting.designer.core.util.undo.DataSourceEditUndoEntry


      for (int i = 0; i < dataFactoryWrappers.length; i++)
      {
        final DataFactoryWrapper dataFactoryWrapper = dataFactoryWrappers[i];
        if (dataFactoryWrapper.getOriginalDataFactory() != dataFactoryWrapper.getEditedDataFactory())
        {
          undos.add(new DataSourceEditUndoEntry(i, dataFactoryWrapper.getOriginalDataFactory(), dataFactoryWrapper.getEditedDataFactory()));
        }
      }

      final CompoundUndoEntry undoEntry = new CompoundUndoEntry(undos.toArray(new UndoEntry[undos.size()]));
      undoEntry.redo(activeContext);
View Full Code Here


      final DataFactory df = dataFactory.getReference(i);
      if (df == data)
      {
        dataFactory.remove(i);
        report.notifyNodeChildRemoved(df);
        return new DataSourceEditUndoEntry(i, df, null);
      }
    }
    return null;
  }
View Full Code Here

      {
        collection.remove(j);
        collection.add(dataFactory);

        report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
        return new CompoundUndoEntry(new DataSourceEditUndoEntry(j, dataFactory, null),
                new DataSourceEditUndoEntry(collection.size()-1, null, dataFactory));
      }
    }
    return null;
  }
View Full Code Here

          collection.remove(j);
          collection.add(j + 1, dataFactory);

          report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
          return new CompoundUndoEntry
              (new DataSourceEditUndoEntry(j, dataFactory, null), new DataSourceEditUndoEntry(j + 1, null, dataFactory));
        }
      }
    }
    return null;
  }
View Full Code Here

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

      }
      getSelectionModel().setSelectedElements(selectedElements.toArray());
    }
View Full Code Here

    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

    {
      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

        collection.remove(j);
        collection.add(0, dataFactory);

        report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
        return new CompoundUndoEntry
            (new DataSourceEditUndoEntry(j, dataFactory, null), new DataSourceEditUndoEntry(0, null, dataFactory));
      }
    }
    return null;
  }
View Full Code Here

        collection.remove(j);
        collection.add(j - 1, dataFactory);

        report.fireModelLayoutChanged(report, ReportModelEvent.NODE_STRUCTURE_CHANGED, dataFactory);
        return new CompoundUndoEntry
            (new DataSourceEditUndoEntry(j, dataFactory, null), new DataSourceEditUndoEntry(j - 1, null, dataFactory));
      }
    }
    return null;
  }
View Full Code Here

          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);
          report.notifyNodeChildAdded(editedDataFactory);

          parentWindow.setCursor(Cursor.getDefaultCursor());
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.util.undo.DataSourceEditUndoEntry

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.