Search in sources :

Example 1 with JobDialog

use of org.pentaho.di.ui.job.dialog.JobDialog in project pentaho-kettle by pentaho.

the class JobGraph method editProperties.

public static boolean editProperties(JobMeta jobMeta, Spoon spoon, Repository rep, boolean allowDirectoryChange) {
    if (jobMeta == null) {
        return false;
    }
    JobDialog jd = new JobDialog(spoon.getShell(), SWT.NONE, jobMeta, rep);
    jd.setDirectoryChangeAllowed(allowDirectoryChange);
    JobMeta ji = jd.open();
    // 
    if (jd.isSharedObjectsFileChanged()) {
        try {
            SharedObjects sharedObjects = rep != null ? rep.readJobMetaSharedObjects(jobMeta) : jobMeta.readSharedObjects();
            spoon.sharedObjectsFileMap.put(sharedObjects.getFilename(), sharedObjects);
        } catch (Exception e) {
            new ErrorDialog(spoon.getShell(), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Title"), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Message", spoon.delegates.tabs.makeTabName(jobMeta, true)), e);
        }
    }
    // If we added properties, add them to the variables too, so that they appear in the CTRL-SPACE variable completion.
    // 
    spoon.setParametersAsVariablesInUI(jobMeta, jobMeta);
    if (jd.isSharedObjectsFileChanged() || ji != null) {
        spoon.refreshTree();
        // cheap operation, might as will do it anyway
        spoon.delegates.tabs.renameTabs();
    }
    spoon.setShellText();
    return ji != null;
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) JobDialog(org.pentaho.di.ui.job.dialog.JobDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SharedObjects(org.pentaho.di.shared.SharedObjects) XulException(org.pentaho.ui.xul.XulException) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)1 JobMeta (org.pentaho.di.job.JobMeta)1 KettleRepositoryLostException (org.pentaho.di.repository.KettleRepositoryLostException)1 SharedObjects (org.pentaho.di.shared.SharedObjects)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1 JobDialog (org.pentaho.di.ui.job.dialog.JobDialog)1 XulException (org.pentaho.ui.xul.XulException)1