Java Examples for com.intellij.notification.Notifications

The following java examples will help you to understand the usage of com.intellij.notification.Notifications. These source code samples are taken from different open source projects.

Example 1
Project: FrameSwitcher-master  File: DiagnosticAction.java View source code
public void actionPerformed(AnActionEvent e) {
    final RemoteSender remoteSender1 = FrameSwitcherApplicationComponent.getInstance().getRemoteSender();
    if (remoteSender1 instanceof RemoteSenderImpl) {
        final RemoteSenderImpl remoteSender = (RemoteSenderImpl) remoteSender1;
        Notification myNotification = new Notification("krasa.frameswitcher", "FrameSwitcher", remoteSender.getChannel().getProperties().replace(";", "\n"), NotificationType.INFORMATION, null);
        Notifications.Bus.notify(myNotification, getEventProject(e));
    }
}
Example 2
Project: i-pascal-master  File: PostStartupActivity.java View source code
@Override
public void runActivity(@NotNull Project project) {
    if (ModuleUtil.hasPascalModules(project)) {
        Notifications.Bus.notify(new Notification(PascalAppService.PASCAL_NOTIFICATION_GROUP, PascalBundle.message("app.welcome.title"), PascalBundle.message("app.welcome.text"), NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(true)));
    }
}
Example 3
Project: platform_tools_adt_idea-master  File: AndroidCompileUtil.java View source code
@Nullable
public static SourceFolder addSourceRoot(final ModifiableRootModel model, @NotNull final VirtualFile root) {
    ContentEntry contentEntry = findContentEntryForRoot(model, root);
    if (contentEntry == null) {
        final Project project = model.getProject();
        final String message = "Cannot mark directory '" + FileUtil.toSystemDependentName(root.getPath()) + "' as source root, because it is not located under content root of module '" + model.getModule().getName() + "'\n<a href='fix'>Open Project Structure</a>";
        final Notification notification = new Notification(AndroidBundle.message("android.autogeneration.notification.group"), "Autogeneration Error", message, NotificationType.ERROR, new NotificationListener.Adapter() {

            @Override
            protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
                notification.expire();
                final ProjectStructureConfigurable configurable = ProjectStructureConfigurable.getInstance(project);
                ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {

                    @Override
                    public void run() {
                        final Module module = model.getModule();
                        final AndroidFacet facet = AndroidFacet.getInstance(module);
                        if (facet != null) {
                            configurable.select(facet, true);
                        }
                    }
                });
            }
        });
        Notifications.Bus.notify(notification, project);
        LOG.debug(message);
        return null;
    } else {
        return contentEntry.addSourceFolder(root, JavaSourceRootType.SOURCE, JpsJavaExtensionService.getInstance().createSourceRootProperties("", true));
    }
}
Example 4
Project: consulo-master  File: LafManagerImpl.java View source code
private boolean checkLookAndFeel(final UIManager.LookAndFeelInfo lafInfo, final boolean confirm) {
    String message = null;
    if (lafInfo.getName().contains("GTK") && SystemInfo.isXWindow && !SystemInfo.isJavaVersionAtLeast("1.6.0_12")) {
        message = IdeBundle.message("warning.problem.laf.1");
    }
    if (message != null) {
        if (confirm) {
            final String[] options = { IdeBundle.message("confirm.set.look.and.feel"), CommonBundle.getCancelButtonText() };
            final int result = Messages.showOkCancelDialog(message, CommonBundle.getWarningTitle(), options[0], options[1], Messages.getWarningIcon());
            if (result == 0) {
                myLastWarning = message;
                return true;
            }
            return false;
        }
        if (!message.equals(myLastWarning)) {
            Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, "L&F Manager", message, NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER));
            myLastWarning = message;
        }
    }
    return true;
}
Example 5
Project: intellij-community-master  File: PythonSdkType.java View source code
public static void notifyRemoteSdkSkeletonsFail(final InvalidSdkException e, @Nullable final Runnable restartAction) {
    NotificationListener notificationListener;
    String notificationMessage;
    if (e.getCause() instanceof VagrantNotStartedException) {
        notificationListener = new NotificationListener() {

            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                final PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
                if (manager != null) {
                    try {
                        VagrantNotStartedException cause = (VagrantNotStartedException) e.getCause();
                        manager.runVagrant(cause.getVagrantFolder(), cause.getMachineName());
                    } catch (ExecutionException e1) {
                        throw new RuntimeException(e1);
                    }
                }
                if (restartAction != null) {
                    restartAction.run();
                }
            }
        };
        notificationMessage = e.getMessage() + "\n<a href=\"#\">Launch vagrant and refresh skeletons</a>";
    } else if (ExceptionUtil.causedBy(e, ExceptionFix.class)) {
        //noinspection ThrowableResultOfMethodCallIgnored
        final ExceptionFix fix = ExceptionUtil.findCause(e, ExceptionFix.class);
        notificationListener = new NotificationListener() {

            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                fix.apply();
                if (restartAction != null) {
                    restartAction.run();
                }
            }
        };
        notificationMessage = fix.getNotificationMessage(e.getMessage());
    } else {
        notificationListener = null;
        notificationMessage = e.getMessage();
    }
    Notifications.Bus.notify(new Notification(SKELETONS_TOPIC, "Couldn't refresh skeletons for remote interpreter", notificationMessage, NotificationType.WARNING, notificationListener));
}
Example 6
Project: intellij-plugins-master  File: FlexDebugProcess.java View source code
private void openFlexUnitConnections(final int socketPolicyPort, final int port) {
    try {
        myPolicyFileConnection = new SwfPolicyFileConnection();
        myPolicyFileConnection.open(socketPolicyPort);
        myFlexUnitConnection = new FlexUnitConnection();
        myFlexUnitConnection.addListener(new FlexUnitConnection.Listener() {

            @Override
            public void statusChanged(FlexUnitConnection.ConnectionStatus status) {
                if (status == FlexUnitConnection.ConnectionStatus.CONNECTION_FAILED) {
                    getSession().stop();
                }
            }

            @Override
            public void onData(String line) {
                getProcessHandler().notifyTextAvailable(line + "\n", ProcessOutputTypes.STDOUT);
            }

            @Override
            public void onFinish() {
                getProcessHandler().detachProcess();
            }
        });
        myFlexUnitConnection.open(port);
    } catch (ExecutionException e) {
        Notifications.Bus.notify(new Notification(DEBUGGER_GROUP_ID, FlexBundle.message("flex.debugger.startup.error"), FlexBundle.message("flexunit.startup.error", e.getMessage()), NotificationType.ERROR), getSession().getProject());
        myFlexUnitConnection = null;
        myPolicyFileConnection = null;
    }
}
Example 7
Project: lombok-intellij-plugin-master  File: LombokPluginProjectValidatorComponent.java View source code
@Override
public void projectOpened() {
    // If plugin is not enabled - no point to continue
    if (!ProjectSettings.isLombokEnabledInProject(project)) {
        return;
    }
    NotificationGroup group = new NotificationGroup(Version.PLUGIN_NAME, NotificationDisplayType.BALLOON, true);
    // Lombok dependency check
    boolean hasLombokLibrary = hasLombokLibrary(project);
    // If dependency is missing and missing dependency notification setting is enabled (defaults to disabled)
    if (!hasLombokLibrary && ProjectSettings.isEnabled(project, ProjectSettings.IS_MISSING_LOMBOK_CHECK_ENABLED, false)) {
        Notification notification = group.createNotification(LombokBundle.message("config.warn.dependency.missing.title"), LombokBundle.message("config.warn.dependency.missing.message", project.getName()), NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER);
        Notifications.Bus.notify(notification, project);
    }
    // If dependency is present and out of date notification setting is enabled (defaults to disabled)
    if (hasLombokLibrary && ProjectSettings.isEnabled(project, ProjectSettings.IS_LOMBOK_VERSION_CHECK_ENABLED, false)) {
        final ModuleManager moduleManager = ModuleManager.getInstance(project);
        for (Module module : moduleManager.getModules()) {
            String lombokVersion = parseLombokVersion(findLombokEntry(ModuleRootManager.getInstance(module)));
            if (null != lombokVersion && compareVersionString(lombokVersion, Version.LAST_LOMBOK_VERSION) < 0) {
                Notification notification = group.createNotification(LombokBundle.message("config.warn.dependency.outdated.title"), LombokBundle.message("config.warn.dependency.outdated.message", project.getName(), module.getName(), lombokVersion, Version.LAST_LOMBOK_VERSION), NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER);
                Notifications.Bus.notify(notification, project);
            }
        }
    }
    // Annotation Processing check
    boolean annotationProcessorsEnabled = hasAnnotationProcessorsEnabled(project);
    if (!annotationProcessorsEnabled) {
        String annotationProcessorsConfigName = new AnnotationProcessorsConfigurable(project).getDisplayName();
        Notification notification = group.createNotification(LombokBundle.message("config.warn.annotation-processing.disabled.title"), LombokBundle.message("config.warn.annotation-processing.disabled.message", project.getName()), NotificationType.ERROR, new SettingsOpeningListener(project, annotationProcessorsConfigName));
        Notifications.Bus.notify(notification, project);
    }
}
Example 8
Project: MavenHelper-master  File: GuiForm.java View source code
private void updateLeftPanel() {
    listDataModel.clear();
    leftTreeRoot.removeAllChildren();
    final String searchFieldText = searchField.getText();
    boolean conflictsWarning = false;
    boolean showNoConflictsLabel = false;
    if (conflictsRadioButton.isSelected()) {
        for (Map.Entry<String, List<MavenArtifactNode>> s : allArtifactsMap.entrySet()) {
            final List<MavenArtifactNode> nodes = s.getValue();
            if (nodes.size() > 1 && hasConflicts(nodes)) {
                if (searchFieldText == null || s.getKey().contains(searchFieldText)) {
                    listDataModel.addElement(new MyListNode(s));
                }
            }
        }
        showNoConflictsLabel = listDataModel.isEmpty();
        BuildNumber build = ApplicationInfoEx.getInstanceEx().getBuild();
        int baselineVersion = build.getBaselineVersion();
        MavenServerManager server = MavenServerManager.getInstance();
        boolean useMaven2 = server.isUseMaven2();
        boolean containsCompatResolver139 = server.getMavenEmbedderVMOptions().contains("-Dmaven3.use.compat.resolver");
        boolean containsCompatResolver140 = server.getMavenEmbedderVMOptions().contains("-Didea.maven3.use.compat.resolver");
        boolean newIDE = VersionComparatorUtil.compare(build.asStringWithoutProductCode(), "145.258") >= 0;
        boolean newMaven = VersionComparatorUtil.compare(server.getCurrentMavenVersion(), "3.1.1") >= 0;
        if (showNoConflictsLabel && baselineVersion >= 139) {
            boolean containsProperty = (baselineVersion == 139 && containsCompatResolver139) || (baselineVersion >= 140 && containsCompatResolver140);
            conflictsWarning = !containsProperty && !useMaven2;
            if (conflictsWarning && newIDE) {
                conflictsWarning = conflictsWarning && !newMaven;
            }
        }
        if (!conflictsWarning && newIDE && newMaven && containsCompatResolver140) {
            if (!notificationShown) {
                notificationShown = true;
                final Notification notification = ApplicationComponent.NOTIFICATION.createNotification("Fix your Maven VM options for importer", "<html>Your settings causes problems in multi-module Maven projects.<br> " + " <a href=\"fix\">Remove -Didea.maven3.use.compat.resolver</a> ", NotificationType.WARNING, new NotificationListener() {

                    @Override
                    public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent hyperlinkEvent) {
                        notification.expire();
                        String mavenEmbedderVMOptions = MavenServerManager.getInstance().getMavenEmbedderVMOptions();
                        MavenServerManager.getInstance().setMavenEmbedderVMOptions(mavenEmbedderVMOptions.replace("-Didea.maven3.use.compat.resolver", ""));
                        final MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project);
                        projectsManager.forceUpdateAllProjectsOrFindAllAvailablePomFiles();
                    }
                });
                ApplicationManager.getApplication().invokeLater(new Runnable() {

                    @Override
                    public void run() {
                        Notifications.Bus.notify(notification, project);
                    }
                });
            }
        }
        leftPanelLayout.show(leftPanelWrapper, "list");
    } else if (allDependenciesAsListRadioButton.isSelected()) {
        for (Map.Entry<String, List<MavenArtifactNode>> s : allArtifactsMap.entrySet()) {
            if (searchFieldText == null || s.getKey().contains(searchFieldText)) {
                listDataModel.addElement(new MyListNode(s));
            }
        }
        showNoConflictsLabel = false;
        leftPanelLayout.show(leftPanelWrapper, "list");
    } else // tree
    {
        fillLeftTree(leftTreeRoot, dependencyTree, searchFieldText);
        leftTreeModel.nodeStructureChanged(leftTreeRoot);
        TreeUtils.expandAll(leftTree);
        showNoConflictsLabel = false;
        leftPanelLayout.show(leftPanelWrapper, "allAsTree");
    }
    if (conflictsWarning) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                noConflictsWarningLabelScrollPane.getVerticalScrollBar().setValue(0);
            }
        });
        leftPanelLayout.show(leftPanelWrapper, "noConflictsWarningLabel");
    }
    buttonsPanel.setVisible(allDependenciesAsTreeRadioButton.isSelected());
    noConflictsWarningLabelScrollPane.setVisible(conflictsWarning);
    applyMavenVmOptionsFixButton.setVisible(conflictsWarning);
    noConflictsLabel.setVisible(showNoConflictsLabel);
}
Example 9
Project: MVPHelper-master  File: EventLogger.java View source code
/**
     * Print log to "Event Log"
     */
