• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SpoonFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



SpoonFactory类属于org.pentaho.di.core.gui包,在下文中一共展示了SpoonFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Spoon

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
public Spoon(Display d, Repository rep) {
	this.log = LogWriter.getInstance();
	this.rep = rep;

	if (d != null) {
		display = d;
		destroy = false;
	} else {
		display = new Display();
		destroy = true;
	}

	props = PropsUI.getInstance();

	shell = new Shell(display);
	shell.setText(APPL_TITLE);
	staticSpoon = this;

	JndiUtil.initJNDI();

	SpoonFactory.setSpoonInstance(this);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:Spoon.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, "MappingDialog.ErrorShowingTransformation.Title"),
				BaseMessages.getString(PKG, "MappingDialog.ErrorShowingTransformation.Message"), e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:MappingDialog.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(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


示例8: 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


示例9: getActiveMeta

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
public EngineMetaInterface getActiveMeta() {

    if (tabfolder == null)
      return null;
    
    TabItem tabItem = tabfolder.getSelected();
    if (tabItem == null)
      return null;

    // What transformation is in the active tab?
    // TransLog, TransGraph & TransHist contain the same transformation
    //
    TabMapEntry mapEntry = ((Spoon) SpoonFactory.getInstance()).delegates.tabs.getTab(tabfolder.getSelected());
    EngineMetaInterface meta = null;
    if (mapEntry != null) {
      if (mapEntry.getObject() instanceof TransGraph)
        meta = (mapEntry.getObject()).getMeta();
      if (mapEntry.getObject() instanceof JobGraph)
        meta = (mapEntry.getObject()).getMeta();
    }

    return meta;
    
  }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:25,代码来源:MainSpoonPerspective.java


示例10: 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


示例11: Spoon

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
public Spoon(Display d, Repository rep) {
super(null);  
this.addMenuBar();
   log = new LogChannel(APP_NAME);
   SpoonFactory.setSpoonInstance(this);
   setRepository(rep);
   props = PropsUI.getInstance();
   sharedObjectsFileMap = new Hashtable<String, SharedObjects>();   
   Thread uiThread= Thread.currentThread();
   
   display = Display.findDisplay(uiThread);
   
   staticSpoon = this;
   
   try {
     JndiUtil.initJNDI();
   } catch (Exception e) {
     new ErrorDialog(shell, "Unable to init simple JNDI", "Unable to init simple JNDI", e);
   }

 }
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:22,代码来源:Spoon.java


示例12: openModeler

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
public void openModeler() {
  getDbController();
	this.dbExplorerController.close();
	TableModelerSource source = new TableModelerSource(this.dbExplorerController.getDatabaseMeta(), this.dbExplorerController.getSelectedTable(), this.dbExplorerController.getSelectedSchema());
	try {
		ModelerWorkspace model = new ModelerWorkspace(new SpoonModelerWorkspaceHelper(), SpoonModelerWorkspaceHelper.initGeoContext());
		ModelerWorkspaceUtil.populateModelFromSource(model, source);

		AgileBiModelerPerspective.getInstance().createTabForModel(model, MODELER_NAME);

	} catch (Exception e) {
		e.printStackTrace();
		SpoonFactory.getInstance().messageBox("Could not create a modeler: " + e.getLocalizedMessage(), "Modeler Error", false, Const.ERROR);
	}

}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:17,代码来源:AgileBiDatabaseController.java


示例13: quickVisualize

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
public void quickVisualize() {
  getDbController();
	this.dbExplorerController.close();
	TableModelerSource source = new TableModelerSource(this.dbExplorerController.getDatabaseMeta(), this.dbExplorerController.getSelectedTable(), this.dbExplorerController.getSelectedSchema() == null ? "" : this.dbExplorerController.getSelectedSchema()); //$NON-NLS-1$
	if (source.getSchemaName() == null) {
		source.setSchemaName(""); //$NON-NLS-1$
	}
	try {
		ModelerWorkspace model = new ModelerWorkspace(new SpoonModelerWorkspaceHelper(), SpoonModelerWorkspaceHelper.initGeoContext());
		ModelerWorkspaceUtil.populateModelFromSource(model, source);
		quickVisualize(model, true);
	} catch (Exception e) {
		e.printStackTrace();
		SpoonFactory.getInstance().messageBox("Could not create a modeler: " + e.getLocalizedMessage(), "Modeler Error", false, Const.ERROR);
	}
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:17,代码来源:AgileBiDatabaseController.java


示例14: 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


示例15: 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


示例16: connect

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
protected boolean connect(){
  
  try {
    publisher = new ModelServerPublish();
    publisher.setBiServerConnection(publishModel.getSelectedConnection());
    checkDatasources();
    SolutionObject selectedFolder = null;
    if(publishModel.isGroupBoxFolderVisible()){
      publisher.createSolutionTree(this.publishModel, folderTreeDepth);
      selectedFolder = this.publishModel.getSolutions();
    }
    publishModel.setSelectedFolder(selectedFolder);
  } catch (Exception e) {
    logger.error("Error connecting", e);
    e.printStackTrace();
    SpoonFactory.getInstance().messageBox( BaseMessages.getString(this.getClass(),"Spoon.Perspectives.AgileBi.Publish.CouldNotGetDataSources", e.getLocalizedMessage() ),  //$NON-NLS-1$
    BaseMessages.getString(this.getClass(),"Spoon.Perspectives.AgileBi.Publish.Error"), false, Const.ERROR); //$NON-NLS-1$
    return false;
  }   
  return true;
  

}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:24,代码来源:XulDialogPublish.java


示例17: validateName

import org.pentaho.di.core.gui.SpoonFactory; //导入依赖的package包/类
private static void validateName( String... names ) throws ModelerException{

    for( String name : names ) {

      if ( !EncodingUtil.isValidString( name ) ) {

        SpoonFactory.getInstance().messageBox( BaseMessages.getString( ModelerWorkspace.class,
            "ModelServerPublish.Publish.IllegalName", name, EncodingUtil.getReservedCharStr() ), "Dialog Error", false,
          Const.ERROR
        );
        throw new ModelerException(
          BaseMessages.getString( ModelerWorkspace.class, "ModelServerPublish.Publish.IllegalName",
            name, EncodingUtil.getReservedCharStr() )
        );
      }
    }
  }
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:18,代码来源:PublisherHelper.java


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ByteSource类代码示例发布时间:2022-05-22
下一篇:
Java ApplicationAttemptStateData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap