use of org.pentaho.di.ui.spoon.dialog.NewSubtransDialog in project pentaho-kettle by pentaho.
the class BaseStreamingDialog method createNewSubtrans.
protected void createNewSubtrans() {
TransMeta newSubTransMeta = createSubTransMeta();
boolean saved = false;
String path = null;
if (spoonInstance.getRepository() != null) {
try {
saved = spoonInstance.saveToRepository(newSubTransMeta);
path = getRepositoryRelativePath(newSubTransMeta.getPathAndName());
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "BaseStreamingDialog.File.Save.Fail.Title"), BaseMessages.getString(PKG, "BaseStreamingDialog.File.Save.Fail.Message"), e);
}
} else {
saved = spoonInstance.saveXMLFile(newSubTransMeta, false);
if (saved) {
try {
path = getRelativePath(KettleVFS.getFileObject(newSubTransMeta.getFilename()).toString());
} catch (KettleFileException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "BaseStreamingDialog.File.Save.Fail.Title"), BaseMessages.getString(PKG, "BaseStreamingDialog.File.Save.Fail.Message"), e);
}
}
}
if (saved && null != path) {
wTransPath.setText(path);
createSubtrans(newSubTransMeta);
if (props.showNewSubtransPopup()) {
NewSubtransDialog newSubtransDialog = new NewSubtransDialog(shell, SWT.NONE);
props.setShowNewSubtransPopup(!newSubtransDialog.open());
}
}
}
Aggregations