public static void log(String msg) {
    //build a notification
    Notification notification = new Notification(GROUP_ID, TITLE, msg, NotificationType.INFORMATION);
    //use the default bus to notify (application level)
    Notifications.Bus.notify(notification);
    //noinspection ConstantConditions: since the notification has been notified, the balloon won't be null.
    //try to hide the balloon immediately.
    notification.getBalloon().hide(true);
}
Example 10
Project: phonegap-intelliJ-plugin-master  File: PhoneGapDetectThread.java View source code
private void noPhoneGap() {
    String groupDisplayId = "PhoneGap notification";
    String notificationTitle = "PhoneGap Plugin";
    String notificationMessage = "PhoneGap can't run";
    NotificationType notificationType = NotificationType.ERROR;
    Notification notification = new Notification(groupDisplayId, notificationTitle, notificationMessage, notificationType);
    Notifications.Bus.notify(notification);
}
Example 11
Project: run-after-tests-master  File: MyTestStatusListener.java View source code
private void runCommand(String command) {
    if ("".equals(command)) {
        Notifications.Bus.notify(new Notification("wnl", "Run After Tests", "Would have ran a command, if it were configured.", NotificationType.INFORMATION));
    } else
        Notifications.Bus.notify(new Notification("wnl", "Run After Tests", "Running command: " + command, NotificationType.INFORMATION));
    try {
        Process proc = Runtime.getRuntime().exec(command);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Example 12
Project: AndroidWiFiADB-master  File: NotificationUtils.java View source code
public static void showNotification(final String message, final NotificationType type) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {

        @Override
        public void run() {
            Notification notification = NOTIFICATION_GROUP.createNotification(ANDROID_WIFI_ADB_TITLE, message, type, null);
            Notifications.Bus.notify(notification);
        }
    });
}
Example 13
Project: freeline-master  File: NotificationUtils.java View source code
/**
     * show a Notification
     *
     * @param message
     * @param type
     */
public static void showNotification(final String message, final NotificationType type) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {

        @Override
        public void run() {
            Notification notification = NOTIFICATION_GROUP.createNotification(TITLE, message, type, null);
            Notifications.Bus.notify(notification);
        }
    });
}
Example 14
Project: go-lang-idea-plugin-master  File: GoModuleLibrariesInitializer.java View source code
private static void showNotification(@NotNull Project project) {
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    PropertiesComponent projectPropertiesComponent = PropertiesComponent.getInstance(project);
    boolean shownAlready;
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (propertiesComponent) {
        shownAlready = propertiesComponent.getBoolean(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false) || projectPropertiesComponent.getBoolean(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false);
        if (!shownAlready) {
            propertiesComponent.setValue(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, String.valueOf(true));
        }
    }
    if (!shownAlready) {
        NotificationListener.Adapter notificationListener = new NotificationListener.Adapter() {

            @Override
            protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED && "configure".equals(event.getDescription())) {
                    GoLibrariesConfigurableProvider.showModulesConfigurable(project);
                }
            }
        };
        Notification notification = GoConstants.GO_NOTIFICATION_GROUP.createNotification("GOPATH was detected", "We've detected some libraries from your GOPATH.\n" + "You may want to add extra libraries in <a href='configure'>Go Libraries configuration</a>.", NotificationType.INFORMATION, notificationListener);
        Notifications.Bus.notify(notification, project);
    }
}
Example 15
Project: GrepConsole-master  File: Notifier.java View source code
public static void notify_InputAndHighlight(String substring, GrepProcessor grepProcessor, final Project project) {
    final Notification notification = GrepConsoleApplicationComponent.NOTIFICATION.createNotification("Grep Console plugin: processing took too long, aborting to prevent GUI freezing.\n" + "Consider changing following settings: 'Match only first N characters on each line' or 'Max processing time for a line'\n" + "Last expression: [" + grepProcessor + "]\n" + "Line: " + Utils.toNiceLineForLog(substring) + "\n(More notifications will not be displayed for this console filter. Notification can be disabled at File | Settings | Appearance & Behavior | Notifications`)", MessageType.WARNING);
    ApplicationManager.getApplication().invokeLater(new Runnable() {

        @Override
        public void run() {
            Notifications.Bus.notify(notification, project);
        }
    });
}
Example 16
Project: intellij-haskell-master  File: HaskellStylishFormatAction.java View source code
@Override
public void run() {
    try {
        final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null)
            return;
        CommandProcessor.getInstance().executeCommand(project, new Runnable() {

            @Override
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {

                    @Override
                    public void run() {
                        document.setText(text);
                    }
                });
            }
        }, NOTIFICATION_TITLE, "", document);
        Notifications.Bus.notify(new Notification(groupId, NOTIFICATION_TITLE, psiFile.getName() + " formatted with Stylish-Haskell.", NotificationType.INFORMATION), project);
    } catch (Exception ex) {
        Notifications.Bus.notify(new Notification(groupId, "Formatting " + psiFile.getName() + "  with Stylish-Haskell failed.", ExceptionUtil.getUserStackTrace(ex, LOG), NotificationType.ERROR), project);
        LOG.error(ex);
    }
}
Example 17
Project: intellij-haskforce-master  File: HaskellStylishFormatAction.java View source code
@Override
public void run() {
    try {
        final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null)
            return;
        CommandProcessor.getInstance().executeCommand(project, new Runnable() {

            @Override
            public void run() {
                ApplicationManager.getApplication().runWriteAction(new Runnable() {

                    @Override
                    public void run() {
                        document.setText(text);
                    }
                });
            }
        }, NOTIFICATION_TITLE, "", document);
        Notifications.Bus.notify(new Notification(groupId, NOTIFICATION_TITLE, psiFile.getName() + " formatted with Stylish-Haskell.", NotificationType.INFORMATION), project);
    } catch (Exception ex) {
        Notifications.Bus.notify(new Notification(groupId, "Formatting " + psiFile.getName() + "  with Stylish-Haskell failed.", ExceptionUtil.getUserStackTrace(ex, LOG), NotificationType.ERROR), project);
        LOG.error(ex);
    }
}
Example 18
Project: intellij-pants-plugin-master  File: FileChangeTracker.java View source code
/**
   * Template came from maven plugin:
   * https://github.com/JetBrains/intellij-community/blob/b5d046018b9a82fccd86bc9c1f1da2e28068440a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenImportNotifier.java#L92-L108
   */
