Search in sources :

Example 1 with ProblemsView

use of com.intellij.compiler.ProblemsView in project intellij-community by JetBrains.

the class AutoMakeMessageHandler method handleCompileMessage.

@Override
protected void handleCompileMessage(final UUID sessionId, CmdlineRemoteProto.Message.BuilderMessage.CompileMessage message) {
    if (myProject.isDisposed()) {
        return;
    }
    final CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind kind = message.getKind();
    if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.PROGRESS) {
        final ProblemsView view = ProblemsView.SERVICE.getInstance(myProject);
        if (message.hasDone()) {
            view.setProgress(message.getText(), message.getDone());
        } else {
            view.setProgress(message.getText());
        }
    } else {
        final CompilerMessageCategory category = convertToCategory(kind);
        if (category != null) {
            // only process supported kinds of messages
            final String sourceFilePath = message.hasSourceFilePath() ? message.getSourceFilePath() : null;
            final String url = sourceFilePath != null ? VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, FileUtil.toSystemIndependentName(sourceFilePath)) : null;
            final long line = message.hasLine() ? message.getLine() : -1;
            final long column = message.hasColumn() ? message.getColumn() : -1;
            final CompilerMessage msg = myContext.createAndAddMessage(category, message.getText(), url, (int) line, (int) column, null);
            if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.ERROR || kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.JPS_INFO) {
                if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.ERROR) {
                    informWolf(myProject, message);
                }
                if (msg != null) {
                    ProblemsView.SERVICE.getInstance(myProject).addMessage(msg, sessionId);
                }
            }
        }
    }
}
Also used : ProblemsView(com.intellij.compiler.ProblemsView)

Example 2 with ProblemsView

use of com.intellij.compiler.ProblemsView in project intellij-community by JetBrains.

the class AutoMakeMessageHandler method sessionTerminated.

@Override
public void sessionTerminated(UUID sessionId) {
    String statusMessage = null;
    switch(myBuildStatus) {
        case SUCCESS:
            //statusMessage = "Auto make completed successfully";
            break;
        case UP_TO_DATE:
            //statusMessage = "All files are up-to-date";
            break;
        case ERRORS:
            statusMessage = "Auto build completed with errors";
            break;
        case CANCELED:
            //statusMessage = "Auto make has been canceled";
            break;
    }
    if (statusMessage != null) {
        final Notification notification = CompilerManager.NOTIFICATION_GROUP.createNotification(statusMessage, MessageType.INFO);
        if (!myProject.isDisposed()) {
            notification.notify(myProject);
        }
        myProject.putUserData(LAST_AUTO_MAKE_NOFITICATION, notification);
    } else {
        Notification notification = myProject.getUserData(LAST_AUTO_MAKE_NOFITICATION);
        if (notification != null) {
            notification.expire();
            myProject.putUserData(LAST_AUTO_MAKE_NOFITICATION, null);
        }
    }
    if (!myProject.isDisposed()) {
        final ProblemsView view = ProblemsView.SERVICE.getInstance(myProject);
        view.clearProgress();
        view.clearOldMessages(null, sessionId);
    }
}
Also used : Notification(com.intellij.notification.Notification) ProblemsView(com.intellij.compiler.ProblemsView)

Aggregations

ProblemsView (com.intellij.compiler.ProblemsView)2 Notification (com.intellij.notification.Notification)1