Examples of CompilerMessage


Examples of com.dci.intellij.dbn.execution.compiler.CompilerMessage

                append(" - " + object.getConnectionHandler().getPresentableText(), SimpleTextAttributes.GRAY_ATTRIBUTES);
            }
        }
        else if (value instanceof CompilerMessageNode) {
            CompilerMessageNode node = (CompilerMessageNode) value;
            CompilerMessage message = node.getCompilerMessage();
            append(message.getText(), SimpleTextAttributes.REGULAR_ATTRIBUTES);

            MessageType messageType = message.getType();
            Icon icon =
                    messageType == MessageType.ERROR ? Icons.EXEC_MESSAGES_ERROR :
                    messageType == MessageType.WARNING ? Icons.EXEC_MESSAGES_WARNING :
                    messageType == MessageType.INFO ? Icons.EXEC_MESSAGES_INFO : null;
            setIcon(icon);
        }
        else if (value instanceof StatementExecutionMessageNode) {
            StatementExecutionMessageNode execMessageNode = (StatementExecutionMessageNode) value;
            StatementExecutionMessage message = execMessageNode.getExecutionMessage();
            boolean isOrphan = message.isOrphan();

            MessageType messageType = message.getType();
            Icon icon =
                    messageType == MessageType.ERROR ? (isOrphan ? Icons.EXEC_MESSAGES_WARNING : Icons.EXEC_MESSAGES_ERROR) :
                    messageType == MessageType.WARNING ? Icons.EXEC_MESSAGES_WARNING :
                    messageType == MessageType.INFO ? Icons.EXEC_MESSAGES_INFO : null;

            setIcon(icon);

            append(message.getText(), isOrphan ?
                    SimpleTextAttributes.GRAY_ATTRIBUTES :
                    SimpleTextAttributes.REGULAR_ATTRIBUTES);

            if (message.getCauseMessage() != null) {
                append(" " + message.getCauseMessage(), isOrphan ?
                        SimpleTextAttributes.GRAY_ATTRIBUTES :
                        SimpleTextAttributes.ERROR_ATTRIBUTES);
            }

            append(" - Connection: " + message.getExecutionResult().getConnectionHandler().getName() + ": " + message.getExecutionResult().getExecutionDuration() + "ms", isOrphan ?
                    SimpleTextAttributes.GRAY_ATTRIBUTES :
                    SimpleTextAttributes.GRAY_ATTRIBUTES);

        }
    }
View Full Code Here

Examples of com.dci.intellij.dbn.execution.compiler.CompilerMessage

                executionMessage.navigateToEditor();
            }
        }
        else if (object instanceof CompilerMessageNode) {
            CompilerMessageNode compilerMessageNode = (CompilerMessageNode) object;
            CompilerMessage compilerMessage = compilerMessageNode.getCompilerMessage();
            FileEditorManager editorManager = FileEditorManager.getInstance(compilerMessage.getProject());

            DatabaseEditableObjectFile databaseFile = compilerMessage.getDatabaseFile();
            if (compilerMessage.isError() || editorManager.isFileOpen(databaseFile)) {
                editorManager.openFile(databaseFile, false);
                if (compilerMessage.getContentFile() != null) {
                    BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, compilerMessage.getContentFile());
                    if (textEditor != null) {
                        navigateInEditor(compilerMessage, textEditor, databaseFile);
                    }
                }
            }
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

                {
                    result = nodeFactory.statementList(result, node);
                }
                else
                {
                    CompilerMessage m = new NodeMagic.OnlyMetadataIsAllowed();
                    m.setPath(getPath());
                    m.setLine(context.input.getLnNum(node.pos()) + script.getXmlLineNumber() - 1);
                    ThreadLocalToolkit.log(m);                   
                }
            }
        }
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

        // Check the source name is a valid component name.
        String componentName = source.getShortName();
        if (!TextParser.isValidIdentifier(componentName))
        {
            CompilerMessage m = new InvalidComponentName(componentName);
            m.setPath(source.getNameForReporting());
            ThreadLocalToolkit.log(m);
        }

        if (benchmarkHelper != null)
            benchmarkHelper.endPhase(CompilerBenchmarkHelper.PREPROCESS);
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

                int line = map.get(cx.input.getLnNum(n.pos()));
                for (int j = 0, count = line == 0 ? 0 : beginLines.length; j < count; j++)
                {
                    if (line >= beginLines[j] && line <= endLines[j])
                    {
                      CompilerMessage m = new OnlyMetadataIsAllowed();
                      m.setPath(cx.input.origin);
                      m.setLine(cx.input.getLnNum(n.pos()));
                        ThreadLocalToolkit.log(m);
                        break;
                    }
                }
            }
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

            styleSheet.parse(cssFile.getName(), cssFileStream, ThreadLocalToolkit.getLogger(), fontManager);
            extractStyles(styleSheet, false);
        }
        catch (Exception exception)
        {
            CompilerMessage m = new ParseError(exception.getLocalizedMessage());
            m.setPath(cssFile.getName());
            ThreadLocalToolkit.log(m);
        }
        finally
        {
            if (cssFileStream != null)
View Full Code Here

Examples of flex2.compiler.util.CompilerMessage

    catch (Exception e)
    {
      if (Trace.error)
        e.printStackTrace();

      CompilerMessage c = new CouldNotCreate("ASDoc_Config.xml", e.getMessage());
      ThreadLocalToolkit.log(c);
      throw c;
    }
    finally
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.