use of org.talend.designer.core.ui.editor.update.cmd.UpdateNodePathCommand in project tdi-studio-se by Talend.
the class UpdateManagerUtils method executeUpdate.
private static void executeUpdate(UpdateResult result, IProgressMonitor monitor, boolean updateAllJobs) {
if (result.isReadOnlyProcess()) {
return;
}
// update
Command command = null;
IUpdateItemType updateType = result.getUpdateType();
if (updateType instanceof EUpdateItemType) {
switch((EUpdateItemType) updateType) {
case NODE_PROPERTY:
case NODE_SCHEMA:
case NODE_QUERY:
case NODE_SAP_IDOC:
case NODE_SAP_FUNCTION:
case NODE_VALIDATION_RULE:
command = new UpdateNodeParameterCommand(result);
break;
case JOB_PROPERTY_EXTRA:
case JOB_PROPERTY_STATS_LOGS:
case JOB_PROPERTY_HEADERFOOTER:
case JOB_PROPERTY_STORM:
case JOB_PROPERTY_MAPREDUCE:
command = new UpdateMainParameterCommand(result);
break;
case CONTEXT:
command = executeContextUpdates(result);
break;
case CONTEXT_GROUP:
command = executeContextGroupUpdates(result);
break;
case JOBLET_RENAMED:
case JOBLET_SCHEMA:
case RELOAD:
command = executeJobletNodesUpdates(result);
break;
case JUNIT_RELOAD:
command = executeJunitNodesUpdates(result);
break;
// break;
case MAP_PATH:
command = new UpdateNodePathCommand(result);
break;
default:
break;
}
}
if (command != null) {
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1 * UpdatesConstants.SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
subMonitor.beginTask(UpdatesConstants.EMPTY, 1);
subMonitor.subTask(getResultTaskInfor(result));
//
Object job = result.getJob();
boolean executed = false;
if (job != null && job instanceof IGEFProcess) {
IDesignerCoreUIService designerCoreUIService = CoreUIPlugin.getDefault().getDesignerCoreUIService();
if (designerCoreUIService != null) {
executed = designerCoreUIService.executeCommand((IGEFProcess) job, command);
}
}
if (!executed) {
command.execute();
}
subMonitor.worked(1);
}
// from extension point
UpdateManagerProviderDetector.INSTANCE.doUpdate(monitor, result);
}
Aggregations