Package com.intellij.notification

Examples of com.intellij.notification.Notification


      CheckUtil.checkWritable(psiFile);

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


    if (!formattedByIntelliJ) {
      content = psiFile.getName() + " failed to format with Eclipse code formatter. " + reason + "\n";
    } else {
      content = psiFile.getName() + " failed to format with IntelliJ code formatter.\n" + reason;
    }
    Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID_ERROR, "", content,
        NotificationType.ERROR);
    showNotification(notification);
  }
View Full Code Here

        NotificationType.ERROR);
    showNotification(notification);
  }

  void notifyFormattingWasDisabled(PsiFile psiFile) {
    Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID_INFO, "",
        psiFile.getName() + " - formatting was disabled for this file type", NotificationType.WARNING);
    showNotification(notification);
  }
View Full Code Here

    if (formattedByIntelliJ) {
      content = psiFile.getName() + " formatted sucessfully by IntelliJ code formatter";
    } else {
      content = psiFile.getName() + " formatted sucessfully by Eclipse code formatter";
    }
    Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID_INFO, "", content,
        NotificationType.INFORMATION);
    showNotification(notification);
  }
View Full Code Here

    });
  }

  public void notifyBrokenImportSorter() {
    String content = "Formatting failed due to new Import optimizer.";
    Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID_ERROR, "", content,
        NotificationType.ERROR);
    showNotification(notification);

  }
View Full Code Here

  }

  public static void notifyDeletedSettings(final Project project) {
    String content = "Eclipse formatter settings profile was deleted for project " + project.getName()
        + ". Default settings is used now.";
    final Notification notification = new Notification(ProjectSettingsComponent.GROUP_DISPLAY_ID_ERROR, "",
        content, NotificationType.ERROR);
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        Notifications.Bus.notify(notification, project);
View Full Code Here

                needsUpgrade = true;
            }

            if (needsUpgrade) {
                Notifications.Bus.notify(
                        new Notification("Go SDK validator", "Corrupt Go SDK",
                                getContent("Go", sdk.getName()),
                                NotificationType.WARNING), myProject);
            }

            SdkModificator sdkModificator = sdk.getSdkModificator();
            sdkModificator.setSdkAdditionalData(data);
            sdkModificator.commitChanges();
        }

        sdkList.clear();
        sdkList.addAll(GoSdkUtil.getSdkOfType(GoAppEngineSdkType.getInstance(), jdkTable));

        for (Sdk sdk : sdkList) {
            GoAppEngineSdkData sdkData = (GoAppEngineSdkData) sdk.getSdkAdditionalData();

            if (sdkData == null || sdkData.TARGET_ARCH == null || sdkData.TARGET_OS == null) {
                Notifications.Bus.notify(
                        new Notification(
                                "Go AppEngine SDK validator",
                                "Corrupt Go App Engine SDK",
                                getContent("Go App Engine", sdk.getName()),
                                NotificationType.WARNING
                        ), myProject);

                continue;
            }

            boolean needsUpgrade = false;
            try {
                sdkData.checkValid();
            } catch (ConfigurationException ex) {
                needsUpgrade = true;
            }

            if (!needsUpgrade)
                continue;

            needsUpgrade = false;
            GoAppEngineSdkData data = GoSdkUtil.testGoAppEngineSdk(sdk.getHomePath());

            if (data == null)
                needsUpgrade = true;

            try {
                if (data != null) {
                    data.checkValid();
                }
            } catch (ConfigurationException ex) {
                needsUpgrade = true;
            }

            // GAE SDK auto-update needs a bit more love
            if (data != null && !(new File(data.GOAPP_BIN_PATH)).exists()) {
                needsUpgrade = true;
            }

            if (needsUpgrade) {
                Notifications.Bus.notify(
                        new Notification(
                                "Go AppEngine SDK validator",
                                "Corrupt Go App Engine SDK",
                                getContent("Go AppEngine", sdk.getName()),
                                NotificationType.WARNING), myProject);
            }

            SdkModificator sdkModificator = sdk.getSdkModificator();
            sdkModificator.setSdkAdditionalData(data);
            sdkModificator.commitChanges();
        }

        PluginDescriptor pluginDescriptor = PluginManager.getPlugin(PluginId.getId("ro.redeul.google.go"));
        if (pluginDescriptor != null) {
            String version = ((IdeaPluginDescriptorImpl) pluginDescriptor).getVersion();

            if (version.endsWith("-dev") &&
                    !System.getProperty("go.skip.dev.warn", "false").equals("true")) {
                Notifications.Bus.notify(
                        new Notification(
                                "Go plugin notice",
                                "Development version detected",
                                getDevVersionMessage(),
                                NotificationType.WARNING,
                                null),
View Full Code Here

    LOG.warn("Failed to find virtual file for '" + scratch.asFileName() + "'");
  }

  private static void notifyUser(String title, String message, NotificationType notificationType) {
    String groupDisplayId = TITLE;
    Notification notification = new Notification(groupDisplayId, title, message, notificationType);
    ApplicationManager.getApplication().getMessageBus().syncPublisher(Notifications.TOPIC).notify(notification);
  }
View Full Code Here

            @Override
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {
                    public void run() {
                        try {
                            Notifications.Bus.notify(new Notification("Floobits", "Floobits", message, notificationType), project);
                        } catch (Throwable e) {
                            Flog.warn(e);
                            Flog.log(message);
                        }
                    }
View Full Code Here

        }
    }

    public static void notifyEnableMessage(final Project project) {

        Notification notification = new Notification("Symfony2 Plugin", "Symfony2 Plugin", "Enable the Symfony2 Plugin in <a href=\"config\">Project Settings</a> or <a href=\"dismiss\">dismiss</a> further messages", NotificationType.INFORMATION, new NotificationListener() {
            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {

                // handle html click events
                if("config".equals(event.getDescription())) {

                    // open settings dialog and show panel
                    SettingsForm.show(project);

                } else if("dismiss".equals(event.getDescription())) {

                    // use dont want to show notification again
                    Settings.getInstance(project).dismissEnableNotification = true;
                }

                notification.expire();
            }

        });

        Notifications.Bus.notify(notification, project);
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.