mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[ui] fine-tuning startup error dialog actions (IJPL-358)
GitOrigin-RevId: df2d405d9e842b25d83ae3fe812a7b6b4f7bac51
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0274790972
commit
5ac939d463
@@ -1 +1,2 @@
|
||||
skip: gradientBackground*
|
||||
skip: questionSign.png
|
||||
|
||||
BIN
platform/platform-impl/resources/images/questionSign.png
Normal file
BIN
platform/platform-impl/resources/images/questionSign.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 962 B |
@@ -29,6 +29,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
@@ -121,17 +123,26 @@ public final class StartupErrorReporter {
|
||||
catch (Throwable ignore) { }
|
||||
|
||||
try {
|
||||
var options = new String[]{
|
||||
var iconUrl = StartupErrorReporter.class.getResource("/images/questionSign.png");
|
||||
var learnMore = iconUrl != null ? new JLabel(new ImageIcon(iconUrl)) : new JLabel("?");
|
||||
learnMore.setToolTipText(BootstrapBundle.message("bootstrap.error.option.support"));
|
||||
learnMore.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||
learnMore.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
supportCenter();
|
||||
}
|
||||
});
|
||||
var options = new Object[]{
|
||||
BootstrapBundle.message("bootstrap.error.option.close"),
|
||||
BootstrapBundle.message("bootstrap.error.option.reset"),
|
||||
BootstrapBundle.message("bootstrap.error.option.report"),
|
||||
BootstrapBundle.message("bootstrap.error.option.support")
|
||||
learnMore
|
||||
};
|
||||
var choice = JOptionPane.showOptionDialog(JOptionPane.getRootFrame(), prepareMessage(message), title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]);
|
||||
switch (choice) {
|
||||
case 1 -> cleanStart();
|
||||
case 2 -> reportProblem(title, message);
|
||||
case 3 -> supportCenter();
|
||||
}
|
||||
}
|
||||
catch (Throwable t) {
|
||||
|
||||
@@ -11,7 +11,7 @@ bootstrap.error.appendix.graphics=Also, a UI exception occurred in an attempt to
|
||||
bootstrap.error.option.close=Close
|
||||
bootstrap.error.option.support=Learn More
|
||||
bootstrap.error.option.report=Report Problem
|
||||
bootstrap.error.option.reset=Reset Settings
|
||||
bootstrap.error.option.reset=Reset Settings\\&Plugins
|
||||
|
||||
bootstrap.error.title.browser=Cannot Open Browser
|
||||
bootstrap.error.message.browser=Cannot launch the default browser.\n\nThe cause: {0}
|
||||
|
||||
Reference in New Issue
Block a user