Search in sources :

Example 1 with ConnectionTrace

use of org.talend.designer.core.ui.editor.connections.ConnectionTrace in project tdi-studio-se by Talend.

the class DebugProcessTosComposite method addTrace.

private void addTrace(int itemId) {
    Boolean trace = false;
    if (itemId == ProcessView.TRACEDEBUG_ID) {
        trace = true;
    }
    processContext.setMonitorTrace(trace);
    org.talend.core.model.process.IProcess process = processContext.getProcess();
    List<INode> nodeList = (List<INode>) process.getGraphicalNodes();
    for (INode node : nodeList) {
        for (Connection connection : (List<Connection>) node.getOutgoingConnections()) {
            ConnectionTrace traceNode = connection.getConnectionTrace();
            if (traceNode == null) {
                continue;
            }
            traceNode.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), trace);
            if (connection != null && connection.checkTraceShowEnable()) {
                connection.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), trace);
            }
        }
    }
}
Also used : INode(org.talend.core.model.process.INode) ConnectionTrace(org.talend.designer.core.ui.editor.connections.ConnectionTrace) Connection(org.talend.designer.core.ui.editor.connections.Connection) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ConnectionTrace

use of org.talend.designer.core.ui.editor.connections.ConnectionTrace in project tdi-studio-se by Talend.

the class ProcessComposite method setProcessContext.

public void setProcessContext(RunProcessContext processContext) {
    IPreferenceStore preferenceStore = DesignerPlugin.getDefault().getPreferenceStore();
    //$NON-NLS-1$
    String languagePrefix = LanguageManager.getCurrentLanguage().toString() + "_";
    if (this.processContext != null) {
        this.processContext.removePropertyChangeListener(pcl);
    }
    this.processContext = processContext;
    if (processContext != null) {
        processContext.addPropertyChangeListener(pcl);
    }
    // if (argumentsViewer != null) {
    // argumentsViewer.setProcessContext(processContext);
    // }
    boolean disableAll = false;
    if (processContext != null) {
        disableAll = processContext.getProcess().disableRunJobView();
    }
    // && !disableAll);
    if (this.processContext == null) {
        // this.processContext.setMonitorTrace(traceBtn.getSelection());
        processManager.setBooleanTrace(false);
    }
    // watchBtn.setSelection(RunProcessPlugin.getDefault().getPreferenceStore
    // ().getBoolean(
    // RunProcessPrefsConstants.ISEXECTIMERUN)
    // && !disableAll);
    // saveJobBeforeRunButton.setSelection(RunProcessPlugin.getDefault().
    // getPreferenceStore().getBoolean(
    // RunProcessPrefsConstants.ISSAVEBEFORERUN)
    // && !disableAll);
    // clearBeforeExec.setSelection(RunProcessPlugin.getDefault().
    // getPreferenceStore().getBoolean(
    // RunProcessPrefsConstants.ISCLEARBEFORERUN)
    // && !disableAll);
    // saveJobBeforeRunButton.setSelection(processContext != null && processContext.isSaveBeforeRun());
    setRunnable(processContext != null && !processContext.isRunning() && !disableAll);
    if (killBtn != null && !killBtn.isDisposed()) {
        killBtn.setEnabled(processContext != null && processContext.isRunning() && !disableAll);
    }
    // clearBeforeExec.setEnabled(processContext != null);
    // clearBeforeExec.setSelection(processContext != null && processContext.isClearBeforeExec());
    // contextComposite.setProcess(((processContext != null) && !disableAll ? processContext.getProcess() : null));
    fillConsole(processContext != null ? processContext.getMessages() : new ArrayList<IProcessMessage>());
    // remove trace if basic run tab active
    if (processContext != null) {
        processContext.setMonitorTrace(false);
        org.talend.core.model.process.IProcess process = processContext.getProcess();
        List<INode> nodeList = (List<INode>) process.getGraphicalNodes();
        for (INode node : nodeList) {
            for (Connection connection : (List<Connection>) node.getOutgoingConnections()) {
                ConnectionTrace traceNode = connection.getConnectionTrace();
                if (traceNode == null) {
                    continue;
                }
                traceNode.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), false);
                if (connection != null && connection.checkTraceShowEnable()) {
                    connection.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), false);
                }
            }
        }
    }
}
Also used : INode(org.talend.core.model.process.INode) ArrayList(java.util.ArrayList) Connection(org.talend.designer.core.ui.editor.connections.Connection) ConnectionTrace(org.talend.designer.core.ui.editor.connections.ConnectionTrace) ArrayList(java.util.ArrayList) List(java.util.List) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Example 3 with ConnectionTrace

