@Override public void addTransGraph( TransMeta transMeta ) { delegates.trans.addTransGraph( transMeta ); }
public TransMeta[] getLoadedTransformations() { if ( delegates != null && delegates.trans != null ) { List<TransMeta> list = delegates.trans.getTransformationList(); return list.toArray( new TransMeta[list.size()] ); } else { return null; } }
private synchronized void synchronizeTransformations( boolean includeActive, Consumer<TransMeta> synchronizeAction ) { TransMeta current = spoon.getActiveTransformation(); for ( TransMeta trans : spoonDelegates.trans.getLoadedTransformations() ) { if ( includeActive || trans != current ) { synchronizeAction.accept( trans ); } } }
/** * @param transMeta * the transformation to close, make sure it's ok to dispose of it BEFORE you call this. */ public synchronized void closeTransformation( TransMeta transMeta ) { // Close the associated tabs... // TabMapEntry entry = getSpoon().delegates.tabs.findTabMapEntry( transMeta ); if ( entry != null ) { getSpoon().delegates.tabs.removeTab( entry ); } // Also remove it from the item from the transformationMap // Otherwise it keeps showing up in the objects tree // Look for the transformation, not the key (name might have changed) // int index = getTransformationList().indexOf( transMeta ); while ( index >= 0 ) { getTransformationList().remove( index ); index = getTransformationList().indexOf( transMeta ); } getSpoon().refreshTree(); getSpoon().enableMenus(); }
public void addTransGraph( TransMeta transMeta ) { boolean added = addTransformation( transMeta ); if ( added ) { transGraph = new TransGraph( spoon.tabfolder.getSwtTabset(), spoon, transMeta ); PropsUI props = PropsUI.getInstance(); if ( tabName.length() >= getMaxTabLength() ) { tabName = new StringBuilder().append( tabName.substring( 0, getMaxTabLength() ) ).append( "\u2026" ).toString(); TransLogTable logTable = transMeta.getTransLogTable(); if ( isLogTableDefined( logTable ) && !transMeta.isSlaveTransformation() ) { addTabsToTransGraph( transGraph );
public void update( Spoon spoon ) { SpoonJobDelegate origJobs = jobs; try { jobs = (SpoonJobDelegate) SpoonDelegateRegistry.getInstance().constructSpoonJobDelegate( spoon ); } catch ( InstanceCreationException e ) { jobs = new SpoonJobDelegate( spoon ); } if ( origJobs != null ) { // preserve open jobs for ( JobMeta jobMeta : origJobs.getLoadedJobs() ) { jobs.addJob( jobMeta ); } } SpoonTransformationDelegate origTrans = trans; try { trans = (SpoonTransformationDelegate) SpoonDelegateRegistry.getInstance().constructSpoonTransDelegate( spoon ); } catch ( InstanceCreationException e ) { trans = new SpoonTransformationDelegate( spoon ); } if ( origTrans != null ) { // preseve open trans for ( TransMeta transMeta : origTrans.getLoadedTransformations() ) { trans.addTransformation( transMeta ); } } } }
String transName = name; int nr = 1; if ( spoon.delegates.trans.getTransformation( transName ) != null ) { nr++; transName = name + " " + nr; spoon.delegates.trans.addTransGraph( meta );
/** * Check the steps in a transformation * * @param only_selected * True: Check only the selected steps... */ public void checkTrans( TransMeta transMeta, boolean only_selected ) { if ( transMeta == null ) { return; } TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( transMeta ); if ( transGraph == null ) { return; } CheckTransProgressDialog ctpd = new CheckTransProgressDialog( shell, transMeta, transGraph.getRemarks(), only_selected ); ctpd.open(); // manages the remarks arraylist... showLastTransCheck(); }
delegates.trans.redoTransformationAction( (TransMeta) undoInterface, ta ); if ( ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP ) { if ( ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP ) { ta = undoInterface.nextUndo(); delegates.trans.redoTransformationAction( (TransMeta) undoInterface, ta ); TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( (TransMeta) undoInterface ); transGraph.forceFocus();
delegates.trans.undoTransformationAction( (TransMeta) undoInterface, ta ); if ( ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP ) { if ( ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP ) { ta = undoInterface.previousUndo(); delegates.trans.undoTransformationAction( (TransMeta) undoInterface, ta ); TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( (TransMeta) undoInterface ); transGraph.forceFocus();
if ( itemInterface instanceof TransGraph ) { TransMeta transMeta = (TransMeta) managedObject; spoon.delegates.trans.closeTransformation( transMeta ); spoon.refreshTree();
delegates.trans.addTransformation( ti );
public void analyseImpact( TransMeta transMeta ) { if ( transMeta == null ) { return; } TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( transMeta ); if ( transGraph == null ) { return; } AnalyseImpactProgressDialog aipd = new AnalyseImpactProgressDialog( shell, transMeta, transGraph.getImpact() ); transGraph.setImpactFinished( aipd.open() ); if ( transGraph.isImpactFinished() ) { showLastImpactAnalyses( transMeta ); } }
/** * Add a transformation to the * * @param transMeta * the transformation to add to the map * @return true if the transformation was added, false if it couldn't be added (already loaded) **/ public boolean addTransformation( TransMeta transMeta ) { int index = getTransformationList().indexOf( transMeta ); if ( index < 0 ) { getTransformationList().add( transMeta ); return true; } else { /* * ShowMessageDialog dialog = new ShowMessageDialog(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION, * BaseMessages.getString(PKG, "Spoon.Dialog.TransAlreadyLoaded.Title"), "'" + transMeta.toString() + "'" + * Const.CR + Const.CR + BaseMessages.getString(PKG, "Spoon.Dialog.TransAlreadyLoaded.Message")); * dialog.setTimeOut(6); dialog.open(); */ return false; } }
@Override public void addTransGraph( TransMeta transMeta ) { super.addTransGraph( transMeta ); TabMapEntry tabEntry = spoon.delegates.tabs.findTabMapEntry( transMeta ); if ( tabEntry != null ) { TabItem tabItem = tabEntry.getTabItem(); try { if ( ( service != null ) && ( transMeta.getObjectId() != null ) && ( service.getTransformationLock( transMeta.getObjectId() ) != null ) ) { tabItem.setImage( GUIResource.getInstance().getImageLocked() ); } } catch ( Exception e ) { throw new RuntimeException( e ); } } }
public void copyTransformationImage( TransMeta transMeta ) { TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( transMeta ); if ( transGraph == null ) { return; } Clipboard clipboard = GUIResource.getInstance().getNewClipboard(); Point area = transMeta.getMaximum(); Image image = transGraph.getTransformationImage( Display.getCurrent(), area.x, area.y, 1.0f ); clipboard.setContents( new Object[] { image.getImageData() }, new Transfer[] { ImageTransfer.getInstance() } ); }
private synchronized void synchronizeAll( boolean includeActive, Consumer<AbstractMeta> synchronizeAction ) { EngineMetaInterface current = spoon.getActiveMeta(); for ( TransMeta trans : spoonDelegates.trans.getLoadedTransformations() ) { if ( includeActive || trans != current ) { synchronizeAction.accept( trans ); } } for ( JobMeta job : spoonDelegates.jobs.getLoadedJobs() ) { if ( includeActive || job != current ) { synchronizeAction.accept( job ); } } }
private boolean isTransOpened( String id, String path, String name ) { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getObjectId() != null && id.equals( t.getObjectId().getId() ) || ( path.equals( t.getRepositoryDirectory().getPath() ) && name.equals( t.getName() ) ) ) { return true; } } return false; }
addTransGraph( master ); addTransGraph( slaveTrans );
/** * Show the remarks of the last transformation check that was run. * * @see #checkTrans() */ public void showLastTransCheck() { TransMeta transMeta = getActiveTransformation(); if ( transMeta == null ) { return; } TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( transMeta ); if ( transGraph == null ) { return; } CheckResultDialog crd = new CheckResultDialog( transMeta, shell, SWT.NONE, transGraph.getRemarks() ); String stepName = crd.open(); if ( stepName != null ) { // Go to the indicated step! StepMeta stepMeta = transMeta.findStep( stepName ); if ( stepMeta != null ) { delegates.steps.editStep( transMeta, stepMeta ); } } }