use of com.intellij.notification.Notification in project jscs-plugin by idok.
the class JscsProjectComponent method validationFailed.
private void validationFailed(String msg) {
NotificationListener notificationListener = new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
JscsInspection.showSettings(project);
}
};
String errorMessage = msg + FIX_CONFIG_HREF;
showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
LOG.debug(msg);
settingValidStatus = false;
}
use of com.intellij.notification.Notification in project jscs-plugin by idok.
the class JscsProjectComponent method showInfoNotification.
public void showInfoNotification(String content, NotificationType type) {
Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
Notifications.Bus.notify(errorNotification, this.project);
}
use of com.intellij.notification.Notification in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoModuleLibrariesInitializer method showNotification.
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);
}
}
use of com.intellij.notification.Notification in project intellij-plugins by StepicOrg.
the class ActionUtils method notify.
static void notify(@NotNull Project project, @NotNull String title, @NotNull String content, @NotNull NotificationType type) {
if (content.isEmpty()) {
content = "<empty>";
}
Notification notification = new Notification("Step.sending", title, content, type);
notification.notify(project);
}
use of com.intellij.notification.Notification in project intellij-community by JetBrains.
the class TaskManagerTest method testNotifications.
public void testNotifications() throws Exception {
final Ref<Notification> notificationRef = new Ref<>();
getProject().getMessageBus().connect(myFixture.getTestRootDisposable()).subscribe(Notifications.TOPIC, new NotificationsAdapter() {
@Override
public void notify(@NotNull Notification notification) {
notificationRef.set(notification);
}
});
TestRepository repository = new TestRepository() {
@Override
public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
throw new Exception();
}
};
myTaskManager.setRepositories(Collections.singletonList(repository));
myTaskManager.updateIssues(null);
assertNull(notificationRef.get());
myTaskManager.getIssues("");
assertNotNull(notificationRef.get());
}
Aggregations