private static void notifyProjectRefreshIfNecessary(@NotNull VirtualFile file, final Project project) {
    // If there is standing refresh notification, do not proceed to issue another notification.
    if (hasExistingRefreshNotification(project)) {
        return;
    }
    NotificationListener.Adapter refreshAction = new NotificationListener.Adapter() {

        @Override
        protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            if (HREF_REFRESH.equals(event.getDescription())) {
                PantsUtil.refreshAllProjects(project);
            }
            notification.expire();
        }
    };
    if (PantsUtil.isBUILDFileName(file.getName())) {
        Notification myNotification = new Notification(PantsConstants.PANTS, PantsBundle.message("pants.project.build.files.changed"), "<a href='" + HREF_REFRESH + "'>" + REFRESH_PANTS_PROJECT_DISPLAY + "</a> ", NotificationType.INFORMATION, refreshAction);
        Notifications.Bus.notify(myNotification, project);
    }
}
Example 19
Project: needsmoredojo-master  File: UtilToClassConverter.java View source code
@Override
public void run(Object[] result) {
    final DeclareStatementItems item = new DeclareResolver().getDeclareStatementFromParsedStatement(result);
    if (item == null) {
        Notifications.Bus.notify(new Notification("needsmoredojo", "Convert util module to class module", "Valid declare block was not found", NotificationType.WARNING));
        return;
    }
    final List<JSExpressionStatement> methods = (List<JSExpressionStatement>) result[2];
    final JSVarStatement declarationVariable = (JSVarStatement) result[3];
    CommandProcessor.getInstance().executeCommand(item.getDeclareContainingStatement().getProject(), new Runnable() {

        @Override
        public void run() {
            ApplicationManager.getApplication().runWriteAction(new Runnable() {

                @Override
                public void run() {
                    PsiElement parent = item.getDeclareContainingStatement().getParent();
                    doRefactor(item.getClassName(), item.getExpressionsToMixin(), methods, item.getDeclareContainingStatement(), declarationVariable);
                    // all of those deletions creates a ton of whitespace for some reason. So, delete it!
                    cleanupWhiteSpace(parent);
                }
            });
        }
    }, "Convert util module to class module", "Convert util module to class module");
}
Example 20
Project: buck-master  File: BuckModuleTest.java View source code
@Test
public void hasBuckModuleInitThenActionToolbarPopupShownOnce() {
    Project project = initBuckModule();
    Field field = BuckPluginNotifications.class.getDeclaredFields()[0];
    field.setAccessible(true);
    NotificationsAdapterTester notificationsAdapterTester = new NotificationsAdapterTester();
    project.getMessageBus().connect().subscribe(Notifications.TOPIC, notificationsAdapterTester);
    new BuckModule(project).projectOpened();
    try {
        String groupId = field.get(field.getType()).toString();
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
        new BuckModule(project);
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
        new BuckModule(project);
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    assertEquals(notificationsAdapterTester.countCalls, 1);
}
Example 21
Project: embeddedlinux-jvmdebugger-intellij-master  File: ProjectUtils.java View source code
@Override
public void run() {
    final RunManager runManager = RunManager.getInstance(module.getProject());
    final RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(module.getName(), EmbeddedLinuxJVMConfigurationType.getInstance().getFactory());
    final EmbeddedLinuxJVMRunConfiguration configuration = (EmbeddedLinuxJVMRunConfiguration) settings.getConfiguration();
    configuration.setName(EmbeddedLinuxJVMBundle.message("runner.name", boardName));
    configuration.getRunnerParameters().setRunAsRoot(true);
    configuration.getRunnerParameters().setMainclass(mainClass);
    runManager.addConfiguration(settings, false);
    runManager.setSelectedConfiguration(settings);
    final Notification notification = new Notification(Notifications.GROUPDISPLAY_ID, EmbeddedLinuxJVMBundle.getString("pi.connection.required"), EmbeddedLinuxJVMBundle.message("pi.connection.notsetup", boardName), NotificationType.INFORMATION);
    com.intellij.notification.Notifications.Bus.notify(notification);
}
Example 22
Project: intellij-background-chibichara-master  File: BackgroundChibiCharaSettingsForm.java View source code
@Override
public void actionPerformed(ActionEvent actionEvent) {
    JFileChooser fileChooser = intiFileChooser();
    int returnVal = fileChooser.showDialog(getComponent(), null);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File[] files = fileChooser.getSelectedFiles();
        List<String> filepathList = new ArrayList<String>();
        for (File file : files) {
            filepathList.add(file.getAbsolutePath());
            Notifications.Bus.notify(new Notification("", "", file.getAbsolutePath(), NotificationType.ERROR));
        }
        addFilepathList(filepathList);
    }
}
Example 23
Project: intellij-thesaurus-master  File: ThesaurusAction.java View source code
public void actionPerformed(AnActionEvent e) {
    Editor editor = e.getData(PlatformDataKeys.EDITOR);
    PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE);
    if (psiFile == null || editor == null) {
        return;
    }
    if (false == isRenameAllowed(e, editor))
        return;
    String originalWord = getOriginalWord(editor);
    try {
        List<String> synonyms = downloadSynonyms(originalWord);
        ListPopup listPopup = JBPopupFactory.getInstance().createListPopup(new ThesaurusListPopupStep("Thesaurus", synonyms.toArray(), editor, psiFile));
        listPopup.showInBestPositionFor(editor);
    } catch (IOException ioe) {
        System.out.println("Exception! " + ioe.getMessage());
        Notification notification = new Notification("Thesaurus", "Thesaurus", "No synonyms available for '" + originalWord + "'", NotificationType.ERROR);
        Notifications.Bus.notify(notification, editor.getProject());
    }
}
Example 24
Project: platform_build-master  File: BuckModuleTest.java View source code
@Test
public void hasBuckModuleInitThenActionToolbarPopupShownOnce() {
    Project project = initBuckModule();
    Field field = BuckPluginNotifications.class.getDeclaredFields()[0];
    field.setAccessible(true);
    NotificationsAdapterTester notificationsAdapterTester = new NotificationsAdapterTester();
    project.getMessageBus().connect().subscribe(Notifications.TOPIC, notificationsAdapterTester);
    new BuckModule(project).projectOpened();
    try {
        String groupId = field.get(field.getType()).toString();
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
        new BuckModule(project);
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
        new BuckModule(project);
        assertTrue(PropertiesComponent.getInstance().isValueSet(groupId));
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    assertEquals(notificationsAdapterTester.countCalls, 1);
}
Example 25
Project: randori-plugin-intellij-master  File: NotificationUtils.java View source code
public static void sendRandoriNotification(String title, String message, final Project project, NotificationType notificationType) {
    final Notification notification = new Notification(RANDORI, title, message, notificationType, new NotificationListener() {

        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                openAssociatedWindow(event, project);
            }
        }
    });
    notification.hideBalloon();
    Notifications.Bus.notify(notification, project);
}
Example 26
Project: asciidoctor-intellij-plugin-master  File: AsciiDocPreviewEditor.java View source code
@Override
public void run() {
    try {
        if (!document.getText().equals(currentContent)) {
            currentContent = document.getText();
            String markup = asciidoc.get().render(currentContent);
            if (markup != null) {
                myPanel.setHtml(markup);
            }
        }
        if (currentLineNo != targetLineNo) {
            currentLineNo = targetLineNo;
            myPanel.scrollToLine(targetLineNo, document.getLineCount());
        }
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
    } catch (Exception ex) {
        String message = "Error rendering asciidoctor: " + ex.getMessage();
        Notification notification = NOTIFICATION_GROUP.createNotification("Error rendering asciidoctor", message, NotificationType.ERROR, null);
        notification.setImportant(true);
        Notifications.Bus.notify(notification);
    }
}
Example 27
Project: EclipseCodeFormatter-master  File: Notifier.java View source code
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 = ProjectSettingsComponent.GROUP_DISPLAY_ID_ERROR.createNotification(content, NotificationType.ERROR);
    ApplicationManager.getApplication().invokeLater(new Runnable() {

        @Override
        public void run() {
            Notifications.Bus.notify(notification, project);
        }
    });
}
Example 28
Project: Intellij-Plugin-master  File: GaugeModuleComponent.java View source code
@Override
public void projectOpened() {
    if (GaugeUtil.isGaugeModule(module) && GaugeVersion.isLessThan(GAUGE_SUPPORTED_VERSION)) {
        String message = "This plugin version supports Gauge " + GAUGE_SUPPORTED_VERSION + " or above. Please refer <a href=\"https://docs.getgauge.io/installing.html\">this doc</a> to update Gauge.";
        Notification notification = new Notification("Gauge", "Version Incompatible", message, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER);
        Notifications.Bus.notify(notification, module.getProject());
        return;
    }
    new LibHelperFactory().helperFor(module).checkDeps();
}
Example 29
Project: limited-wip-master  File: DisableLargeCommitsAppComponent.java View source code
private void notifyThatCommitWasCancelled(Project project) {
    NotificationListener listener = new NotificationListener() {

        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            allowCommitOnceWithoutCheck = true;
            boolean succeeded = showCommitDialog(0);
            if (!succeeded) {
                allowCommitOnceWithoutCheck = false;
            }
        }
    };
    Notification notification = new Notification(PluginId.displayName, "Commit was cancelled because change size is above threshold<br/>", "(<a href=\"\">Click here</a> to force commit anyway)", NotificationType.ERROR, listener);
    project.getMessageBus().syncPublisher(Notifications.TOPIC).notify(notification);
}
Example 30
Project: MPS-master  File: ModelStorageProblemsListener.java View source code
public void run() {
    if (myLastNotification != null) {
        myLastNotification.expire();
    }
    myLastNotification = new Notification("Model Persistence", (isSave ? "Save Failure" : "Load Failure"), message, NotificationType.WARNING, new NotificationListener() {

        public void hyperlinkUpdate(@NotNull Notification p0, @NotNull HyperlinkEvent e) {
            if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
                return;
            }
            SNodeReference ref = errMap.get(e.getDescription());
            assert ref != null;
            new EditorNavigator(project).shallFocus(true).shallSelect(true).open(ref);
        }
    });
    myLastModel = ref;
    Notifications.Bus.notify(myLastNotification);
}
Example 31
Project: netbeans-mmd-plugin-master  File: IdeaIDEBridge.java View source code
@Override
public void run() {
    final long timestamp = System.currentTimeMillis();
    final Notification notification = new Notification(MMD_GROUP.getDisplayId(), StringEscapeUtils.escapeHtml(title), StringEscapeUtils.escapeHtml(text), ideType) {

        @Nullable
        @Override
        public Icon getIcon() {
            return AllIcons.Logo.MINDMAP;
        }

        public long getTimestamp() {
            return timestamp;
        }
    };
    Notifications.Bus.notify(notification);
}
Example 32
Project: review-board-idea-plugin-master  File: ShowReviewBoard.java View source code
@Override
public void actionPerformed(final AnActionEvent e) {
    try {
        final Project project = e.getProject();
        final IVcsDiffProvider vcsDiffProvider = VcsDiffProviderFactory.getVcsDiffProvider(project, ReviewDataProvider.getConfiguration(project));
        ApplicationManager.getApplication().runWriteAction(new Runnable() {

            public void run() {
                FileDocumentManager.getInstance().saveAllDocuments();
            }
        });
        if (vcsDiffProvider == null) {
            Notifications.Bus.notify(new Notification("ReviewBoard", PluginBundle.message(PluginBundle.UNSUPPORTED_VCS_TITLE), PluginBundle.message(PluginBundle.UNSUPPORTED_VCS_MESSAGE), NotificationType.WARNING));
            return;
        }
        if (vcsDiffProvider.isFromRevision(project, e) || Messages.showOkCancelDialog(project, "Upload all local changes?", "Confirmation", AllIcons.General.BalloonWarning) == Messages.OK) {
            TaskUtil.queueTask(project, "Generating diff", false, new ThrowableFunction<ProgressIndicator, Object>() {

                @Override
                public Object throwableCall(ProgressIndicator params) throws Exception {
                    final String diffContent;
                    try {
                        diffContent = vcsDiffProvider.generateDiff(project, e);
                        ApplicationManager.getApplication().invokeLater(new Runnable() {

                            @Override
                            public void run() {
                                if (isEmpty(diffContent)) {
                                    Messages.showErrorDialog(project, "Cannot generate diff", "Error");
                                } else {
                                    showCreateReviewPanel(project, diffContent);
                                }
                            }
                        });
                    } catch (Exception ex) {
                        ExceptionHandler.handleException(ex);
                    }
                    return null;
                }
            }, null, null);
        }
    } catch (Exception ex) {
        ExceptionHandler.handleException(ex);
    }
}
Example 33
Project: sonar-intellij-plugin-master  File: RunLocalAnalysisScriptTask.java View source code
private void execute() {
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    ProgressIndicatorUtil.setText(indicator, "Executing SonarQube local analysis");
    ProgressIndicatorUtil.setText2(indicator, sourceCode);
    ProgressIndicatorUtil.setIndeterminate(indicator, true);
    final Optional<SonarServerConfig> sonarServerConfig = SonarServers.get(enrichedSettings.settings.getServerName());
    if (sonarServerConfig.isPresent() && !sonarServerConfig.get().isAnonymous() && !StringUtil.isEmptyOrSpaces(sonarServerConfig.get().getUser())) {
        final String password = sonarServerConfig.get().loadPassword();
        sonarConsole.withPasswordFilter(password);
    }
    sonarConsole.info("working dir: " + this.workingDir.getPath());
    sonarConsole.info("executing: " + this.sourceCode);
    final long startTime = System.currentTimeMillis();
    final Process process;
    try {
        process = Runtime.getRuntime().exec(this.sourceCode.split("[\\s]+"), null, this.workingDir);
    } catch (IOException e) {
        sonarConsole.error(Throwables.getStackTraceAsString(e));
        return;
    }
    final StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), sonarConsole, ERROR);
    final StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), sonarConsole, INFO);
    errorGobbler.start();
    outputGobbler.start();
    while (outputGobbler.isAlive()) {
        if (indicator.isCanceled()) {
            process.destroy();
            break;
        }
    }
    try {
        process.waitFor();
    } catch (InterruptedException e) {
        sonarConsole.info("Unexpected end of process.\n" + Throwables.getStackTraceAsString(e));
    }
    try {
        int exitCode = process.exitValue();
        sonarConsole.info(String.format("finished with exit code %s in %s", exitCode, DurationUtil.getDurationBreakdown(System.currentTimeMillis() - startTime)));
        if (exitCode != 0) {
            Notifications.Bus.notify(new Notification("SonarQube", "SonarQube", String.format("Local analysis failed (%d)", exitCode), NotificationType.WARNING), enrichedSettings.project);
        } else {
            readIssuesFromSonarReport();
        }
    } catch (IllegalThreadStateException ite) {
        sonarConsole.info("Script execution aborted.\n" + Throwables.getStackTraceAsString(ite));
    }
}
Example 34
Project: ali-idea-plugin-master  File: HpAlmRepositoryTest.java View source code
@Test
public void testGetIssues_storedQuery_missing() throws Exception {
    HpAlmRepository repository = new HpAlmRepository(getProject().getName(), 1);
    repository._assignProject();
    TaskConfig config = new TaskConfig("defect");
    config.setEnabled(false);
    repository.setDefect(config);
    TaskConfig reqConfig = new TaskConfig("requirement");
    reqConfig.setCustomSelected(false);
    reqConfig.setStoredQuery("fav2 (project)");
    repository.setRequirement(reqConfig);
    final MessageBusConnection connection = getProject().getMessageBus().connect();
    handler.async();
    connection.subscribe(Notifications.TOPIC, new Notifications() {

        @Override
        public void notify(@NotNull Notification notification) {
            Assert.assertEquals("HP ALM Integration", notification.getGroupId());
            Assert.assertEquals("Cannot retrieve task information from HP ALM:<br/> 'fav2 (project)' query not found", notification.getTitle());
            Assert.assertEquals(NotificationType.ERROR, notification.getType());
            connection.disconnect();
            handler.done();
        }

        @Override
        public void register(@NotNull String groupDisplayName, @NotNull NotificationDisplayType defaultDisplayType) {
        }

        @Override
        public void register(@NotNull String groupDisplayName, @NotNull NotificationDisplayType defaultDisplayType, boolean shouldLog) {
        }

        // needed for 13, adapter class not defined in 12.1.1
        public void register(@NotNull String groupDisplayName, @NotNull NotificationDisplayType defaultDisplayType, boolean shouldLog, boolean shouldReadAloud) {
        }
    });
    Task[] list = repository.getIssues("foo", 5, 100);
    Assert.assertEquals(0, list.length);
}
Example 35
Project: DLangPlugin-master  File: DLangRunDubState.java View source code
@NotNull
@Override
protected ProcessHandler startProcess() throws ExecutionException {
    try {
        GeneralCommandLine dubCommandLine = getExecutableCommandLine(config);
        return new OSProcessHandler(dubCommandLine.createProcess(), dubCommandLine.getCommandLineString());
    } catch (ModuleNotFoundException e) {
        throw new ExecutionException("Run configuration has no module selected.");
    } catch (NoDubExecutableException e) {
        throw new ExecutionException("DUB executable is not specified.<a href='configure'>Configure</a> DUB settings");
    } catch (ExecutionException e) {
        String message = e.getMessage();
        boolean isEmpty = message.equals("Executable is not specified");
        boolean notCorrect = message.startsWith("Cannot run program");
        if (isEmpty || notCorrect) {
            Notifications.Bus.notify(new Notification("DUB run configuration", "DUB settings", "DUB executable path is " + (isEmpty ? "empty" : "not specified correctly") + "<br/><a href='configure'>Configure</a> output folder", NotificationType.ERROR), config.getProject());
        }
        throw e;
    }
}
Example 36
Project: idea-gitignore-master  File: UserTemplateDialog.java View source code
/**
     * Creates new user template.
     */
