コード例 #1
0
 /**
  * Handles a low-level Git execution exception. Checks that Git executable is valid. If it is not,
  * then shows proper notification with an option to fix the path to Git. If it's valid, then we
  * don't know what could happen and just display the general error notification.
  */
 public static void checkGitExecutableAndShowNotification(final Project project, VcsException e) {
   if (GitVcs.getInstance(project).getExecutableValidator().checkExecutableAndNotifyIfNeeded()) {
     GitVcs.IMPORTANT_ERROR_NOTIFICATION
         .createNotification(
             GitBundle.getString("general.error"),
             e.getLocalizedMessage(),
             NotificationType.ERROR,
             null)
         .notify(project);
   }
 }
コード例 #2
0
 @Override
 protected void notifyUnresolvedRemain() {
   GitVcs.IMPORTANT_ERROR_NOTIFICATION
       .createNotification(
           "Conflicts were not resolved during unstash",
           "Unstash is not complete, you have unresolved merges in your working tree<br/>"
               + "<a href='resolve'>Resolve</a> conflicts.",
           NotificationType.WARNING,
           new NotificationListener() {
             @Override
             public void hyperlinkUpdate(
                 @NotNull Notification notification, @NotNull HyperlinkEvent event) {
               if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                 if (event.getDescription().equals("resolve")) {
                   new UnstashConflictResolver(myProject, myRoot, myStashInfo).mergeNoProceed();
                 }
               }
             }
           })
       .notify(myProject);
 }