private void notifyAboutConnectionFailure(final TaskRepository repository, String details) {
   Notifications.Bus.register(TASKS_NOTIFICATION_GROUP, NotificationDisplayType.BALLOON);
   String content = "<p><a href=\"\">Configure server...</a></p>";
   if (!StringUtil.isEmpty(details)) {
     content = "<p>" + details + "</p>" + content;
   }
   Notifications.Bus.notify(
       new Notification(
           TASKS_NOTIFICATION_GROUP,
           "Cannot connect to " + repository.getUrl(),
           content,
           NotificationType.WARNING,
           new NotificationListener() {
             public void hyperlinkUpdate(
                 @NotNull Notification notification, @NotNull HyperlinkEvent event) {
               TaskRepositoriesConfigurable configurable =
                   new TaskRepositoriesConfigurable(myProject);
               ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
               if (!ArrayUtil.contains(repository, getAllRepositories())) {
                 notification.expire();
               }
             }
           }),
       myProject);
 }
Exemplo n.º 2
0
  @Override
  public void activate() {
    createPool();
    final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
    if (!myProject.isDefault()) {
      ChangeListManager.getInstance(myProject).addChangeListListener(myChangeListListener);
      vcsManager.addVcsListener(myVcsListener);
    }

    SvnApplicationSettings.getInstance().svnActivated();
    if (myEntriesFileListener != null) {
      VirtualFileManager.getInstance().addVirtualFileListener(myEntriesFileListener);
    }
    // this will initialize its inner listener for committed changes upload
    LoadedRevisionsCache.getInstance(myProject);
    FrameStateManager.getInstance().addListener(myFrameStateListener);

    myAuthNotifier.init();
    mySvnBranchPointsCalculator = new SvnBranchPointsCalculator(myProject);
    mySvnBranchPointsCalculator.activate();

    if (SystemInfo.isWindows) {
      if (!SVNJNAUtil.isJNAPresent()) {
        Notifications.Bus.notify(
            new Notification(
                getDisplayName(),
                "Subversion plugin: no JNA",
                "A problem with JNA initialization for svnkit library. Encryption is not available.",
                NotificationType.WARNING),
            NotificationDisplayType.BALLOON,
            myProject);
      } else if (!SVNJNAUtil.isWinCryptEnabled()) {
        Notifications.Bus.notify(
            new Notification(
                getDisplayName(),
                "Subversion plugin: no encryption",
                "A problem with encryption module (Crypt32.dll) initialization for svnkit library. Encryption is not available.",
                NotificationType.WARNING),
            NotificationDisplayType.BALLOON,
            myProject);
      }
    }

    final SvnConfiguration.UseAcceleration accelerationType =
        SvnConfiguration.getInstance(myProject).myUseAcceleration;
    if (SvnConfiguration.UseAcceleration.javaHL.equals(accelerationType)) {
      CheckJavaHL.runtimeCheck(myProject);
    } else if (SvnConfiguration.UseAcceleration.commandLine.equals(accelerationType)
        && !ApplicationManager.getApplication().isHeadlessEnvironment()) {
      myChecker.checkExecutableAndNotifyIfNeeded();
    }

    // do one time after project loaded
    StartupManager.getInstance(myProject)
        .runWhenProjectIsInitialized(
            new DumbAwareRunnable() {
              @Override
              public void run() {
                postStartup();

                // for IDEA, it takes 2 minutes - and anyway this can be done in background, no
                // sense...
                // once it could be mistaken about copies for 2 minutes on start...

                /*if (! myMapping.getAllWcInfos().isEmpty()) {
                  invokeRefreshSvnRoots();
                  return;
                }
                ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
                  public void run() {
                    myCopiesRefreshManager.getCopiesRefresh().ensureInit();
                  }
                }, SvnBundle.message("refreshing.working.copies.roots.progress.text"), true, myProject);*/
              }
            });

    vcsManager.addVcsListener(myRootsToWorkingCopies);

    myLoadedBranchesStorage.activate();
  }