Search in sources :

Example 91 with IProcess2

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);
    }
}
Also used : IProcess2(org.talend.core.model.process.IProcess2) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 92 with IProcess2

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]);
}
Also used : INode(org.talend.core.model.process.INode) ArrayList(java.util.ArrayList) IProcess2(org.talend.core.model.process.IProcess2)

Example 93 with IProcess2

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);
}
Also used : IProcess2(org.talend.core.model.process.IProcess2)

Example 94 with IProcess2

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);
}
Also used : IProcess2(org.talend.core.model.process.IProcess2) ILaunch(org.eclipse.debug.core.ILaunch) ILaunchManager(org.eclipse.debug.core.ILaunchManager) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) Point(org.eclipse.swt.graphics.Point)

Example 95 with IProcess2

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();
            }
        }
    }
}
Also used : ISubjobContainer(org.talend.core.model.process.ISubjobContainer) IEditorReference(org.eclipse.ui.IEditorReference) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) IProcess2(org.talend.core.model.process.IProcess2) IEditorPart(org.eclipse.ui.IEditorPart)

Aggregations

IProcess2 (org.talend.core.model.process.IProcess2)115 INode (org.talend.core.model.process.INode)31 Node (org.talend.designer.core.ui.editor.nodes.Node)31 ArrayList (java.util.ArrayList)30 ProcessItem (org.talend.core.model.properties.ProcessItem)30 Item (org.talend.core.model.properties.Item)28 IProcess (org.talend.core.model.process.IProcess)24 PersistenceException (org.talend.commons.exception.PersistenceException)22 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)21 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)19 List (java.util.List)17 IElementParameter (org.talend.core.model.process.IElementParameter)15 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)14 Property (org.talend.core.model.properties.Property)14 CoreException (org.eclipse.core.runtime.CoreException)12 IConnection (org.talend.core.model.process.IConnection)11 HashSet (java.util.HashSet)10 IEditorReference (org.eclipse.ui.IEditorReference)10 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)10 InvocationTargetException (java.lang.reflect.InvocationTargetException)7