Search in sources :

Example 1 with TaskRepositoriesConfigurable

use of com.intellij.tasks.config.TaskRepositoriesConfigurable in project intellij-community by JetBrains.

the class TaskManagerImpl method notifyAboutConnectionFailure.

private void notifyAboutConnectionFailure(final TaskRepository repository, String details) {
    Notifications.Bus.register(TASKS_NOTIFICATION_GROUP, NotificationDisplayType.BALLOON);
    String content = "<p><a href=\"\">Configure server...</a></p>";
    if (!StringUtil.isEmpty(details)) {
        content = "<p>" + details + "</p>" + content;
    }
    Notifications.Bus.notify(new Notification(TASKS_NOTIFICATION_GROUP, "Cannot connect to " + repository.getUrl(), content, NotificationType.WARNING, new NotificationListener() {

        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            TaskRepositoriesConfigurable configurable = new TaskRepositoriesConfigurable(myProject);
            ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
            if (!ArrayUtil.contains(repository, getAllRepositories())) {
                notification.expire();
            }
        }
    }), myProject);
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) TaskRepositoriesConfigurable(com.intellij.tasks.config.TaskRepositoriesConfigurable) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

TaskRepositoriesConfigurable (com.intellij.tasks.config.TaskRepositoriesConfigurable)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 NotNull (org.jetbrains.annotations.NotNull)1