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


Java SpoonFactory.getInstance方法代码示例

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


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

示例1: removeDataSetGroup

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void removeDataSetGroup() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    
    try {

      List<String> groupNames = groupFactory.getElementNames();
      Collections.sort( groupNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
      String groupName = esd.open();
      if ( groupName != null ) {
        
        // TODO: Find the unit tests for this group, if there are any, we can't remove the group
        //
        groupFactory.deleteElement(groupName);
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups or deleting a group", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:24,代码来源:DataSetHelper.java

示例2: addDataSet

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void addDataSet() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();

    try {
      MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
      List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
      groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
      List<DataSetGroup> groups = groupFactory.getElements();

      MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
      setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

      DataSet dataSet = new DataSet();

      editDataSet( spoon, dataSet, groups, setFactory, null );

    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:24,代码来源:DataSetHelper.java

示例3: detachUnitTest

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的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

示例4: editTrans

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
private void editTrans()
{
	// Load the transformation again to make sure it's still there and
	// refreshed
	// It's an extra check to make sure it's still OK...

	try
	{
		loadTransformation();

		// If we're still here, mappingTransMeta is valid.
		SpoonInterface spoon = SpoonFactory.getInstance();
		if (spoon != null)
		{
			spoon.addTransGraph(mappingTransMeta);
		}

	} catch (KettleException e)
	{
		new ErrorDialog(shell, Messages.getString("MappingDialog.ErrorShowingTransformation.Title"),
				Messages.getString("MappingDialog.ErrorShowingTransformation.Message"), e);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:MappingDialog.java

示例5: editTrans

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
private void editTrans()
{
	// Load the transformation again to make sure it's still there and
	// refreshed
	// It's an extra check to make sure it's still OK...
  //
	try
	{
		loadTransformation();

		// If we're still here, mappingTransMeta is valid.
		//
		SpoonInterface spoon = SpoonFactory.getInstance();
		if (spoon != null) {
			spoon.addTransGraph(mappingTransMeta);
		}
	} catch (KettleException e)
	{
		new ErrorDialog(shell, BaseMessages.getString(PKG, "MappingDialog.ErrorShowingTransformation.Title"),
				BaseMessages.getString(PKG, "MappingDialog.ErrorShowingTransformation.Message"), e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:MappingDialog.java

示例6: editTrans

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
private void editTrans()
{
	// Load the transformation again to make sure it's still there and
	// refreshed
	// It's an extra check to make sure it's still OK...
  //
	try
	{
		loadTransformation();

		// If we're still here, mappingTransMeta is valid.
		//
		SpoonInterface spoon = SpoonFactory.getInstance();
		if (spoon != null) {
			spoon.addTransGraph(mappingTransMeta);
		}
	} catch (KettleException e)
	{
		new ErrorDialog(shell, BaseMessages.getString(PKG, "SingleThreaderDialog.ErrorShowingTransformation.Title"),
				BaseMessages.getString(PKG, "SingleThreaderDialog.ErrorShowingTransformation.Message"), e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:SingleThreaderDialog.java

示例7: editTrans

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
private void editTrans() {
  // Load the transformation again to make sure it's still there and
  // refreshed
  // It's an extra check to make sure it's still OK...
  //
  try {
    loadTransformation();

    // If we're still here, mappingTransMeta is valid.
    //
    SpoonInterface spoon = SpoonFactory.getInstance();
    if (spoon != null) {
      spoon.addTransGraph(injectTransMeta);
    }
  } catch (KettleException e) {
    new ErrorDialog(shell, BaseMessages.getString(PKG, "MetaInjectDialog.ErrorShowingTransformation.Title"), BaseMessages.getString(PKG, "MetaInjectDialog.ErrorShowingTransformation.Message"), e);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:MetaInjectDialog.java

示例8: editJob

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
private void editJob()
{
	// Load the transformation again to make sure it's still there and
	// refreshed
	// It's an extra check to make sure it's still OK...
  //
	try
	{
		loadJob();

		// If we're still here, jobExecutorMeta is valid.
		//
		SpoonInterface spoon = SpoonFactory.getInstance();
		if (spoon != null) {
			spoon.addJobGraph(executorJobMeta);
		}
	} catch (KettleException e)
	{
		new ErrorDialog(shell, BaseMessages.getString(PKG, "JobExecutorDialog.ErrorShowingJob.Title"),
				BaseMessages.getString(PKG, "JobExecutorDialog.ErrorShowingJob.Message"), e);
	}
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:23,代码来源:JobExecutorDialog.java

示例9: quickVisualizeTable

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void quickVisualizeTable() {
  Spoon spoon = ((Spoon)SpoonFactory.getInstance());
  if( spoon.getSelectionObject() instanceof DatabaseMeta ) {
    final DatabaseMeta databaseMeta = (DatabaseMeta) spoon.getSelectionObject();
    
    DatabaseExplorerDialog std = new DatabaseExplorerDialog(spoon.getShell(), SWT.NONE, databaseMeta, new ArrayList<DatabaseMeta>());
    if (std.open()) {
        
      TableModelerSource source = new TableModelerSource( databaseMeta, std.getTableName(), std.getSchemaName() == null ? "" : std.getSchemaName() ); //$NON-NLS-1$
      if( source.getSchemaName() == null ) {
        source.setSchemaName(""); //$NON-NLS-1$
      }

      try{
        ModelerWorkspace model = createModelerWorkspace();
        ModelerWorkspaceUtil.populateModelFromSource(model, source);
        quickVisualize( model );
      } catch(Exception e){
        logger.error("Error opening visualization", e);
        new ErrorDialog(((Spoon) SpoonFactory.getInstance()).getShell(), "Error", "Error executing Quick Visualize", e);
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:25,代码来源:ModelerHelper.java

示例10: databaseModelItem

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void databaseModelItem() {
  Spoon spoon = ((Spoon)SpoonFactory.getInstance());
  if( spoon.getSelectionObject() instanceof DatabaseMeta ) {
    final DatabaseMeta databaseMeta = (DatabaseMeta) spoon.getSelectionObject();
    
    DatabaseExplorerDialog std = new DatabaseExplorerDialog(spoon.getShell(), SWT.NONE, databaseMeta, new ArrayList<DatabaseMeta>());
    if (std.open()) {
        
      TableModelerSource source = new TableModelerSource( databaseMeta, std.getTableName(), std.getSchemaName());
      try{
        ModelerWorkspace model = createModelerWorkspace();
        ModelerWorkspaceUtil.populateModelFromSource(model, source);
        AgileBiModelerPerspective.getInstance().createTabForModel(model, getUniqueUntitledTabName(spoon, MODELER_NAME));
      } catch(Exception e){
        logger.error("Error creating model", e);
        new ErrorDialog(((Spoon) SpoonFactory.getInstance()).getShell(), "Error", "Error creating Modeler", e);
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:21,代码来源:ModelerHelper.java

示例11: getInstance

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public static DataSetHelper getInstance() {
  if ( instance == null ) {
    instance = new DataSetHelper();
    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
    spoon.addSpoonMenuController( instance );
  }
  return instance;
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:9,代码来源:DataSetHelper.java

示例12: editDataSetGroup

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void editDataSetGroup() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    try {

      List<String> groupNames = groupFactory.getElementNames();
      Collections.sort( groupNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
      String groupName = esd.open();
      if ( groupName != null ) {
        List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
        groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
        DataSetGroup dataSetGroup = groupFactory.loadElement( groupName );

        DataSetGroupDialog groupDialog = new DataSetGroupDialog( spoon.getShell(), dataSetGroup, databases );
        while ( groupDialog.open() ) {
          String message = validateDataSetGroup( dataSetGroup, groupName, groupFactory.getElementNames() );

          // Save the group ...
          //
          if ( message == null ) {
            groupFactory.saveElement( dataSetGroup );
            break;
          } else {
            MessageBox box = new MessageBox( spoon.getShell(), SWT.OK );
            box.setText( "Error" );
            box.setMessage( message );
            box.open();
          }
        }
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:39,代码来源:DataSetHelper.java

示例13: addDataSetGroup

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void addDataSetGroup() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );

    try {

      DataSetGroup dataSetGroup = new DataSetGroup();
      List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );

      DataSetGroupDialog groupDialog = new DataSetGroupDialog( spoon.getShell(), dataSetGroup, databases );
      while ( groupDialog.open() ) {
        // Verify empty name, existing name...
        //
        String message = validateDataSetGroup( dataSetGroup, null, groupFactory.getElementNames() );

        // Save the group again...
        //
        if ( message == null ) {
          groupFactory.saveElement( dataSetGroup );
          break;
        } else {
          MessageBox box = new MessageBox( spoon.getShell(), SWT.OK );
          box.setText( "Error" );
          box.setMessage( message );
          box.open();
        }
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set group", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:35,代码来源:DataSetHelper.java

示例14: editDataSet

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
public void editDataSet() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
    IMetaStore metaStore = spoon.getMetaStore();

    try {
      MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
      List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
      groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
      List<DataSetGroup> groups = groupFactory.getElements();

      MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
      setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

      List<String> setNames = setFactory.getElementNames();
      Collections.sort( setNames );
      EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), setNames.toArray( new String[setNames.size()] ), "Select the set", "Select the data set to edit..." );
      String setName = esd.open();
      if ( setName != null ) {
        DataSet dataSet = setFactory.loadElement( setName );

        editDataSet( spoon, dataSet, groups, setFactory, setName );
      }
    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups", e );
    }
  }
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:28,代码来源:DataSetHelper.java

示例15: clearInputDataSet

import org.pentaho.di.core.gui.SpoonFactory; //导入方法依赖的package包/类
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;
  }

  stepMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_DATASET_INPUT, null );
  transGraph.redraw();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:13,代码来源:DataSetHelper.java


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