本文整理汇总了Java中org.pentaho.di.core.gui.SpoonFactory类的典型用法代码示例。如果您正苦于以下问题:Java SpoonFactory类的具体用法?Java SpoonFactory怎么用?Java SpoonFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpoonFactory类属于org.pentaho.di.core.gui包,在下文中一共展示了SpoonFactory类的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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}