private void performCreateAction() {
    IgnoreSettings.UserTemplate template = new IgnoreSettings.UserTemplate(name.getText(), previewDocument.getText());
    settings.getUserTemplates().add(template);
    Notifications.Bus.notify(new Notification(IgnoreBundle.PLUGIN_ID, IgnoreBundle.message("dialog.userTemplate.added"), IgnoreBundle.message("dialog.userTemplate.added.description", template.getName()), NotificationType.INFORMATION), project);
    super.doOKAction();
}
Example 37
Project: idea-ofbiz-plugin-master  File: OfbizFrameworkSupportProvider.java View source code
public void run() {
    final VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots();
    if (sourceRoots.length <= 0) {
        return;
    }
    final PsiDirectory directory = PsiManager.getInstance(module.getProject()).findDirectory(sourceRoots[0]);
    if (directory == null || directory.findFile(Constants.CONTROLLER_XML_DEFAULT_FILENAME) != null) {
        return;
    }
    try {
        final OfbizFacetConfiguration ofbizFacetConfiguration = ofbizFacet.getConfiguration();
        final Set<OfbizFileSet> empty = Collections.emptySet();
        final OfbizFileSet controllerFileSet = new OfbizFileSet(OfbizFileSet.getUniqueId(empty), OfbizFileSet.getUniqueName("Controller Default File Set", empty), ofbizFacetConfiguration);
        final OfbizConfigsSercher searcher = new OfbizControllerConfigsSearcher(module);
        searcher.search();
        final MultiMap<Module, PsiFile> configFiles = searcher.getFilesByModules();
        for (PsiFile psiFile : configFiles.values()) {
            controllerFileSet.addFile(psiFile.getVirtualFile());
        }
        ofbizFacetConfiguration.getControllerFileSets().add(controllerFileSet);
        //service fileset
        final OfbizFileSet serviceFileSet = new OfbizFileSet(OfbizFileSet.getUniqueId(empty), OfbizFileSet.getUniqueName("Services Default File Set", empty), ofbizFacetConfiguration);
        final OfbizConfigsSercher serviceSearcher = new OfbizServiceConfigsSearcher(module);
        serviceSearcher.search();
        final MultiMap<Module, PsiFile> serviceConfigFiles = serviceSearcher.getFilesByModules();
        for (PsiFile psiFile : serviceConfigFiles.values()) {
            serviceFileSet.addFile(psiFile.getVirtualFile());
        }
        ofbizFacetConfiguration.getServiceFileSets().add(serviceFileSet);
        final NotificationListener showFacetSettingsListener = new NotificationListener() {

            public void hyperlinkUpdate(@NotNull final Notification notification, @NotNull final HyperlinkEvent event) {
                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                    notification.expire();
                    ModulesConfigurator.showFacetSettingsDialog(ofbizFacet, null);
                }
            }
        };
        Notifications.Bus.notify(new Notification("Ofbiz", "Ofbiz Setup", "Ofbiz Facet has been created, please check <a href=\"more\">created fileset</a>", NotificationType.INFORMATION, showFacetSettingsListener), module.getProject());
    } catch (Exception e) {
        LOG.error("error creating struts.xml from template", e);
    }
}
Example 38
Project: idea-php-symfony2-plugin-master  File: IdeHelper.java View source code
public static void notifyEnableMessage(final Project project) {
    Notification notification = new Notification("Symfony Plugin", "Symfony Plugin", "Enable the Symfony Plugin <a href=\"enable\">with auto configuration now</a>, open <a href=\"config\">Project Settings</a> or <a href=\"dismiss\">dismiss</a> further messages", NotificationType.INFORMATION, ( notification1,  event) -> {
        // handle html click events
        if ("config".equals(event.getDescription())) {
            // open settings dialog and show panel
            SettingsForm.show(project);
        } else if ("enable".equals(event.getDescription())) {
            enablePluginAndConfigure(project);
            Notifications.Bus.notify(new Notification("Symfony Plugin", "Symfony Plugin", "Plugin enabled", NotificationType.INFORMATION), project);
        } else if ("dismiss".equals(event.getDescription())) {
            // use dont want to show notification again
            Settings.getInstance(project).dismissEnableNotification = true;
        }
        notification1.expire();
    });
    Notifications.Bus.notify(notification, project);
}
Example 39
Project: intellij-demandware-master  File: DWUpdateFileTask.java View source code
@Override
public void run(@NotNull ProgressIndicator indicator) {
    boolean isNewRemoteFile = true;
    ConsoleView consoleView = ServiceManager.getService(project, DWConsoleService.class).getConsoleView();
    indicator.setFraction(.33);
    HttpUriRequest getRequest = RequestBuilder.create("HEAD").setUri(remoteFilePath).build();
    try (CloseableHttpResponse response = httpClient.execute(getRequest, context)) {
        if (response.getStatusLine().getStatusCode() == 200) {
            isNewRemoteFile = false;
        }
        if (response.getStatusLine().getStatusCode() == 401) {
            Notifications.Bus.notify(new Notification("Demandware", "Unauthorized Request", "Please check your server configuration in the Demandware facet settings.", NotificationType.INFORMATION));
            return;
        }
    } catch (UnknownHostException e) {
        Notifications.Bus.notify(new Notification("Demandware", "Unknown Host", "Please check your server configuration in the Demandware facet settings.", NotificationType.INFORMATION));
        return;
    } catch (IOException e) {
        e.printStackTrace();
    }
    indicator.setFraction(.5);
    // Create Remote Directories if file is a new local or remote file
    if (isNewRemoteFile) {
        for (String path : remoteDirPaths) {
            HttpUriRequest mkcolRequest = RequestBuilder.create("MKCOL").setUri(path + "/").build();
            try (CloseableHttpResponse response = httpClient.execute(mkcolRequest, context)) {
                if (response.getStatusLine().getStatusCode() == 201) {
                    Date now = new Date();
                    consoleView.print("[" + timeFormat.format(now) + "] " + "Created " + mkcolRequest.getURI().toString() + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    indicator.setFraction(.80);
    // Put remote file
    HttpUriRequest request = RequestBuilder.create("PUT").setUri(remoteFilePath).setEntity(new FileEntity(new File(localFilePath))).build();
    try (CloseableHttpResponse response = httpClient.execute(request, context)) {
        if (isNewRemoteFile) {
            Date now = new Date();
            consoleView.print("[" + timeFormat.format(now) + "] " + "Created " + request.getURI().toString() + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
        } else {
            Date now = new Date();
            consoleView.print("[" + timeFormat.format(now) + "] " + "Updated " + request.getURI().toString() + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
        }
    } catch (IOException e) {
        LOG.error(e);
    }
    indicator.setFraction(1);
}
Example 40
Project: intellij-elixir-master  File: MixRunningStateUtil.java View source code
@NotNull
public static OSProcessHandler runMix(Project project, GeneralCommandLine commandLine) throws ExecutionException {
    try {
        return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
    } catch (ExecutionException e) {
        String message = e.getMessage();
        boolean isEmpty = "Executable is not specified".equals(message);
        boolean notCorrect = message.startsWith("Cannot run program");
        if (isEmpty || notCorrect) {
            Notifications.Bus.notify(new Notification("Mix run configuration", "Mix settings", "Mix executable path is " + (isEmpty ? "empty" : "not specified correctly") + "<br><a href='configure'>Configure</a></br>", NotificationType.ERROR, new ElixirExternalToolsNotificationListener(project)));
        }
        throw e;
    }
}
Example 41
Project: intellij-erlang-master  File: RebarEunitRerunFailedTestsAction.java View source code
private void notifyGeneratedTestsFailed(final List<ErlangFunction> failedGeneratedTests) {
    ApplicationManager.getApplication().invokeLater(() -> Notifications.Bus.notify(new Notification("TestRunner", "Some tests cannot be rerun directly", "Some of failed tests were obtained via generator functions and cannot be rerun directly.\n" + createFailedTestsListMessage(failedGeneratedTests), NotificationType.WARNING)));
}
Example 42
Project: old-gosu-repo-master  File: ExceptionUtil.java View source code
// Reporting errros
public static void showError(@NotNull String title, @NotNull Throwable t) {
    System.err.println("DEV MODE ERROR REPORTING (REMOVE IN PRODUCTION)");
    t.printStackTrace();
    while (t.getCause() != null) {
        t = t.getCause();
    }
    String realError = t.getMessage();
    realError = realError != null ? realError : t.getClass().getSimpleName();
    realError = formatToHTML(realError);
    Notifications.Bus.notify(new Notification(GOSU_NOTIFICATION_GROUP, title, realError, NotificationType.ERROR));
}
Example 43
Project: railways-master  File: RailwaysUtils.java View source code
/**
     * Internally used method that runs rake task and gets its output. This
     * method should be called from backgroundable task.
     *
     * @param module Rails module for which rake task should be run.
     * @return Output of 'rake routes'.
     */
@Nullable
public static ProcessOutput queryRakeRoutes(Module module, String routesTaskName, String railsEnv) {
    // Get root path of Rails application from module.
    RailsApp app = RailsApp.fromModule(module);
    if ((app == null) || (app.getRailsApplicationRoot() == null))
        return null;
    String moduleContentRoot = app.getRailsApplicationRoot().getPresentableUrl();
    ModuleRootManager mManager = ModuleRootManager.getInstance(module);
    Sdk sdk = mManager.getSdk();
    if (sdk == null) {
        Notifications.Bus.notify(new Notification("Railways", "Railways Error", "Cannot update route list for '" + module.getName() + "' module, because its SDK is not set", NotificationType.ERROR), module.getProject());
        return null;
    }
    try {
        railsEnv = (railsEnv == null) ? "" : "RAILS_ENV=" + railsEnv;
        // Will work on IntelliJ platform since 122.633 build (RubyMine 5)
        return GemsRunner.runGemsExecutableScript(sdk, module, "rake", "rake", moduleContentRoot, new ExecutionModes.SameThreadMode(), routesTaskName, "--trace", railsEnv);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
Example 44
Project: CommunityCase-master  File: PushActiveBranchesDialog.java View source code
/**
   * Notifies about error, when 'rebase and push' task is executed, i.e. when the dialog is closed.
   */
private void notifyExceptionWhenClosed(String title, Collection<VcsException> exceptions) {
    final String content = StringUtil.join(exceptions, new Function<VcsException, String>() {

        @Override
        public String fun(VcsException e) {
            return e.getLocalizedMessage();
        }
    }, "<br/>");
    Notifications.Bus.notify(new Notification(Vcs.NOTIFICATION_GROUP_ID, title, content, NotificationType.ERROR), myProject);
}
Example 45
Project: Grammar-Kit-master  File: BnfRunJFlexAction.java View source code
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    final Project project = getEventProject(e);
    final List<VirtualFile> files = getFiles(e);
    if (project == null || files.isEmpty())
        return;
    PsiDocumentManager.getInstance(project).commitAllDocuments();
    FileDocumentManager.getInstance().saveAllDocuments();
    final List<File> jflex = getOrDownload(project, JETBRAINS_JFLEX_URLS);
    if (jflex.isEmpty()) {
        fail(project, "JFlex jar not found", "Create global library with jflex-xxx.jar and idea-flex.skeleton file to fix.");
        return;
    }
    if (StringUtil.endsWithIgnoreCase(jflex.get(0).getName(), "JFlex.jar")) {
        String DOC_URL = "http://jflex.de/changelog.html";
        Notifications.Bus.notify(new Notification(BnfConstants.GENERATION_GROUP, "An old JFlex.jar is detected", jflex.get(0).getAbsolutePath() + "<br>See <a href=\"" + DOC_URL + "\">" + DOC_URL + "</a>." + "<br><b>Compatibility note</b>: . (dot) semantics is changed, use [^] instead of .|\\n." + "<br><b>To update</b>: remove the old version and the global library if present." + "", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER), project);
    }
    new Runnable() {

        boolean first = true;

        Iterator<VirtualFile> it = files.iterator();

        @Override
        public void run() {
            if (it.hasNext()) {
                doGenerate(project, it.next(), jflex, first).doWhenProcessed(this);
                first = false;
            }
        }
    }.run();
}
Example 46
Project: idea-comics-master  File: ComicsPanelImpl.java View source code
private void notifyNewEntry() {
    @NotNull final Notification newEntryNotification = new Notification(MessageBundle.message("notification.new.strip.group"), MessageBundle.message("notification.new.strip.title"), MessageBundle.message("notification.new.strip.content"), NotificationType.INFORMATION);
    Notifications.Bus.notify(newEntryNotification);
}
Example 47
Project: idea-php-typo3-plugin-master  File: GenerateFscElementForm.java View source code
/**
     * Does the actual code generation.
     */
private void generate() {
    String formElementName = this.elementName.getText();
    String formElementTitle = this.elementTitle.getText();
    String formElementDescription = this.elementDescription.getText();
    String successMessage = "New Content Element \"" + formElementName + "\" in extension " + extensionDefinition.getExtensionKey() + " successfully created.";
    String errorMessageOverridesExist = "The TCA definition file for the element already exists. Unsupported operation.";
    // Exit if element exists. Maybe one day... *sigh*
    if (ExtensionFileGenerationUtil.extensionHasFile(extensionDefinition, "Configuration/TCA/Overrides/tt_content_element_" + formElementName + ".php")) {
        Notification notification = new Notification("TYPO3 CMS Plugin", "TYPO3 CMS", errorMessageOverridesExist, NotificationType.ERROR);
        Notifications.Bus.notify(notification, this.project);
        this.dispose();
        return;
    }
    /*
         * Build template context. It will be available in the templates through '{{ marker }}' markers
         */
    Map<String, String> context = new HashMap<>();
    context.put("elementName", formElementName);
    context.put("elementTitle", formElementTitle);
    context.put("elementDescription", formElementDescription);
    context.put("extensionKey", extensionDefinition.getExtensionKey());
    context.put("templateName", StringUtils.capitalize(formElementName) + ".html");
    context.put("icon", (String) this.icon.getSelectedItem());
    /*
         * Generate element main TypoScript
         */
    PsiElement element = ExtensionFileGenerationUtil.fromTemplate("contentElement/fsc/ts_setup.typoscript", "Configuration/TypoScript/ContentElement", formElementName + ".typoscript", extensionDefinition, context, project);
    new OpenFileDescriptor(project, element.getContainingFile().getVirtualFile(), 0).navigate(true);
    /*
         * Generate element main fluid template
         */
    PsiElement templateElement = ExtensionFileGenerationUtil.fromTemplate("contentElement/fsc/element.html", "Resources/Private/Templates/ContentElements", context.get("templateName"), extensionDefinition, context, project);
    new OpenFileDescriptor(project, templateElement.getContainingFile().getVirtualFile(), 0).navigate(true);
    /*
         * Generate element TypoScript include to main TS template
         */
    String ceImport = "<INCLUDE_TYPOSCRIPT: source=\"FILE:EXT:" + extensionDefinition.getExtensionKey() + "/Configuration/TypoScript/ContentElement/" + formElementName + ".typoscript\">";
    VirtualFile mainTsFile = ExtensionFileGenerationUtil.appendOrCreate(ceImport, "Configuration/TypoScript", "setup.txt", extensionDefinition, context, project);
    if (mainTsFile == null) {
        return;
    }
    new OpenFileDescriptor(project, mainTsFile, 0).navigate(true);
    /*
         * Generate New content element wizard tsconfig
         */
    String newCeTsconfig = ExtensionFileGenerationUtil.readTemplateToString("contentElement/fsc/newcewizard.tsconfig", context);
    VirtualFile newCeTsConfigFile = ExtensionFileGenerationUtil.appendOrCreate(newCeTsconfig, "Configuration/PageTSconfig", "NewContentElementWizard.tsconfig", extensionDefinition, context, project);
    new OpenFileDescriptor(project, newCeTsConfigFile, 0).navigate(true);
    /*
         * Generate element TCA overrides
         */
    PsiElement elementTcaOverrides = ExtensionFileGenerationUtil.fromTemplate("contentElement/fsc/tca_overrides_ttcontent.php", "Configuration/TCA/Overrides", "tt_content_element_" + formElementName + ".php", extensionDefinition, context, project);
    new OpenFileDescriptor(project, elementTcaOverrides.getContainingFile().getVirtualFile(), 0).navigate(true);
    if (!ExtensionFileGenerationUtil.extensionHasFile(extensionDefinition, "Configuration/TCA/Overrides/sys_template.php")) {
        /*
             * Generate static template imports
             */
        PsiElement sysTemplateImport = ExtensionFileGenerationUtil.fromTemplate("contentElement/fsc/tca_overrides_systemplate.php", "Configuration/TCA/Overrides", "sys_template.php", extensionDefinition, context, project);
        new OpenFileDescriptor(project, sysTemplateImport.getContainingFile().getVirtualFile(), 0).navigate(true);
    } else {
        successMessage += "\nsys_template overrides already exist. Please check that the static template is added.";
    }
    Notification notification = new Notification("TYPO3 CMS Plugin", "TYPO3 CMS", successMessage, NotificationType.INFORMATION);
    Notifications.Bus.notify(notification, this.project);
    this.dispose();
}
Example 48
Project: jangaroo-idea-master  File: JangarooFacetImporter.java View source code
public boolean isApplicable(MavenProject mavenProjectModel) {
    MavenPlugin jangarooMavenPlugin = findJangarooMavenPlugin(mavenProjectModel);
    if (jangarooMavenPlugin == null && JANGAROO_PACKAGING_TYPE.equals(mavenProjectModel.getPackaging())) {
        Notifications.Bus.notify(new Notification("jangaroo", "Jangaroo Facet not created/updated", "Module " + mavenProjectModel.getMavenId() + " uses packaging type 'jangaroo', " + "but no jangaroo-maven-plugin or exml-maven-plugin was found. Try repeating 'Reimport All Maven Projects'.", NotificationType.WARNING));
    }
    // any of the two Jangaroo Maven plugins has to be configured explicitly:
    return jangarooMavenPlugin != null;
}
Example 49
Project: json2java4idea-master  File: NewClassAction.java View source code
private void onError(@Nonnull NewClassDialog dialog, @Nullable Throwable cause) {
    if (cause instanceof ClassAlreadyExistsException) {
        // Dialog is not closed or cancelled since user can rename class after message showing
        Messages.showMessageDialog(project, bundle.message("error.message.class.exists", dialog.getClassName()), bundle.message("error.title.cannot.create.class"), Messages.getErrorIcon());
        return;
    }
    if (cause instanceof InvalidDirectoryException) {
        final Notification notification = new Notification(NOTIFICATION_DISPLAY_ID, bundle.message("error.title.directory.invalid"), bundle.message("error.message.directory.invalid"), NotificationType.WARNING);
        Notifications.Bus.notify(notification);
        dialog.close();
        return;
    }
    final Notification notification = new Notification(NOTIFICATION_DISPLAY_ID, bundle.message("error.title.cannot.create.class"), bundle.message("error.message.cannot.create", dialog.getClassName()), NotificationType.ERROR);
    Notifications.Bus.notify(notification);
    dialog.close();
}
Example 50
Project: jstestdriver-idea-plugin-master  File: StrutsFrameworkSupportProvider.java View source code
public void run() {
    final VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots();
    if (sourceRoots.length <= 0) {
        return;
    }
    final PsiDirectory directory = PsiManager.getInstance(module.getProject()).findDirectory(sourceRoots[0]);
    if (directory == null || directory.findFile(StrutsConstants.STRUTS_XML_DEFAULT_FILENAME) != null) {
        return;
    }
    String template = StrutsFileTemplateGroupDescriptorFactory.STRUTS_2_0_XML;
    final boolean is2_1orNewer = VersionComparatorUtil.compare(version.getVersionName(), "2.1") > 0;
    final boolean is2_3orNewer = VersionComparatorUtil.compare(version.getVersionName(), "2.3") > 0;
    if (is2_3orNewer) {
        template = StrutsFileTemplateGroupDescriptorFactory.STRUTS_2_3_XML;
    } else if (is2_1orNewer) {
        final boolean is2_1_7X = VersionComparatorUtil.compare(version.getVersionName(), "2.1.7") > 0;
        template = is2_1_7X ? StrutsFileTemplateGroupDescriptorFactory.STRUTS_2_1_7_XML : StrutsFileTemplateGroupDescriptorFactory.STRUTS_2_1_XML;
    }
    final FileTemplateManager fileTemplateManager = FileTemplateManager.getInstance();
    final FileTemplate strutsXmlTemplate = fileTemplateManager.getJ2eeTemplate(template);
    try {
        final StrutsFacetConfiguration strutsFacetConfiguration = strutsFacet.getConfiguration();
        // create empty struts.xml & fileset with all found struts-*.xml files (struts2.jar, plugins)
        final PsiElement psiElement = FileTemplateUtil.createFromTemplate(strutsXmlTemplate, StrutsConstants.STRUTS_XML_DEFAULT_FILENAME, null, directory);
        final Set<StrutsFileSet> empty = Collections.emptySet();
        final StrutsFileSet fileSet = new StrutsFileSet(StrutsFileSet.getUniqueId(empty), StrutsFileSet.getUniqueName("Default File Set", empty), strutsFacetConfiguration);
        fileSet.addFile(((XmlFile) psiElement).getVirtualFile());
        final StrutsConfigsSearcher searcher = new StrutsConfigsSearcher(module);
        searcher.search();
        final MultiMap<VirtualFile, PsiFile> jarConfigFiles = searcher.getJars();
        for (final VirtualFile virtualFile : jarConfigFiles.keySet()) {
            final Collection<PsiFile> psiFiles = jarConfigFiles.get(virtualFile);
            for (final PsiFile psiFile : psiFiles) {
                fileSet.addFile(psiFile.getVirtualFile());
            }
        }
        strutsFacetConfiguration.getFileSets().add(fileSet);
        // create filter & mapping in web.xml
        new WriteCommandAction.Simple(modifiableRootModel.getProject()) {

            protected void run() throws Throwable {
                final WebFacet webFacet = strutsFacet.getWebFacet();
                final WebApp webApp = webFacet.getRoot();
                assert webApp != null;
                final Filter strutsFilter = webApp.addFilter();
                strutsFilter.getFilterName().setStringValue("struts2");
                @NonNls final String filterClass = is2_1orNewer ? StrutsConstants.STRUTS_2_1_FILTER_CLASS : StrutsConstants.STRUTS_2_0_FILTER_CLASS;
                strutsFilter.getFilterClass().setStringValue(filterClass);
                final FilterMapping filterMapping = webApp.addFilterMapping();
                filterMapping.getFilterName().setValue(strutsFilter);
                filterMapping.addUrlPattern().setStringValue("/*");
            }
        }.execute();
        final NotificationListener showFacetSettingsListener = new NotificationListener() {

            public void hyperlinkUpdate(@NotNull final Notification notification, @NotNull final HyperlinkEvent event) {
                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                    notification.expire();
                    ModulesConfigurator.showFacetSettingsDialog(strutsFacet, null);
                }
            }
        };
        Notifications.Bus.notify(new Notification("Struts 2", "Struts 2 Setup", "Struts 2 Facet has been created, please check <a href=\"more\">created fileset</a>", NotificationType.INFORMATION, showFacetSettingsListener), module.getProject());
    } catch (Exception e) {
        LOG.error("error creating struts.xml from template", e);
    }
}
Example 51
Project: PHPStorm-plugin-master  File: Runner.java View source code
public BaseTestsOutputConsoleView getConsole(ToolWindow toolWindow, Project project, final RunnerConfiguration runnerConfiguration) {
    ConfigurationFactory myFactory = new PhpRunConfigurationFactoryBase(new AtoumLocalRunConfigurationType()) {

        public RunConfiguration createTemplateConfiguration(Project project) {
            return new AtoumLocalRunConfiguration(project, this, "");
        }
    };
    Executor executor = DefaultRunExecutor.getRunExecutorInstance();
    PhpRunConfiguration runConfiguration = new AtoumLocalRunConfiguration(project, myFactory, "test");
    TestConsoleProperties testConsoleProperties = new SMTRunnerConsoleProperties(runConfiguration, "atoum", executor);
    final BaseTestsOutputConsoleView testsOutputConsoleView = SMTestRunnerConnectionUtil.createConsole("atoumConsole", testConsoleProperties);
    Disposer.register(project, testsOutputConsoleView);
    VirtualFile testBaseDir = null;
    try {
        testBaseDir = AtoumUtils.findTestBaseDir(runnerConfiguration, project);
    } catch (Exception e) {
        testBaseDir = project.getBaseDir();
    }
    String testBasePath = testBaseDir.getPath();
    String atoumBinPath = AtoumUtils.findAtoumBinPath(testBaseDir);
    String phpPath = "php";
    PhpInterpreter interpreter = PhpProjectConfigurationFacade.getInstance(project).getInterpreter();
    if (null != interpreter) {
        phpPath = interpreter.getPathToPhpExecutable();
    }
    List<PhpConfigurationOptionData> phpConfig;
    try {
        phpConfig = interpreter.getConfigurationOptions();
    } catch (NullPointerException e) {
        phpConfig = new ArrayList<PhpConfigurationOptionData>();
    }
    CommandLineArgumentsBuilder commandLineBuilder = (new CommandLineArgumentsBuilder(atoumBinPath, testBasePath, phpConfig)).useTapReport().useConfiguration(runnerConfiguration);
    String phpstormConfigFile = testBasePath + "/.atoum.phpstorm.php";
    if (new File(phpstormConfigFile).exists()) {
        commandLineBuilder.useConfigFile(phpstormConfigFile);
    }
    ContentManager contentManager = toolWindow.getContentManager();
    Content myContent;
    myContent = toolWindow.getContentManager().getFactory().createContent(testsOutputConsoleView.getComponent(), "tests results", false);
    toolWindow.getContentManager().removeAllContents(true);
    toolWindow.getContentManager().addContent(myContent);
    final SMTRunnerConsoleView console = (SMTRunnerConsoleView) testsOutputConsoleView;
    String[] commandLineArgs = commandLineBuilder.build();
    HashMap environnmentVariables = new HashMap();
    environnmentVariables.put("PHPSTORM", "1");
    OSProcessHandler processHandler = null;
    try {
        processHandler = this.prepareProcessHandler(phpPath, testBasePath, commandLineArgs, environnmentVariables);
        testsOutputConsoleView.attachToProcess(processHandler);
        console.getResultsViewer().setAutoscrolls(true);
        TestConsoleProperties.HIDE_PASSED_TESTS.set(testsOutputConsoleView.getProperties(), true);
        TestConsoleProperties.SELECT_FIRST_DEFECT.set(testsOutputConsoleView.getProperties(), true);
        final OSProcessHandler finalProcessHandler = processHandler;
        console.getResultsViewer().addEventsListener(new TestResultsViewer.EventsListener() {

            final StringBuilder outputBuilder = new StringBuilder();

            @Override
            public void onTestingStarted(TestResultsViewer testResultsViewer) {
                if (finalProcessHandler != null) {
                    finalProcessHandler.addProcessListener(new ProcessAdapter() {

                        public void onTextAvailable(ProcessEvent event, Key outputType) {
                            outputBuilder.append(event.getText());
                        }

                        public void processTerminated(ProcessEvent event) {
                        }
                    });
                }
            }

            @Override
            public void onTestingFinished(TestResultsViewer testResultsViewer) {
                SMTestProxy testsRootNode = testResultsViewer.getTestsRootNode();
                if (outputBuilder.length() == 0) {
                    testsRootNode.setTestFailed("No tests were found!", "", true);
                    return;
                }
                TestsResult testsResult = TestsResultFactory.createFromTapOutput(outputBuilder.toString());
                SMTRootTestProxyFactory.updateFromTestResult(testsResult, testsRootNode);
                selectFirstFailedMethod();
                if (testsResult.getState().equals(testsResult.STATE_PASSED)) {
                    TestConsoleProperties.HIDE_PASSED_TESTS.set(testsOutputConsoleView.getProperties(), false);
                }
            }

            protected void selectFirstFailedMethod() {
                for (SMTestProxy testProxy : console.getResultsViewer().getTestsRootNode().getAllTests()) {
                    for (SMTestProxy methodProxy : testProxy.getAllTests()) {
                        if (methodProxy.isDefect()) {
                            console.getResultsViewer().selectAndNotify(methodProxy);
                        }
                    }
                }
            }

            @Override
            public void onTestNodeAdded(TestResultsViewer testResultsViewer, SMTestProxy smTestProxy) {
            }

            @Override
            public void onSelected(@Nullable SMTestProxy smTestProxy, @NotNull TestResultsViewer testResultsViewer, @NotNull TestFrameworkRunningModel testFrameworkRunningModel) {
            }
        });
        processHandler.startNotify();
    } catch (ExecutionException e) {
        Notifications.Bus.notify(new Notification("atoumGroup", "Error running tests", e.getMessage(), NotificationType.ERROR, null), project);
    }
    return testsOutputConsoleView;
}
Example 52
Project: ProjectCommandLauncher-master  File: AutotestPanel.java View source code
private void jumpToSource() {
    TestFile selectedValue = (TestFile) list.getSelectedValue();
    if (selectedValue != null) {
        String path = selectedValue.getPath();
        PsiFile[] filesByName = PsiShortNamesCache.getInstance(project).getFilesByName(selectedValue.getName());
        for (PsiFile psiFile : filesByName) {
            if (getTestFileRelativePath(psiFile.getVirtualFile()).equals(path)) {
                OpenFileDescriptor n = new OpenFileDescriptor(project, psiFile.getVirtualFile(), 0).setUseCurrentWindow(true);
                if (n.canNavigate()) {
                    n.navigate(true);
                    return;
                }
            }
        }
        final Notification notification = new Notification("Autotest ERROR", "", "File not found " + selectedValue.getPath(), NotificationType.ERROR);
        ApplicationManager.getApplication().invokeLater(new Runnable() {

            @Override
            public void run() {
                Notifications.Bus.notify(notification, project);
            }
        });
    }
}
Example 53
Project: VisualVMLauncher-master  File: VisualVMHelper.java View source code
public static void openInVisualVM(long id, String visualVmPath, String jdkHome, Object thisInstance) throws IOException {
    if (!isValidPath(visualVmPath)) {
        final Notification notification = new Notification("VisualVMLauncher", "", "Path to VisualVM is not valid, path='" + visualVmPath + "'", NotificationType.ERROR);
        ApplicationManager.getApplication().invokeLater(new Runnable() {

            @Override
            public void run() {
                Notifications.Bus.notify(notification);
            }
        });
    } else {
        LogHelper.print("starting VisualVM with id=" + id, thisInstance);
        if (jdkHome == null) {
            Runtime.getRuntime().exec(new String[] { visualVmPath, "--openid", String.valueOf(id) });
        } else {
            Runtime.getRuntime().exec(new String[] { visualVmPath, "--jdkhome", jdkHome, "--openid", String.valueOf(id) });
        }
    }
}
Example 54
Project: checkstyle-idea-master  File: OpLoadConfigurationTest.java View source code
private void interceptApplicationNotifications() {
    final MessageBus messageBus = mock(MessageBus.class);
    when(project.getMessageBus()).thenReturn(messageBus);
    when(messageBus.syncPublisher(Notifications.TOPIC)).thenReturn(notifications);
    final Application application = mock(Application.class);
    when(application.isUnitTestMode()).thenReturn(true);
    when(application.getMessageBus()).thenReturn(messageBus);
    ApplicationManager.setApplication(application, mock(Disposable.class));
}
Example 55
Project: intellij-haxe-master  File: HaxeCommonCompilerUtil.java View source code
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
    String[] lines = event.getText().split("\\n");
    if (lines.length > 0) {
        if (lines[0].matches("Error: : unknown option `-python'.")) {
            handler.detachProcess();
            handler.removeProcessListener(this);
            context.errorHandler("Currently active Haxe toolkit doesn't supports Python target. Please install latest version of Haxe toolkit");
            Notifications.Bus.notify(new Notification("", "Current version of Haxe toolkit doesn't supports Python target", "You can download latest version of Haxe toolkit at <a href='http://haxe.org/download'>haxe.org/download</a> ", NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER));
            return;
        }
    }
    context.handleOutput(lines);
}
Example 56
Project: ApkMultiChannelPlugin-master  File: NotificationHelper.java View source code
private static void _notify(String message, NotificationType type) {
    Notification notification = new Notification(NotificationHelper.class.getPackage().getName(), "ApkMultiChannel", message, type);
    Notifications.Bus.notify(notification);
}
Example 57
Project: ADBWIFI-master  File: NotificationHelper.java View source code
public static void sendNotification(String message, NotificationType notificationType) {
    Notification notification = new Notification("com.developerphil.adbidea", "ADB IDEA", espaceString(message), notificationType);
    Notifications.Bus.notify(notification);
}
Example 58
Project: GsonFormat-master  File: NotificationCenter.java View source code
public static void sendNotification(String message, NotificationType notificationType) {
    if (message == null || message.trim().length() == 0) {
        return;
    }
    Notification notification = new Notification("com.dim.plugin.Gsonformat", "Gsonformat ", espaceString(message), notificationType);
    Notifications.Bus.notify(notification);
}
Example 59
Project: sourcesync-master  File: EventDataLogger.java View source code
public static void logError(String htmlMessage, Project project) {
    Notification notification = new Notification("SourceSync Notifications", "Sync error", htmlMessage, NotificationType.ERROR);
    Notifications.Bus.notify(notification, project);
}
Example 60
Project: silex-idea-plugin-master  File: ProjectComponent.java View source code
public static void error(String text, Project project) {
    Notifications.Bus.notify(new Notification("Silex Plugin", "Silex Plugin", text, NotificationType.ERROR), project);
}
Example 61
Project: intellij-leiningen-plugin-master  File: LeiningenUtil.java View source code
public static void notifyError(final String title, final String content, final Project project) {
    Notification notification = new Notification(NOTIFICATION_GROUP_ID, title, content, NotificationType.ERROR);
    Notifications.Bus.notify(notification, project);
}
Example 62
Project: r2m-plugin-android-master  File: Logger.java View source code
private static void sendNotification(String message, String tag, NotificationType notificationType) {
    if (null == message || message.isEmpty()) {
        // to prevent Assertion error
        return;
    }
    Notification notification = new Notification(CommonConstants.LOGGER_TAG, tag, escapeString(message), notificationType);
    Notifications.Bus.notify(notification);
}
Example 63
Project: InjectLogTagPlugin-master  File: InjectLogTagAction.java View source code
private void warning(String title, String message) {
    Notification notification = new Notification("inject-log-tag", title, message, NotificationType.WARNING);
    Notifications.Bus.notify(notification);
}
Example 64
Project: scratch-master  File: ScratchLog.java View source code
private static void notifyUser(String title, String message, NotificationType notificationType) {
    String groupDisplayId = ScratchLog.title;
    Notification notification = new Notification(groupDisplayId, title, message, notificationType);
    ApplicationManager.getApplication().getMessageBus().syncPublisher(Notifications.TOPIC).notify(notification);
}
Example 65
Project: Aspose_BarCode_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 66
Project: Aspose_Cells_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 67
Project: Aspose_Email_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 68
Project: Aspose_Pdf_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 69
Project: Aspose_Slides_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 70
Project: Aspose_Words_Java-master  File: AsposeMavenUtil.java View source code
public static void showError(Project project, String title, Throwable e) {
    Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project);
}
Example 71
Project: coffee-lint-plugin-master  File: CoffeeLintProjectComponent.java View source code
public void showInfoNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
    Notifications.Bus.notify(errorNotification, this.project);
}
Example 72
Project: eslint-plugin-master  File: ESLintProjectComponent.java View source code
public void showInfoNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
    Notifications.Bus.notify(errorNotification, this.project);
}
Example 73
Project: jscs-plugin-master  File: JscsProjectComponent.java View source code
public void showInfoNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
    Notifications.Bus.notify(errorNotification, this.project);
}
Example 74
Project: scss-lint-plugin-master  File: ScssLintProjectComponent.java View source code
public void showInfoNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
    Notifications.Bus.notify(errorNotification, this.project);
}
Example 75
Project: idea-vcswatch-master  File: CommitNotificationProjectComponent.java View source code
@Override
public void run() {
    if (commits.isEmpty()) {
        return;
    }
    Notifications.Bus.notify(new CommitNotification(project, commits), project);
    commits.clear();
}
Example 76
Project: la-clojure-master  File: ClojureConfigUtil.java View source code
public static void warningDefaultClojureJar(Module module) {
    Notifications.Bus.notify(new Notification(CLOJURE_NOTIFICATION_GROUP, "", ClojureBundle.message("clojure.jar.from.plugin.used"), NotificationType.WARNING), module.getProject());
}
Example 77
Project: intellij-sails-ide-master  File: SailsJSProjectGenerator.java View source code
private static void showErrorMessage(@NotNull String message) {
    String fullMessage = "Error creating Sails App. " + message;
    String title = "Create Sails Project";
    Notifications.Bus.notify(new Notification("Sails Generator", title, fullMessage, NotificationType.ERROR));
}
Example 78
Project: WebStormRequireJsPlugin-master  File: RequirejsProjectComponent.java View source code
public void showInfoNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification("Require.js plugin", "Require.js plugin", content, type);
    Notifications.Bus.notify(errorNotification, this.project);
}