Package com.intellij.notification

Examples of com.intellij.notification.Notification


        showNotification(notification);
    }

    public void notifyBrokenImportSorter() {
        String content = "Formatting failed due to new experimental Import optimizer, please send me the error log";
        Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID, "", content, NotificationType.ERROR);
        showNotification(notification);

    }
View Full Code Here


            ApplicationManager.getApplication().assertWriteAccessAllowed();
            PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
            CheckUtil.checkWritable(psiFile);

            if (psiFile.getVirtualFile() == null) {
                Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID, "",
                        Notifier.NO_FILE_TO_FORMAT, NotificationType.ERROR);
                notifier.showNotification(notification);
                return;
            }
            //ctrl shift enter fix
View Full Code Here

                    if (scanMode != null) {
                        graph.scanMode = scanMode;
                        configuration.setScanMode(scanMode);
                        if (history.getStatus().mergeInfoUnavailable
                                && !configuration.isMergeInfoUnavailableWarningSuppressed()) {
                            Notifications.Bus.notify(new Notification("SvnRevisionGraph",
                                    "Merge information is not available",
                                    "Repository uses SVN version 1.4 or earlier. Displayed graph may contain less information.",
                                    NotificationType.WARNING), project);
                            configuration.suppressMergeInfoUnavailableWarning();
                        }
                        if (history.getStatus().retrievedWithErrors) {
                            Notifications.Bus.notify(new Notification("SvnRevisionGraph",
                                    "Error collecting revision information",
                                    "Displayed graph may be incorrect or incomplete. More details are in IDEA's log.",
                                    NotificationType.ERROR), project);
                        }
                    }
View Full Code Here

      notifyFailedFormatting(psiFile, formattedByIntelliJ, e);
    }
  }

  private void notifyNothingWasFormatted() {
    Notification notification = new Notification(GROUP_DISPLAY_ID,
        "",
        "Nothing was not formatted",
        NotificationType.WARNING);
    showNotification(notification);
  }
View Full Code Here

  }

  private void notifyFailedFormatting(PsiFile psiFile, boolean formattedByIntelliJ, Exception e) {
    String error = e.getMessage() == null ? "" : e.getMessage();
    if (!formattedByIntelliJ) {
      Notification notification = new Notification(GROUP_DISPLAY_ID,
          "",
          psiFile.getName() + " failed to format with Eclipse code formatter. " + error,
          NotificationType.ERROR);
      showNotification(notification);
    } else {
      Notification notification = new Notification(GROUP_DISPLAY_ID,
          "",
          psiFile.getName() + " failed to format with IntelliJ code formatter. " + error,
          NotificationType.ERROR);
      showNotification(notification);
    }
View Full Code Here

    }
  }

  private void notifySuccessFormatting(PsiFile psiFile, boolean formattedByIntelliJ) {
    if (formattedByIntelliJ) {
      Notification notification = new Notification(GROUP_DISPLAY_ID,
          "",
          psiFile.getName() + " formatted sucessfully by IntelliJ code formatter",
          NotificationType.WARNING);
      showNotification(notification);
    } else {
      Notification notification = new Notification(GROUP_DISPLAY_ID,
          "",
          psiFile.getName() + " formatted sucessfully by Eclipse code formatter",
          NotificationType.INFORMATION);
      showNotification(notification);
    }
View Full Code Here

            long written = 0;
            for (File f : files.subList(filesCount, files.size())) {
              written += f.length();
            }
            String totalSize = StringUtil.formatFileSize(written);
            Notifications.Bus.notify(new Notification(
              BnfConstants.GENERATION_GROUP,
              file.getName() + " generated (" + totalSize + ")",
              "to " + genDir + (duration == null ? "" : " in " + duration), NotificationType.INFORMATION), project);
          }
          catch (Exception ex) {
            Notifications.Bus.notify(new Notification(
              BnfConstants.GENERATION_GROUP,
              file.getName() + " generation failed",
              ExceptionUtil.getUserStackTrace(ex, ParserGenerator.LOG), NotificationType.ERROR), project);
            LOG.warn(ex);
          }
View Full Code Here

          PsiFile psiFile = psiDirectory.findFile(flexFileName);
          if (psiFile == null) psiFile = psiDirectory.createFile("_" + flexFileName);

          FileContentUtil.setFileText(project, virtualFile, text);

          Notifications.Bus.notify(new Notification(BnfConstants.GENERATION_GROUP,
              psiFile.getName() + " generated", "to " + virtualFile.getParent().getPath(),
              NotificationType.INFORMATION), project);

          associateFileTypeAndNavigate(project, virtualFile);
        }
View Full Code Here

            "public " + className + "() {\n" +
            "  super(new " + lexerClassName + "());\n" +
            "}\n", aClass);
        aClass.addAfter(constructor, aClass.getLBrace());

        Notifications.Bus.notify(new Notification(BnfConstants.GENERATION_GROUP,
            aClass.getName() + " lexer class generated", "to " + virtualDir.getPath() +
            "\n<br>Use this class in your ParserDefinition implementation." +
            "\n<br>For complex cases consider employing com.intellij.lexer.LookAheadLexer API.",
            NotificationType.INFORMATION), project);
      }
View Full Code Here

      throw new ProcessCanceledException();
    }
  }

  static void fail(@NotNull Project project, @NotNull VirtualFile sourceFile, @NotNull String message) {
    Notifications.Bus.notify(new Notification(
      BnfConstants.GENERATION_GROUP,
      sourceFile.getName(), message,
      NotificationType.ERROR), project);
    throw new ProcessCanceledException();
  }
View Full Code Here

TOP

Related Classes of com.intellij.notification.Notification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.