public JobMeta[] getLoadedJobs() { if ( delegates != null && delegates.jobs != null ) { List<JobMeta> list = delegates.jobs.getJobList(); return list.toArray( new JobMeta[list.size()] ); } else { return null; } }
/** * Add a job to the job map * * @param jobMeta * the job to add to the map * @return true if the job was added */ public boolean addJob( JobMeta jobMeta ) { int index = getJobList().indexOf( jobMeta ); if ( index < 0 ) { getJobList().add( jobMeta ); return true; } else { /* * ShowMessageDialog dialog = new ShowMessageDialog(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION, * BaseMessages.getString(PKG, "Spoon.Dialog.JobAlreadyLoaded.Title"), "'" + jobMeta.toString() + "'" + Const.CR + * Const.CR + BaseMessages.getString(PKG, "Spoon.Dialog.JobAlreadyLoaded.Message")); dialog.setTimeOut(6); * dialog.open(); */ return false; } }
/** * @param jobMeta * the transformation to close, make sure it's ok to dispose of it BEFORE you call this. */ public void closeJob( JobMeta jobMeta ) { // Close the associated tabs... // TabMapEntry entry = getSpoon().delegates.tabs.findTabMapEntry( jobMeta ); if ( entry != null ) { getSpoon().delegates.tabs.removeTab( entry ); } // Also remove it from the item from the jobMap // Otherwise it keeps showing up in the objects tree // int index = getJobList().indexOf( jobMeta ); while ( index >= 0 ) { getJobList().remove( index ); index = getJobList().indexOf( jobMeta ); } getSpoon().refreshTree(); getSpoon().enableMenus(); }
private boolean isJobOpened( String id, String path, String name ) { List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList(); for ( JobMeta j : openedJobFiles ) { if ( j.getObjectId() != null && id.equals( j.getObjectId().getId() ) || ( path.equals( j.getRepositoryDirectory().getPath() ) && name.equals( j.getName() ) ) ) { return true; } } return false; }
private void isFileOpenedInFolder( String path ) throws KettleException { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getRepositoryDirectory().getPath() != null && ( t.getRepositoryDirectory().getPath() + "/" ).startsWith( path + "/" ) ) { throw new KettleTransException(); } } List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList(); for ( JobMeta j : openedJobFiles ) { if ( j.getRepositoryDirectory().getPath() != null && ( j.getRepositoryDirectory().getPath() + "/" ).startsWith( path + "/" ) ) { throw new KettleJobException(); } } }
final List<JobMeta> jobList = delegates.jobs.getJobList(); if ( ( transList.size() == 0 ) && ( jobList.size() == 0 ) ) { return true;