Search in sources :

Example 11 with ProcessMessage

use of org.talend.designer.runprocess.ProcessMessage in project tdi-studio-se by Talend.

the class ProcessComposite method addPerlMark.

protected void addPerlMark(IProcessMessage psMess) {
    if (psMess.getType().equals(MsgType.STD_ERR)) {
        String content = psMess.getContent();
        String path = null;
        String uniName = null;
        int lineNo = -1;
        //$NON-NLS-1$
        Pattern errorPattern = Pattern.compile("(.*) at (\\S+) line (\\d+)[\\.,]");
        Matcher m = errorPattern.matcher(content);
        String matchContent = null;
        while (m.find()) {
            path = m.group(2);
            lineNo = parseInt(m.group(3));
            matchContent = m.group();
            if ((!("".equals(path)) && path != null) && lineNo > 0) {
                //$NON-NLS-1$ 
                uniName = Problems.setErrorMark(path, lineNo);
            }
            if (uniName != null) {
                if (!errorMessMap.containsKey(uniName)) {
                    errorMessMap.put(uniName, new ProcessMessage(MsgType.STD_ERR, matchContent));
                } else {
                    String uniMess = errorMessMap.get(uniName).getContent();
                    errorMessMap.put(uniName, new ProcessMessage(MsgType.STD_ERR, uniMess.concat(matchContent)));
                }
            }
        }
    }
    refreshNode(psMess);
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) IProcessMessage(org.talend.designer.runprocess.IProcessMessage) ProcessMessage(org.talend.designer.runprocess.ProcessMessage) Point(org.eclipse.swt.graphics.Point)

Aggregations

IProcessMessage (org.talend.designer.runprocess.IProcessMessage)11 ProcessMessage (org.talend.designer.runprocess.ProcessMessage)11 Point (org.eclipse.swt.graphics.Point)8 Matcher (java.util.regex.Matcher)6 Pattern (java.util.regex.Pattern)6 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)3 Process (org.talend.designer.core.ui.editor.process.Process)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 MessageFormat (java.text.MessageFormat)2 Date (java.util.Date)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 DebugException (org.eclipse.debug.core.DebugException)2 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)2 IProcess (org.eclipse.debug.core.model.IProcess)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 IProgressService (org.eclipse.ui.progress.IProgressService)2 IContext (org.talend.core.model.process.IContext)2 Processor (org.talend.designer.core.runprocess.Processor)2