Non-fatal error message with two levels of formatting. Unlike the others, this is non-blocking and will run later on the EDT.
(String title,
String primary, String secondary,
Throwable e)
| 79 | * Unlike the others, this is non-blocking and will run later on the EDT. |
| 80 | */ |
| 81 | static public void showWarningTiered(String title, |
| 82 | String primary, String secondary, |
| 83 | Throwable e) { |
| 84 | if (Base.isCommandLine()) { |
| 85 | // TODO All these messages need to be handled differently for |
| 86 | // proper parsing on the command line. Many have \n in them. |
| 87 | System.out.println(title + ": " + primary + "\n" + secondary); |
| 88 | |
| 89 | } else { |
| 90 | EventQueue.invokeLater(() -> { |
| 91 | JOptionPane.showMessageDialog(new JFrame(), |
| 92 | Toolkit.formatMessage(primary, secondary), |
| 93 | title, JOptionPane.WARNING_MESSAGE); |
| 94 | }); |
| 95 | } |
| 96 | if (e != null) e.printStackTrace(); |
| 97 | } |
| 98 | |
| 99 | |
| 100 | /** |
no test coverage detected