Changeset 14380 in josm for trunk/src/org
- Timestamp:
- 2018-10-28T20:30:47+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r14052 r14380 5 5 6 6 import java.awt.Component; 7 import java.awt.GraphicsEnvironment;8 7 import java.awt.GridBagLayout; 9 8 import java.util.HashMap; … … 116 115 * @return the option selected by user. 117 116 * {@link JOptionPane#CLOSED_OPTION} if the dialog was closed. 118 * {@link JOptionPane#YES_OPTION} if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code>119 117 */ 120 118 public static int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType, … … 124 122 return ret; 125 123 MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey)); 126 if (GraphicsEnvironment.isHeadless()) { 127 // for unit tests 128 ret = JOptionPane.YES_OPTION; 129 } else { 130 ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null, options, defaultOption); 131 } 124 ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null, options, defaultOption); 132 125 if (isYesOrNo(ret)) { 133 126 pnl.getNotShowAgain().store(preferenceKey, ret); … … 162 155 * 163 156 * @return true, if the selected option is equal to <code>trueOption</code>, otherwise false. 164 * {@code trueOption} if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code>165 157 * 166 158 * @see JOptionPane#INFORMATION_MESSAGE … … 174 166 return ret == trueOption; 175 167 MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey)); 176 if (GraphicsEnvironment.isHeadless()) { 177 // for unit tests 178 ret = trueOption; 179 } else { 180 ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType); 181 } 168 ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType); 182 169 if (isYesOrNo(ret)) { 183 170 pnl.getNotShowAgain().store(preferenceKey, ret); -
trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
r14095 r14380 49 49 private String methodWarningFrom; 50 50 51 ReportedException(Throwable exception) { 51 /** 52 * Constructs a new {@code ReportedException}. 53 * @param exception the cause (which is saved for later retrieval by the {@link #getCause()} method) 54 * @since 14380 55 */ 56 public ReportedException(Throwable exception) { 52 57 this(exception, Thread.currentThread()); 53 58 } 54 59 55 ReportedException(Throwable exception, Thread caughtOnThread) { 60 /** 61 * Constructs a new {@code ReportedException}. 62 * @param exception the cause (which is saved for later retrieval by the {@link #getCause()} method) 63 * @param caughtOnThread thread where the exception was caugth 64 * @since 14380 65 */ 66 public ReportedException(Throwable exception, Thread caughtOnThread) { 56 67 super(exception); 57 68
Note:
See TracChangeset
for help on using the changeset viewer.