use of com.intellij.notification.NotificationListener in project intellij-community by JetBrains.
the class DvcsBranchPopup method notifyAboutSyncedBranches.
private void notifyAboutSyncedBranches() {
String description = "You have several " + myVcs.getDisplayName() + " roots in the project and they all are checked out at the same branch. " + "We've enabled synchronous branch control for the project. <br/>" + "If you wish to control branches in different roots separately, " + "you may <a href='settings'>disable</a> the setting.";
NotificationListener listener = new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
ShowSettingsUtil.getInstance().showSettingsDialog(myProject, myVcs.getConfigurable().getDisplayName());
if (myVcsSettings.getSyncSetting() == DvcsSyncSettings.Value.DONT_SYNC) {
notification.expire();
}
}
}
};
VcsNotifier.getInstance(myProject).notifyImportantInfo("Synchronous branch control enabled", description, listener);
}
use of com.intellij.notification.NotificationListener in project intellij-community by JetBrains.
the class PluginManagerMain method notifyPluginsUpdated.
public static void notifyPluginsUpdated(@Nullable Project project) {
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
String title = IdeBundle.message("update.notifications.title");
String action = IdeBundle.message(app.isRestartCapable() ? "ide.restart.action" : "ide.shutdown.action");
String message = IdeBundle.message("ide.restart.required.notification", action, ApplicationNamesInfo.getInstance().getFullProductName());
NotificationListener listener = new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
notification.expire();
app.restart(true);
}
};
UpdateChecker.NOTIFICATIONS.createNotification(title, XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION, listener).notify(project);
}
use of com.intellij.notification.NotificationListener in project intellij-community by JetBrains.
the class XDebugSessionImpl method reportMessage.
@Override
public void reportMessage(@NotNull final String message, @NotNull final MessageType type, @Nullable final HyperlinkListener listener) {
NotificationListener notificationListener = listener == null ? null : (notification, event) -> {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
listener.hyperlinkUpdate(event);
}
};
NOTIFICATION_GROUP.createNotification("", message, type.toNotificationType(), notificationListener).notify(myProject);
}
use of com.intellij.notification.NotificationListener in project intellij-community by JetBrains.
the class ProjectLoadingErrorsNotifierImpl method fireNotifications.
private void fireNotifications() {
final MultiMap<ConfigurationErrorType, ConfigurationErrorDescription> descriptionsMap = new MultiMap<>();
synchronized (myLock) {
if (myErrors.isEmpty())
return;
descriptionsMap.putAllValues(myErrors);
myErrors.clear();
}
for (final ConfigurationErrorType type : descriptionsMap.keySet()) {
final Collection<ConfigurationErrorDescription> descriptions = descriptionsMap.get(type);
if (descriptions.isEmpty())
continue;
final String invalidElements = getInvalidElementsString(type, descriptions);
final String errorText = ProjectBundle.message("error.message.configuration.cannot.load") + " " + invalidElements + " <a href=\"\">Details...</a>";
Notifications.Bus.notify(new Notification("Project Loading Error", "Error Loading Project", errorText, NotificationType.ERROR, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
final List<ConfigurationErrorDescription> validDescriptions = ContainerUtil.findAll(descriptions, errorDescription -> errorDescription.isValid());
if (RemoveInvalidElementsDialog.showDialog(myProject, CommonBundle.getErrorTitle(), type, invalidElements, validDescriptions)) {
notification.expire();
}
}
}), myProject);
}
}
use of com.intellij.notification.NotificationListener in project intellij-community by JetBrains.
the class GitCherryPicker method notifyConflictWarning.
private void notifyConflictWarning(@NotNull GitRepository repository, @NotNull GitCommitWrapper commit, @NotNull List<GitCommitWrapper> successfulCommits) {
NotificationListener resolveLinkListener = new ResolveLinkListener(myProject, myGit, repository.getRoot(), commit.getCommit().getId().toShortString(), VcsUserUtil.getShortPresentation(commit.getCommit().getAuthor()), commit.getSubject());
String description = commitDetails(commit) + "<br/>Unresolved conflicts remain in the working tree. <a href='resolve'>Resolve them.<a/>";
description += getSuccessfulCommitDetailsIfAny(successfulCommits);
VcsNotifier.getInstance(myProject).notifyImportantWarning("Cherry-picked with conflicts", description, resolveLinkListener);
}
Aggregations