Search in sources :

Example 61 with Notification

use of com.intellij.notification.Notification in project scss-lint-plugin by idok.

the class ScssLintProjectComponent method showInfoNotification.

public void showInfoNotification(String content, NotificationType type, NotificationListener notificationListener) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type, notificationListener);
    Notifications.Bus.notify(errorNotification, this.project);
}
Also used : Notification(com.intellij.notification.Notification)

Example 62 with Notification

use of com.intellij.notification.Notification in project buck by facebook.

the class TestConfiguration method getState.

@Nullable
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    final BuckBuildManager buildManager = BuckBuildManager.getInstance(getProject());
    if (buildManager.isBuilding()) {
        final Notification notification = new Notification("", "Can't run test. Buck is already running!", "", NotificationType.ERROR);
        Notifications.Bus.notify(notification);
        return null;
    }
    return new TestExecutionState(this, getProject());
}
Also used : BuckBuildManager(com.facebook.buck.intellij.ideabuck.build.BuckBuildManager) Notification(com.intellij.notification.Notification) Nullable(org.jetbrains.annotations.Nullable)

Example 63 with Notification

use of com.intellij.notification.Notification in project buck by facebook.

the class BuckPluginNotifications method notifyActionToolbar.

public static void notifyActionToolbar(final Project project) {
    if (!PropertiesComponent.getInstance().isValueSet(GROUP_DISPLAY_ID)) {
        Notifications.Bus.notify(new Notification(GROUP_DISPLAY_ID, "Buck Plugin", "<html><a href=''>Enable</a> the toolbar to easily access the buck plugin actions." + "<br>You can enable/disable it at any time by pressing on View > Toolbar " + "in the menu.</html>", NotificationType.INFORMATION, new NotificationListener() {

            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent hyperlinkEvent) {
                BuckToolWindowFactory.showMainToolbar(project);
            }
        }), project);
        PropertiesComponent.getInstance().setValue(GROUP_DISPLAY_ID, "true");
    }
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) NotNull(org.jetbrains.annotations.NotNull) Notification(com.intellij.notification.Notification) NotificationListener(com.intellij.notification.NotificationListener)

Example 64 with Notification

use of com.intellij.notification.Notification in project jscs-plugin by idok.

the class JscsProjectComponent method showNotification.

public static void showNotification(String content, NotificationType type) {
    Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
    Notifications.Bus.notify(errorNotification);
}
Also used : Notification(com.intellij.notification.Notification)

Example 65 with Notification

use of com.intellij.notification.Notification in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoModuleLibrariesInitializer method showVendoringNotification.

private void showVendoringNotification() {
    if (!myModuleInitialized || myModule.isDisposed()) {
        return;
    }
    Project project = myModule.getProject();
    String version = GoSdkService.getInstance(project).getSdkVersion(myModule);
    if (!GoVendoringUtil.supportsVendoring(version) || GoVendoringUtil.supportsVendoringByDefault(version)) {
        return;
    }
    if (GoModuleSettings.getInstance(myModule).getVendoringEnabled() != ThreeState.UNSURE) {
        return;
    }
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    boolean shownAlready;
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (propertiesComponent) {
        shownAlready = propertiesComponent.getBoolean(GO_VENDORING_NOTIFICATION_HAD_BEEN_SHOWN, false);
        if (!shownAlready) {
            propertiesComponent.setValue(GO_VENDORING_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())) {
                    GoModuleSettings.showModulesConfigurable(project);
                }
            }
        };
        Notification notification = GoConstants.GO_NOTIFICATION_GROUP.createNotification("Vendoring usage is detected", "<p><strong>vendor</strong> directory usually means that project uses Go Vendor Experiment.</p>\n" + "<p>Selected Go SDK version support vendoring but it's disabled by default.</p>\n" + "<p>You may want to explicitly enabled Go Vendor Experiment in the <a href='configure'>project settings</a>.</p>", NotificationType.INFORMATION, notificationListener);
        Notifications.Bus.notify(notification, project);
    }
}
Also used : Project(com.intellij.openapi.project.Project) HyperlinkEvent(javax.swing.event.HyperlinkEvent) PropertiesComponent(com.intellij.ide.util.PropertiesComponent) NotNull(org.jetbrains.annotations.NotNull) Notification(com.intellij.notification.Notification) NotificationListener(com.intellij.notification.NotificationListener)

Aggregations

Notification (com.intellij.notification.Notification)114 HyperlinkEvent (javax.swing.event.HyperlinkEvent)34 NotNull (org.jetbrains.annotations.NotNull)34 NotificationListener (com.intellij.notification.NotificationListener)33 Project (com.intellij.openapi.project.Project)20 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 File (java.io.File)11 IOException (java.io.IOException)11 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)8 Nullable (org.jetbrains.annotations.Nullable)8 Task (com.intellij.openapi.progress.Task)7 Module (com.intellij.openapi.module.Module)6 ExecutionException (com.intellij.execution.ExecutionException)4 NotificationAction (com.intellij.notification.NotificationAction)4 NotificationType (com.intellij.notification.NotificationType)4 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)4 Application (com.intellij.openapi.application.Application)3 Library (com.intellij.openapi.roots.libraries.Library)3 ActionCallback (com.intellij.openapi.util.ActionCallback)3 ArrayList (java.util.ArrayList)3