Java Code Examples for org.pentaho.di.ui.spoon.trans.TransGraph#redraw()

The following examples show how to use org.pentaho.di.ui.spoon.trans.TransGraph#redraw() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeamHelper.java    From kettle-beam with Apache License 2.0 5 votes vote down vote up
private void setCurrentStepBeamFlag(String key, String value) {
  TransGraph transGraph = spoon.getActiveTransGraph();
  if (transGraph==null) {
    return;
  }
  StepMeta stepMeta = transGraph.getCurrentStep();
  if (stepMeta==null) {
    return;
  }
  stepMeta.setAttribute(BeamConst.STRING_KETTLE_BEAM, key, value);
  transGraph.redraw();
}
 
Example 2
Source File: DataSetHelper.java    From pentaho-pdi-dataset with Apache License 2.0 5 votes vote down vote up
public void clearInputDataSet() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  TransMeta transMeta = spoon.getActiveTransformation();
  StepMeta stepMeta = transGraph.getCurrentStep();
  if ( transGraph == null || transMeta == null || stepMeta == null ) {
    return;
  }
  if ( checkTestPresent( spoon, transMeta ) ) {
    return;
  }

  try {
    TransUnitTest currentUnitTest = getCurrentUnitTest( transMeta );

    TransUnitTestSetLocation inputLocation = currentUnitTest.findInputLocation( stepMeta.getName() );
    if ( inputLocation != null ) {
      currentUnitTest.getInputDataSets().remove( inputLocation );
    }

    saveUnitTest( getHierarchy().getTestFactory(), currentUnitTest, transMeta );

    transGraph.redraw();
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error saving unit test", e );
  }
}
 
Example 3
Source File: DataSetHelper.java    From pentaho-pdi-dataset with Apache License 2.0 5 votes vote down vote up
public void clearGoldenDataSet() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  TransMeta transMeta = spoon.getActiveTransformation();
  StepMeta stepMeta = transGraph.getCurrentStep();
  if ( transGraph == null || transMeta == null || stepMeta == null ) {
    return;
  }
  if ( checkTestPresent( spoon, transMeta ) ) {
    return;
  }

  try {
    TransUnitTest currentUnitTest = getCurrentUnitTest( transMeta );

    TransUnitTestSetLocation goldenLocation = currentUnitTest.findGoldenLocation( stepMeta.getName() );
    if ( goldenLocation != null ) {
      currentUnitTest.getGoldenDataSets().remove( goldenLocation );
    }

    saveUnitTest( getHierarchy().getTestFactory(), currentUnitTest, transMeta );
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error saving unit test", e );
  }
  transMeta.setChanged();
  transGraph.redraw();
}