Search in sources :

Example 1 with VcsBalloonProblemNotifier

use of com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier in project intellij-community by JetBrains.

the class SvnCompatibilityChecker method reportNoRoots.

public void reportNoRoots(final List<VirtualFile> result) {
    synchronized (myLock) {
        if (myInvocationCounter >= ourInvocationMax)
            return;
        ++myCounter;
        --myDownStartCounter;
        if ((myCounter > ourFrequency) || (myDownStartCounter >= 0)) {
            myCounter = 0;
            ++myInvocationCounter;
            final Application application = ApplicationManager.getApplication();
            application.executeOnPooledThread(() -> {
                final List<VirtualFile> suspicious = new ArrayList<>();
                for (VirtualFile vf : result) {
                    if (SvnUtil.seemsLikeVersionedDir(vf)) {
                        suspicious.add(vf);
                    }
                }
                if (!suspicious.isEmpty()) {
                    final String message = (suspicious.size() == 1) ? "Root '" + suspicious.get(0).getPresentableName() + "' is likely to be of unsupported Subversion format" : "Some roots are likely to be of unsupported Subversion format";
                    application.invokeLater(() -> new VcsBalloonProblemNotifier(myProject, message, MessageType.WARNING).run(), ModalityState.NON_MODAL, o -> (!myProject.isOpen()) || myProject.isDisposed());
                }
            });
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsBalloonProblemNotifier(com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier) ArrayList(java.util.ArrayList) Application(com.intellij.openapi.application.Application)

Example 2 with VcsBalloonProblemNotifier

use of com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier in project intellij-community by JetBrains.

the class SvnCheckinEnvironment method reportCommittedRevisions.

private void reportCommittedRevisions(Set<String> feedback, String committedRevisions) {
    final Project project = mySvnVcs.getProject();
    final String message = SvnBundle.message("status.text.comitted.revision", committedRevisions);
    if (feedback == null) {
        ApplicationManager.getApplication().invokeLater(() -> new VcsBalloonProblemNotifier(project, message, MessageType.INFO).run(), o -> (!project.isOpen()) || project.isDisposed());
    } else {
        feedback.add("Subversion: " + message);
    }
}
Also used : Project(com.intellij.openapi.project.Project) VcsBalloonProblemNotifier(com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier)

Aggregations

VcsBalloonProblemNotifier (com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier)2 Application (com.intellij.openapi.application.Application)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ArrayList (java.util.ArrayList)1