use of org.talend.core.model.process.IProcess2 in project tdi-studio-se by Talend.
the class JobHierarchyViewPart method updateInput.
/*
* Changes the input to a new type
*
* @param inputElement
*/
private void updateInput(IProcess2 newProcess) {
IProcess2 prevInput = inputProcess;
// processOutstandingEvents();
if (newProcess == null) {
clearInput();
} else {
inputProcess = newProcess;
fNoHierarchyShownLabel.setText(//$NON-NLS-1$
Messages.getString(//$NON-NLS-1$
"JobHierarchyMessages.JobHierarchyViewPart_createinput", getJobLabel()));
try {
fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputProcess, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
// fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputElement, getSite().getWorkbenchWindow());
} catch (InvocationTargetException e) {
org.talend.commons.ui.runtime.exception.ExceptionHandler.process(e);
clearInput();
return;
} catch (InterruptedException e) {
fNoHierarchyShownLabel.setText(showEmptyLabel);
return;
}
// internalSelectType(null, false); // clear selection
updateHierarchyViewer(true);
internalSelectType(inputProcess, true);
updateToolbarButtons();
updateTitle();
fPagebook.showPage(fTypeMethodsSplitter);
}
}
use of org.talend.core.model.process.IProcess2 in project tdi-studio-se by Talend.
the class JobHierarchy method getSubtypes.
/**
* DOC bqian Comment method "getSubtypes".
*
* @param type
* @return
*/
public IProcess2[] getSubtypes(IProcess process) {
List<INode> tRunjobs = DesignerUtilities.getTRunjobs(process);
List<IProcess2> jobs = new ArrayList<IProcess2>(tRunjobs.size());
for (INode node : tRunjobs) {
IProcess2 job = DesignerUtilities.getCorrespondingProcessFromTRunjob(node);
if (job != null) {
jobs.add(job);
}
}
return jobs.toArray(new IProcess2[0]);
}
use of org.talend.core.model.process.IProcess2 in project tdi-studio-se by Talend.
the class JobHierarchyLabelProvider method getText.
@Override
public String getText(Object element) {
if (element instanceof IProcess2) {
IProcess2 process = (IProcess2) element;
String label = process.getLabel();
if (isTIS) {
//$NON-NLS-1$ //$NON-NLS-2$
label += " [" + getProjectLabel(process) + "]";
}
return label;
}
return super.getText(element);
}
use of org.talend.core.model.process.IProcess2 in project tdi-studio-se by Talend.
the class DebugProcessTosComposite method exec.
public void exec() {
setHideconsoleLine(false);
if (getProcessContext() == null) {
return;
}
if (getProcessContext().getProcess() instanceof IProcess2) {
ReplaceNodesInProcessProvider.beforeRunJobInGUI(getProcessContext().getProcess());
}
CorePlugin.getDefault().getRunProcessService().saveJobBeforeRun(getProcessContext().getProcess());
if (manager.getClearBeforeExec()) {
processContext.clearMessages();
}
if (manager.getExecTime()) {
processContext.switchTime();
}
processContext.setWatchAllowed(manager.getExecTime());
processContext.setMonitorPerf(manager.getStat());
// processContext.setMonitorTrace(traceBtn.getSelection());
processContext.setNextBreakPoint(false);
processContext.setSelectedContext(manager.getSelectContext());
processContext.exec(manager.getProcessShell());
checkSaveBeforeRunSelection();
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = manager.getLaunches();
manager.removeLaunches(launches);
// trace debug to collect when tos
IPreferenceStore preferenceStore = RunProcessPlugin.getDefault().getPreferenceStore();
int num = preferenceStore.getInt(RunProcessTokenCollector.TOS_COUNT_DEBUG_RUNS.getPrefKey());
preferenceStore.setValue(RunProcessTokenCollector.TOS_COUNT_DEBUG_RUNS.getPrefKey(), num + 1);
}
use of org.talend.core.model.process.IProcess2 in project tdi-studio-se by Talend.
the class ToggleSubjobsAction method run.
@Override
public void run() {
boolean display = isChecked();
getGlobalStore().setValue(TalendDesignerPrefConstants.DISPLAY_SUBJOBS, display);
IEditorReference[] editorParts = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
for (IEditorReference reference : editorParts) {
if (!(reference.getId().equals(MultiPageTalendEditor.ID) || reference.getId().equals(JOBLET_ID) || MAP_REDUCE_MULTIPAGE_EDITOR_ID.equals(reference.getId()) || TEST_CASE_DI_EDITOR.equals(reference.getId()))) {
continue;
}
IEditorPart editorPart = reference.getEditor(false);
if (editorPart == null) {
continue;
}
if (editorPart instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor editor = (AbstractMultiPageTalendEditor) editorPart;
IProcess2 process = editor.getTalendEditor().getProcess();
if (process == null) {
continue;
}
List<? extends ISubjobContainer> subjobs = process.getSubjobContainers();
for (ISubjobContainer subjobContainer : subjobs) {
subjobContainer.updateSubjobDisplay();
}
}
}
}
Aggregations