当前位置: 首页>>代码示例>>Java>>正文


Java Spoon.refreshGraph方法代码示例

本文整理汇总了Java中org.pentaho.di.ui.spoon.Spoon.refreshGraph方法的典型用法代码示例。如果您正苦于以下问题:Java Spoon.refreshGraph方法的具体用法?Java Spoon.refreshGraph怎么用?Java Spoon.refreshGraph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.ui.spoon.Spoon的用法示例。


在下文中一共展示了Spoon.refreshGraph方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: detachUnitTest

import org.pentaho.di.ui.spoon.Spoon; //导入方法依赖的package包/类
public void detachUnitTest() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  try {
    TransGraph transGraph = spoon.getActiveTransGraph();
    if ( transGraph == null ) {
      return;
    }
    TransMeta transMeta = spoon.getActiveTransformation();
    if (transMeta == null ) {
      return;
    }

    transMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME, null );
    transMeta.setChanged();
    
    DataSetConst.clearStepDataSetIndicators( transMeta );
    
    spoon.refreshGraph();
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error detaching unit test", e );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:23,代码来源:DataSetHelper.java

示例2: tweakUnitTestStep

import org.pentaho.di.ui.spoon.Spoon; //导入方法依赖的package包/类
private void tweakUnitTestStep(TransTweak stepTweak, boolean enable) {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  IMetaStore metaStore = spoon.getMetaStore();
  if ( transGraph == null ) {
    return;
  }
  StepMeta stepMeta = transGraph.getCurrentStep();
  TransMeta transMeta = spoon.getActiveTransformation();
  if ( stepMeta == null || transMeta == null ) {
    return;
  }

  try {
    TransUnitTest unitTest = getCurrentUnitTest(transMeta);
    if (unitTest==null) {
      return;
    }
    TransUnitTestTweak unitTestTweak = unitTest.findTweak(stepMeta.getName());
    if (unitTestTweak!=null) {
      unitTest.getTweaks().remove(unitTestTweak);
      stepMeta.setAttribute(DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_TWEAK, null);
    }
    if (enable) {
      unitTest.getTweaks().add(new TransUnitTestTweak(stepTweak, stepMeta.getName()));
      stepMeta.setAttribute(DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_TWEAK, stepTweak.name());
    }
    
    new MetaStoreFactory<TransUnitTest>(TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE)
      .saveElement(unitTest);
    
    spoon.refreshGraph();
    
  } catch(Exception exception) {
    new ErrorDialog( spoon.getShell(), "Error", "Error tweaking transformation unit test on step '"+stepMeta.getName()+"' with operation "+stepTweak.name(), exception );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:38,代码来源:DataSetHelper.java

示例3: refreshSpoon

import org.pentaho.di.ui.spoon.Spoon; //导入方法依赖的package包/类
/**
 * Refreshes Spoons plugin registry, core objects and some UI things.
 * 
 * @throws KettleException
 */
private static void refreshSpoon() throws KettleException {
  PluginRegistry.init();
  Spoon spoon = Spoon.getInstance();
  spoon.refreshCoreObjects();
  spoon.refreshTree();
  spoon.refreshGraph();
  spoon.enableMenus();
  GUIResource.getInstance().reload();
  spoon.selectionFilter.setText(spoon.selectionFilter.getText());
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:16,代码来源:Market.java

示例4: createUnitTest

import org.pentaho.di.ui.spoon.Spoon; //导入方法依赖的package包/类
public void createUnitTest() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  Repository repository = spoon.getRepository();
  try {
    TransGraph transGraph = spoon.getActiveTransGraph();
    IMetaStore metaStore = spoon.getMetaStore();
    if ( transGraph == null ) {
      return;
    }
    TransMeta transMeta = transGraph.getTransMeta();
    
    EnterStringDialog stringDialog = new EnterStringDialog( spoon.getShell(), "", "Enter unit test name", "Unit test name: " );
    String testName = stringDialog.open();
    if (testName==null) {
      return;
    }
    
    MetaStoreFactory<TransUnitTest> testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE);
    if (testFactory.loadElement( testName )!=null) {
      MessageBox box = new MessageBox( spoon.getShell(), SWT.YES | SWT.NO  );
      box.setText( "A test with that name exists" );
      box.setMessage( "A test with that name already exists.  Would you like to use and edit this test in this transformation?" );
      int answer = box.open();
      if ((answer&SWT.YES)!=0) {
        transMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME, testName );
        transGraph.redraw();
      }
      return;
    }
    
    TransUnitTest test = new TransUnitTest();
    test.setName( testName );
    
    if ( repository != null ) {
      test.setTransRepositoryPath( transMeta.getRepositoryDirectory().getPath() + RepositoryDirectory.DIRECTORY_SEPARATOR + transMeta.getName() );
      if ( repository.getRepositoryMeta().getRepositoryCapabilities().supportsReferences() ) {
        test.setTransObjectId( transMeta.getObjectId().toString() );
      } else {
        test.setTransRepositoryPath( transMeta.getRepositoryDirectory().getPath() + "/" + transMeta.getName() );
      }
    } else {
      test.setTransFilename( transMeta.getFilename() );
    }

    testFactory.saveElement( test );
    transMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME, testName );
    
    // Don't carry on old indicators...
    //
    DataSetConst.clearStepDataSetIndicators( transMeta );
    
    spoon.refreshGraph();
    
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error creating a new transformation unit test", e );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:58,代码来源:DataSetHelper.java


注:本文中的org.pentaho.di.ui.spoon.Spoon.refreshGraph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。