Search in sources :

Example 1 with TransDialog

use of org.pentaho.di.ui.trans.dialog.TransDialog in project pentaho-kettle by pentaho.

the class TransGraph method editProperties.

public static boolean editProperties(TransMeta transMeta, Spoon spoon, Repository rep, boolean allowDirectoryChange, TransDialog.Tabs currentTab) {
    if (transMeta == null) {
        return false;
    }
    TransDialog tid = new TransDialog(spoon.getShell(), SWT.NONE, transMeta, rep, currentTab);
    tid.setDirectoryChangeAllowed(allowDirectoryChange);
    TransMeta ti = tid.open();
    // 
    if (tid.isSharedObjectsFileChanged()) {
        try {
            SharedObjects sharedObjects = rep != null ? rep.readTransSharedObjects(transMeta) : transMeta.readSharedObjects();
            spoon.sharedObjectsFileMap.put(sharedObjects.getFilename(), sharedObjects);
        } catch (KettleException e) {
            // CHECKSTYLE:LineLength:OFF
            new ErrorDialog(spoon.getShell(), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Title"), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Message", spoon.makeTabName(transMeta, true)), e);
        }
        // If we added properties, add them to the variables too, so that they appear in the CTRL-SPACE variable
        // completion.
        // 
        spoon.setParametersAsVariablesInUI(transMeta, transMeta);
        spoon.refreshTree();
        // cheap operation, might as will do it anyway
        spoon.delegates.tabs.renameTabs();
    }
    spoon.setShellText();
    return ti != null;
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TransMeta(org.pentaho.di.trans.TransMeta) TransDialog(org.pentaho.di.ui.trans.dialog.TransDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SharedObjects(org.pentaho.di.shared.SharedObjects)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)1 SharedObjects (org.pentaho.di.shared.SharedObjects)1 TransMeta (org.pentaho.di.trans.TransMeta)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1 TransDialog (org.pentaho.di.ui.trans.dialog.TransDialog)1