import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.ide.DataManager;
import com.intellij.ide.util.PropertiesComponent;
-import com.intellij.notification.Notification;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.NotificationListener;
import com.intellij.notification.NotificationType;
else {
Messages.showErrorDialog(project, UIUtil.toHtml(fullMessage), "");
}
- NotificationListener notificationListener = finalListener == null ? null : new NotificationListener() {
- @Override
- public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
+ NotificationListener notificationListener = finalListener == null ? null : (notification, event) -> {
+ if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
finalListener.hyperlinkUpdate(event);
}
};
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@Override
public void reportMessage(@NotNull final String message, @NotNull final MessageType type, @Nullable final HyperlinkListener listener) {
- NotificationListener notificationListener = listener == null ? null : (notification, event) -> listener.hyperlinkUpdate(event);
+ 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);
}