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 outputJavacMessage(
     MessageType type, String[] text, VirtualFile file, String url, int line, int column) {
   int priority = type == MessageType.ERROR ? PRIORITY_ERR : PRIORITY_VERBOSE;
   updateErrorAndWarningCounters(priority);
   AntMessage message = new AntMessage(type, priority, text, file, line, column);
   addCommand(new AddJavacMessageCommand(message, url));
   if (type == MessageType.ERROR) {
     WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(myProject);
     wolf.queue(file);
   }
 }
 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());
 }
  static void subscribeTo(NavBarPanel panel) {
    if (panel.getClientProperty(LISTENER) != null) {
      unsubscribeFrom(panel);
    }

    final NavBarListener listener = new NavBarListener(panel);
    final Project project = panel.getProject();
    panel.putClientProperty(LISTENER, listener);
    KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(listener);
    FileStatusManager.getInstance(project).addFileStatusListener(listener);
    PsiManager.getInstance(project).addPsiTreeChangeListener(listener);
    WolfTheProblemSolver.getInstance(project).addProblemListener(listener);
    ActionManager.getInstance().addAnActionListener(listener);

    final MessageBusConnection connection = project.getMessageBus().connect();
    connection.subscribe(ProjectTopics.PROJECT_ROOTS, listener);
    connection.subscribe(NavBarModelListener.NAV_BAR, listener);
    connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, listener);
    panel.putClientProperty(BUS, connection);
    panel.addKeyListener(listener);

    if (panel.isInFloatingMode()) {
      final Window window = SwingUtilities.windowForComponent(panel);
      if (window != null) {
        window.addWindowFocusListener(listener);
      }
    }
  }
  private void reportErrorsToWolf() {
    if (!myFile.getViewProvider().isPhysical()) return; // e.g. errors in evaluate expression
    Project project = myFile.getProject();
    if (!PsiManager.getInstance(project).isInProject(myFile))
      return; // do not report problems in libraries
    VirtualFile file = myFile.getVirtualFile();
    if (file == null) return;

    List<Problem> problems = convertToProblems(getInfos(), file, myHasErrorElement);
    WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(project);

    boolean hasErrors = DaemonCodeAnalyzerImpl.hasErrors(project, getDocument());
    if (!hasErrors || isWholeFileHighlighting()) {
      wolf.reportProblems(file, problems);
    } else {
      wolf.weHaveGotProblems(file, problems);
    }
  }
 static void unsubscribeFrom(NavBarPanel panel) {
   final NavBarListener listener = (NavBarListener) panel.getClientProperty(LISTENER);
   panel.putClientProperty(LISTENER, null);
   if (listener != null) {
     final Project project = panel.getProject();
     KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener(listener);
     FileStatusManager.getInstance(project).removeFileStatusListener(listener);
     PsiManager.getInstance(project).removePsiTreeChangeListener(listener);
     WolfTheProblemSolver.getInstance(project).removeProblemListener(listener);
     ActionManager.getInstance().removeAnActionListener(listener);
     final MessageBusConnection connection = (MessageBusConnection) panel.getClientProperty(BUS);
     panel.putClientProperty(BUS, null);
     if (connection != null) {
       connection.disconnect();
     }
   }
 }
  protected AbstractProjectViewPane(@NotNull Project project) {
    myProject = project;
    WolfTheProblemSolver.ProblemListener problemListener =
        new WolfTheProblemSolver.ProblemListener() {
          @Override
          public void problemsAppeared(@NotNull VirtualFile file) {
            queueUpdateByProblem();
          }

          @Override
          public void problemsChanged(@NotNull VirtualFile file) {
            queueUpdateByProblem();
          }

          @Override
          public void problemsDisappeared(@NotNull VirtualFile file) {
            queueUpdateByProblem();
          }
        };
    WolfTheProblemSolver.getInstance(project).addProblemListener(problemListener, this);
  }
Exemplo n.º 8
0
 private void informWolf(final CompilerMessage message) {
   WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(myProject);
   VirtualFile file = getVirtualFile(message);
   wolf.queue(file);
 }