public void outputException(String exception) {
   updateErrorAndWarningCounters(PRIORITY_ERR);
   AntMessage message = createErrorMessage(MessageType.ERROR, 0, exception);
   addCommand(new AddExceptionCommand(message));
   WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(myProject);
   wolf.queue(message.getFile());
 }
 public void outputMessage(final String text, final int priority) {
   final AntMessage customizedMessage = getCustomizedMessage(text, priority);
   final AntMessage message =
       customizedMessage != null
           ? customizedMessage
           : new AntMessage(MessageType.MESSAGE, priority, text, null, 0, 0);
   updateErrorAndWarningCounters(message.getPriority());
   addCommand(new AddMessageCommand(message));
 }
 public void outputError(String error, int priority) {
   // updateErrorAndWarningCounters(priority);
   AntMessage message = createErrorMessage(MessageType.ERROR, priority, error);
   addMessage(
       MessageType.ERROR,
       priority,
       error,
       message.getFile(),
       message.getLine(),
       message.getColumn());
   WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(myProject);
   wolf.queue(message.getFile());
 }
示例#4
0
文件: TreeView.java 项目: jexp/idea2
  private MessageNode createMessageNode(AntMessage message) {
    String text = message.getText();

    boolean allowToShowPosition = true;
    if (JUNIT_TASK_NAME.equals(myCurrentTaskName)) {
      HyperlinkUtil.PlaceInfo info = HyperlinkUtil.parseJUnitMessage(myProject, text);
      if (info != null) {
        message =
            new AntMessage(message.getType(), message.getPriority(), text, info.getFile(), 1, 1);
        allowToShowPosition = false;
      }
    }

    return new MessageNode(message, myProject, allowToShowPosition);
  }
示例#5
0
文件: TreeView.java 项目: jexp/idea2
 public void addJavacMessage(AntMessage message, String url) {
   final StringBuilder builder = StringBuilderSpinAllocator.alloc();
   try {
     final VirtualFile file = message.getFile();
     if (message.getLine() > 0) {
       if (file != null) {
         ApplicationManager.getApplication()
             .runReadAction(
                 new Runnable() {
                   public void run() {
                     String presentableUrl = file.getPresentableUrl();
                     builder.append(presentableUrl);
                     builder.append(' ');
                   }
                 });
       } else if (url != null) {
         builder.append(url);
         builder.append(' ');
       }
       builder.append('(');
       builder.append(message.getLine());
       builder.append(':');
       builder.append(message.getColumn());
       builder.append(") ");
     }
     addJavacMessageImpl(
         new AntMessage(
             message.getType(),
             message.getPriority(),
             builder.toString() + message.getText(),
             message.getFile(),
             message.getLine(),
             message.getColumn()));
   } finally {
     StringBuilderSpinAllocator.dispose(builder);
   }
 }
示例#6
0
文件: TreeView.java 项目: jexp/idea2
  public void addException(AntMessage exception, boolean showFullTrace) {
    MessageNode exceptionRootNode = null;

    StringTokenizer tokenizer = new StringTokenizer(exception.getText(), "\r\n");
    while (tokenizer.hasMoreElements()) {
      String line = (String) tokenizer.nextElement();
      if (exceptionRootNode == null) {
        AntMessage newMessage =
            new AntMessage(
                exception.getType(),
                exception.getPriority(),
                line,
                exception.getFile(),
                exception.getLine(),
                exception.getColumn());
        exceptionRootNode = new MessageNode(newMessage, myProject, true);
        myMessageItems.add(exceptionRootNode);
      } else if (showFullTrace) {
        if (StringUtil.startsWithChar(line, '\t')) {
          line = line.substring(1);
        }

        HyperlinkUtil.PlaceInfo info = HyperlinkUtil.parseStackLine(myProject, '\t' + line);
        VirtualFile file = info != null ? info.getFile() : null;
        int lineNumber = info != null ? info.getLine() : 0;
        int column = info != null ? info.getColumn() : 1;
        AntMessage newMessage =
            new AntMessage(
                exception.getType(), exception.getPriority(), line, file, lineNumber, column);
        MessageNode child = new MessageNode(newMessage, myProject, false);
        exceptionRootNode.add(child);
        myMessageItems.add(child);
      }
    }
    if (exceptionRootNode == null) return;

    MutableTreeNode parentNode = (MutableTreeNode) myParentPath.getLastPathComponent();
    myTreeModel.insertNodeInto(exceptionRootNode, parentNode, parentNode.getChildCount());

    handleExpansion();
  }
 AddJavacMessageCommand(AntMessage antMessage, String url) {
   super(antMessage.getPriority());
   myAntMessage = antMessage;
   myUrl = url;
 }
 AddExceptionCommand(AntMessage antMessage) {
   super(antMessage.getPriority());
   myAntMessage = antMessage;
 }
 AddMessageCommand(AntMessage antMessage) {
   super(antMessage.getPriority());
   myAntMessage = antMessage;
 }
示例#10
0
文件: TreeView.java 项目: jexp/idea2
 public void startTask(AntMessage message) {
   myCurrentTaskName = message.getText();
   MessageNode taskNode = (MessageNode) addMessage(message);
   myParentPath = myParentPath.pathByAddingChild(taskNode);
 }