use of org.talend.designer.core.ui.editor.connections.ConnectionTrace in project tdi-studio-se by Talend.

the class PartFactory method createEditPart.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
     */
@Override
public EditPart createEditPart(EditPart context, Object model) {
    EditPart part = null;
    if (model instanceof SubjobContainer) {
        part = new SubjobContainerPart();
    } else if (model instanceof Process) {
        part = new ProcessPart();
    } else if (model instanceof Node) {
        part = new NodePart();
    } else if (model instanceof Connection) {
        part = new ConnectionPart();
    } else if (model instanceof ConnectionLabel) {
        part = new ConnLabelEditPart();
    } else if (model instanceof MonitorConnectionLabel) {
        part = new MonitorConnectionLabelPart();
    } else if (model instanceof ConnectionPerformance) {
        part = new ConnectionPerformanceEditPart();
    } else if (model instanceof ConnectionTrace) {
        part = new ConnectionTraceEditPart();
    } else if (model instanceof ConnectionResuming) {
        part = new ConnectionResumingEditPart();
    } else if (model instanceof NodeLabel) {
        part = new NodeLabelEditPart();
    } else if (model instanceof NodeContainer) {
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerGEFService.class)) {
            ITestContainerGEFService testContainerService = (ITestContainerGEFService) GlobalServiceRegister.getDefault().getService(ITestContainerGEFService.class);
            if (testContainerService != null) {
                part = testContainerService.createEditorPart(model);
                if (part != null) {
                    part.setModel(model);
                    return part;
                }
            }
        }
        if (((NodeContainer) model).getNode().isSparkJoblet()) {
            if (GlobalServiceRegister.getDefault().isServiceRegistered(ISparkJobletProviderService.class)) {
                ISparkJobletProviderService sparkService = (ISparkJobletProviderService) GlobalServiceRegister.getDefault().getService(ISparkJobletProviderService.class);
                if (sparkService != null) {
                    part = (EditPart) sparkService.createEditorPart(model);
                    if (part != null) {
                        part.setModel(model);
                        return part;
                    }
                }
            }
        } else if (((NodeContainer) model).getNode().isSparkStreamingJoblet()) {
            if (GlobalServiceRegister.getDefault().isServiceRegistered(ISparkStreamingJobletProviderService.class)) {
                ISparkStreamingJobletProviderService sparkService = (ISparkStreamingJobletProviderService) GlobalServiceRegister.getDefault().getService(ISparkStreamingJobletProviderService.class);
                if (sparkService != null) {
                    part = (EditPart) sparkService.createEditorPart(model);
                    if (part != null) {
                        part.setModel(model);
                        return part;
                    }
                }
            }
        } else if (((NodeContainer) model).getNode().isStandardJoblet()) {
            part = new JobletContainerPart();
        } else if (((NodeContainer) model).getNode().isMapReduce()) {
            part = new JobletContainerPart();
        } else {
            part = new NodeContainerPart();
        }
    } else if (model instanceof Note) {
        part = new NoteEditPart();
    } else if (model instanceof NodeError) {
        part = new NodeErrorEditPart();
    } else if (model instanceof NodeProgressBar) {
        part = new NodeProgressBarPart();
    } else {
        return null;
    }
    // tell the newly created part about the model object
    part.setModel(model);
    return part;
}
Also used : NodeError(org.talend.designer.core.ui.editor.nodes.NodeError) NodeProgressBar(org.talend.designer.core.ui.editor.nodes.NodeProgressBar) NodeContainerPart(org.talend.designer.core.ui.editor.nodecontainer.NodeContainerPart) NodeProgressBarPart(org.talend.designer.core.ui.editor.nodes.NodeProgressBarPart) Node(org.talend.designer.core.ui.editor.nodes.Node) NodeLabelEditPart(org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart) Process(org.talend.designer.core.ui.editor.process.Process) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer) ConnectionLabel(org.talend.designer.core.ui.editor.connections.ConnectionLabel) MonitorConnectionLabel(org.talend.designer.core.ui.editor.connections.MonitorConnectionLabel) SubjobContainerPart(org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainerPart) ConnectionResuming(org.talend.designer.core.ui.editor.connections.ConnectionResuming) ConnectionResumingEditPart(org.talend.designer.core.ui.editor.connections.ConnectionResumingEditPart) NodeLabel(org.talend.designer.core.ui.editor.nodes.NodeLabel) SubjobContainer(org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainer) MonitorConnectionLabel(org.talend.designer.core.ui.editor.connections.MonitorConnectionLabel) ITestContainerGEFService(org.talend.designer.core.ITestContainerGEFService) ProcessPart(org.talend.designer.core.ui.editor.process.ProcessPart) ISparkJobletProviderService(org.talend.core.ui.ISparkJobletProviderService) NodeErrorEditPart(org.talend.designer.core.ui.editor.nodes.NodeErrorEditPart) ConnectionPerformanceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart) ConnectionResumingEditPart(org.talend.designer.core.ui.editor.connections.ConnectionResumingEditPart) NodeErrorEditPart(org.talend.designer.core.ui.editor.nodes.NodeErrorEditPart) NodeLabelEditPart(org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart) ConnectionPerformanceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart) ConnectionTraceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionTraceEditPart) NoteEditPart(org.talend.designer.core.ui.editor.notes.NoteEditPart) EditPart(org.eclipse.gef.EditPart) ConnLabelEditPart(org.talend.designer.core.ui.editor.connections.ConnLabelEditPart) Connection(org.talend.designer.core.ui.editor.connections.Connection) NoteEditPart(org.talend.designer.core.ui.editor.notes.NoteEditPart) JobletContainerPart(org.talend.designer.core.ui.editor.jobletcontainer.JobletContainerPart) ConnectionPart(org.talend.designer.core.ui.editor.connections.ConnectionPart) ConnectionPerformance(org.talend.designer.core.ui.editor.connections.ConnectionPerformance) ConnectionTrace(org.talend.designer.core.ui.editor.connections.ConnectionTrace) ConnectionTraceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionTraceEditPart) ISparkStreamingJobletProviderService(org.talend.core.ui.ISparkStreamingJobletProviderService) Note(org.talend.designer.core.ui.editor.notes.Note) NodePart(org.talend.designer.core.ui.editor.nodes.NodePart) MonitorConnectionLabelPart(org.talend.designer.core.ui.editor.connections.MonitorConnectionLabelPart) ConnLabelEditPart(org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)

Example 4 with ConnectionTrace

use of org.talend.designer.core.ui.editor.connections.ConnectionTrace in project tdi-studio-se by Talend.

the class ProcessComposite method addTrace.

private void addTrace(int itemId) {
    Boolean trace = false;
    processContext.setMonitorTrace(trace);
    processManager.setBooleanTrace(trace);
    org.talend.core.model.process.IProcess process = processContext.getProcess();
    List<INode> nodeList = (List<INode>) process.getGraphicalNodes();
    for (INode node : nodeList) {
        for (Connection connection : (List<Connection>) node.getOutgoingConnections()) {
            ConnectionTrace traceNode = connection.getConnectionTrace();
            if (traceNode == null) {
                continue;
            }
            traceNode.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), trace);
            if (connection != null && connection.checkTraceShowEnable()) {
                connection.setPropertyValue(EParameterName.TRACES_SHOW_ENABLE.getName(), trace);
            }
        }
    }
}
Also used : INode(org.talend.core.model.process.INode) ConnectionTrace(org.talend.designer.core.ui.editor.connections.ConnectionTrace) Connection(org.talend.designer.core.ui.editor.connections.Connection) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

Connection (org.talend.designer.core.ui.editor.connections.Connection)4 ConnectionTrace (org.talend.designer.core.ui.editor.connections.ConnectionTrace)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 INode (org.talend.core.model.process.INode)3 EditPart (org.eclipse.gef.EditPart)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 ISparkJobletProviderService (org.talend.core.ui.ISparkJobletProviderService)1 ISparkStreamingJobletProviderService (org.talend.core.ui.ISparkStreamingJobletProviderService)1 ITestContainerGEFService (org.talend.designer.core.ITestContainerGEFService)1 ConnLabelEditPart (org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)1 ConnectionLabel (org.talend.designer.core.ui.editor.connections.ConnectionLabel)1 ConnectionPart (org.talend.designer.core.ui.editor.connections.ConnectionPart)1 ConnectionPerformance (org.talend.designer.core.ui.editor.connections.ConnectionPerformance)1 ConnectionPerformanceEditPart (org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart)1 ConnectionResuming (org.talend.designer.core.ui.editor.connections.ConnectionResuming)1 ConnectionResumingEditPart (org.talend.designer.core.ui.editor.connections.ConnectionResumingEditPart)1 ConnectionTraceEditPart (org.talend.designer.core.ui.editor.connections.ConnectionTraceEditPart)1 MonitorConnectionLabel (org.talend.designer.core.ui.editor.connections.MonitorConnectionLabel)1 MonitorConnectionLabelPart (org.talend.designer.core.ui.editor.connections.MonitorConnectionLabelPart)1