- Timestamp:
- 2014-02-01T02:15:45+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r6730 r6797 377 377 }); 378 378 379 List<PluginInformation> pluginsToLoad = PluginHandler.buildListOfPluginsToLoad(splash,monitor.createSubTaskMonitor(1, false));379 Collection<PluginInformation> pluginsToLoad = PluginHandler.buildListOfPluginsToLoad(splash,monitor.createSubTaskMonitor(1, false)); 380 380 if (!pluginsToLoad.isEmpty() && PluginHandler.checkAndConfirmPluginUpdate(splash)) { 381 381 monitor.subTask(tr("Updating plugins")); 382 pluginsToLoad = PluginHandler.updatePlugins(splash, pluginsToLoad, monitor.createSubTaskMonitor(1, false));382 pluginsToLoad = PluginHandler.updatePlugins(splash, null, monitor.createSubTaskMonitor(1, false)); 383 383 } 384 384 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r6666 r6797 6 6 7 7 import java.awt.BorderLayout; 8 import java.awt.Component; 8 9 import java.awt.GridBagConstraints; 9 10 import java.awt.GridBagLayout; … … 113 114 return sb.toString(); 114 115 } 116 117 /** 118 * Notifies user about result of a finished plugin download task. 119 * @param parent The parent component 120 * @param task The finished plugin download task 121 * @since 6797 122 */ 123 public static void notifyDownloadResults(final Component parent, PluginDownloadTask task) { 124 final Collection<PluginInformation> downloaded = task.getDownloadedPlugins(); 125 final Collection<PluginInformation> failed = task.getFailedPlugins(); 126 final StringBuilder sb = new StringBuilder(); 127 sb.append("<html>"); 128 sb.append(buildDownloadSummary(task)); 129 if (!downloaded.isEmpty()) { 130 sb.append(tr("Please restart JOSM to activate the downloaded plugins.")); 131 } 132 sb.append("</html>"); 133 GuiHelper.runInEDTAndWait(new Runnable() { 134 @Override 135 public void run() { 136 HelpAwareOptionPane.showOptionDialog( 137 parent, 138 sb.toString(), 139 tr("Update plugins"), 140 !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE, 141 HelpUtil.ht("/Preferences/Plugins") 142 ); 143 } 144 }); 145 } 115 146 116 147 private JosmTextField tfFilter; … … 327 358 } 328 359 329 protected void notifyDownloadResults(PluginDownloadTask task) {330 final Collection<PluginInformation> downloaded = task.getDownloadedPlugins();331 final Collection<PluginInformation> failed = task.getFailedPlugins();332 final StringBuilder sb = new StringBuilder();333 sb.append("<html>");334 sb.append(buildDownloadSummary(task));335 if (!downloaded.isEmpty()) {336 sb.append(tr("Please restart JOSM to activate the downloaded plugins."));337 }338 sb.append("</html>");339 GuiHelper.runInEDTAndWait(new Runnable() {340 @Override341 public void run() {342 HelpAwareOptionPane.showOptionDialog(343 pnlPluginPreferences,344 sb.toString(),345 tr("Update plugins"),346 !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE,347 HelpUtil.ht("/Preferences/Plugins")348 );349 }350 });351 }352 353 360 protected void alertNothingToUpdate() { 354 361 try { … … 391 398 if (pluginDownloadTask.isCanceled()) 392 399 return; 393 notifyDownloadResults(p luginDownloadTask);400 notifyDownloadResults(pnlPluginPreferences, pluginDownloadTask); 394 401 model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins()); 395 402 model.clearPendingPlugins(pluginDownloadTask.getDownloadedPlugins()); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6643 r6797 32 32 import java.util.Set; 33 33 import java.util.TreeSet; 34 import java.util.concurrent.Callable; 34 35 import java.util.concurrent.ExecutionException; 35 36 import java.util.concurrent.ExecutorService; 36 37 import java.util.concurrent.Executors; 37 38 import java.util.concurrent.Future; 39 import java.util.concurrent.FutureTask; 38 40 import java.util.jar.JarFile; 39 41 … … 58 60 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 59 61 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 62 import org.openstreetmap.josm.gui.util.GuiHelper; 60 63 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 61 64 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 62 import org.openstreetmap.josm.tools.CheckParameterUtil;63 65 import org.openstreetmap.josm.tools.GBC; 64 66 import org.openstreetmap.josm.tools.I18n; … … 183 185 * List of unmaintained plugins. Not really up-to-date as the vast majority of plugins are not really maintained after a few months, sadly... 184 186 */ 185 final public staticString [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"};187 public static final String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"}; 186 188 187 189 /** … … 208 210 } 209 211 } 212 213 private static PluginDownloadTask pluginDownloadTask = null; 210 214 211 215 public static Collection<ClassLoader> getResourceClassLoaders() { … … 819 823 * 820 824 * @param parent the parent component for message boxes 821 * @param plugins the collection of plugins to update. Must not be null.825 * @param pluginsWanted the collection of plugins to update. Updates all plugins if {@code null} 822 826 * @param monitor the progress monitor. Defaults to {@link NullProgressMonitor#INSTANCE} if null. 823 827 * @throws IllegalArgumentException thrown if plugins is null 824 828 */ 825 public static List<PluginInformation> updatePlugins(Component parent, 826 List<PluginInformation> plugins, ProgressMonitor monitor) 827 throws IllegalArgumentException{ 828 CheckParameterUtil.ensureParameterNotNull(plugins, "plugins"); 829 public static Collection<PluginInformation> updatePlugins(Component parent, 830 Collection<PluginInformation> pluginsWanted, ProgressMonitor monitor) 831 throws IllegalArgumentException { 832 Collection<PluginInformation> plugins = null; 833 pluginDownloadTask = null; 829 834 if (monitor == null) { 830 835 monitor = NullProgressMonitor.INSTANCE; … … 847 852 allPlugins = task1.getAvailablePlugins(); 848 853 plugins = buildListOfPluginsToLoad(parent,monitor.createSubTaskMonitor(1, false)); 854 // If only some plugins have to be updated, filter the list 855 if (pluginsWanted != null && !pluginsWanted.isEmpty()) { 856 for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) { 857 PluginInformation pi = it.next(); 858 boolean found = false; 859 for (PluginInformation piw : pluginsWanted) { 860 if (pi.name.equals(piw.name)) { 861 found = true; 862 break; 863 } 864 } 865 if (!found) { 866 it.remove(); 867 } 868 } 869 } 849 870 } catch (ExecutionException e) { 850 871 Main.warn(tr("Failed to download plugin information list")+": ExecutionException"); … … 886 907 // try to update the locally installed plugins 887 908 // 888 PluginDownloadTask task2= new PluginDownloadTask(909 pluginDownloadTask = new PluginDownloadTask( 889 910 monitor.createSubTaskMonitor(1,false), 890 911 pluginsToDownload, … … 892 913 ); 893 914 894 future = service.submit( task2);915 future = service.submit(pluginDownloadTask); 895 916 try { 896 917 future.get(); … … 907 928 // Update Plugin info for downloaded plugins 908 929 // 909 refreshLocalUpdatedPluginInfo( task2.getDownloadedPlugins());930 refreshLocalUpdatedPluginInfo(pluginDownloadTask.getDownloadedPlugins()); 910 931 911 932 // notify user if downloading a locally installed plugin failed 912 933 // 913 if (! task2.getFailedPlugins().isEmpty()) {914 alertFailedPluginUpdate(parent, task2.getFailedPlugins());934 if (! pluginDownloadTask.getFailedPlugins().isEmpty()) { 935 alertFailedPluginUpdate(parent, pluginDownloadTask.getFailedPlugins()); 915 936 return plugins; 916 937 } … … 919 940 monitor.finishTask(); 920 941 } 921 // remember the update because it was successful 922 // 923 Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); 924 Main.pref.put("pluginmanager.lastupdate", Long.toString(System.currentTimeMillis())); 942 if (pluginsWanted == null) { 943 // if all plugins updated, remember the update because it was successful 944 // 945 Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); 946 Main.pref.put("pluginmanager.lastupdate", Long.toString(System.currentTimeMillis())); 947 } 925 948 return plugins; 926 949 } … … 1094 1117 } 1095 1118 1096 private static boolean confirmDeactivatingPluginAfterException(PluginProxy plugin) { 1097 ButtonSpec [] options = new ButtonSpec[] { 1119 private static int askUpdateDisableKeepPluginAfterException(PluginProxy plugin) { 1120 final ButtonSpec[] options = new ButtonSpec[] { 1121 new ButtonSpec( 1122 tr("Update plugin"), 1123 ImageProvider.get("dialogs", "refresh"), 1124 tr("Click to update the plugin ''{0}''", plugin.getPluginInformation().name), 1125 null /* no specific help context */ 1126 ), 1098 1127 new ButtonSpec( 1099 1128 tr("Disable plugin"), … … 1110 1139 }; 1111 1140 1112 StringBuffer msg = new StringBuffer();1141 final StringBuffer msg = new StringBuffer(); 1113 1142 msg.append("<html>"); 1114 1143 msg.append(tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.getPluginInformation().name)); 1115 1144 msg.append("<br>"); 1116 if (plugin.getPluginInformation().author != null) {1145 if (plugin.getPluginInformation().author != null) { 1117 1146 msg.append(tr("According to the information within the plugin, the author is {0}.", plugin.getPluginInformation().author)); 1118 1147 msg.append("<br>"); 1119 1148 } 1120 1149 msg.append(tr("Try updating to the newest version of this plugin before reporting a bug.")); 1121 msg.append("<br>");1122 msg.append(tr("Should the plugin be disabled?"));1123 1150 msg.append("</html>"); 1124 1151 1125 int ret = HelpAwareOptionPane.showOptionDialog( 1126 Main.parent, 1127 msg.toString(), 1128 tr("Update plugins"), 1129 JOptionPane.QUESTION_MESSAGE, 1130 null, 1131 options, 1132 options[0], 1133 ht("/ErrorMessages#ErrorInPlugin") 1134 ); 1135 return ret == 0; 1152 try { 1153 FutureTask<Integer> task = new FutureTask<Integer>(new Callable<Integer>() { 1154 @Override 1155 public Integer call() { 1156 return HelpAwareOptionPane.showOptionDialog( 1157 Main.parent, 1158 msg.toString(), 1159 tr("Update plugins"), 1160 JOptionPane.QUESTION_MESSAGE, 1161 null, 1162 options, 1163 options[0], 1164 ht("/ErrorMessages#ErrorInPlugin") 1165 ); 1166 } 1167 }); 1168 GuiHelper.runInEDT(task); 1169 return task.get(); 1170 } catch (InterruptedException e) { 1171 Main.warn(e); 1172 } catch (ExecutionException e) { 1173 Main.warn(e); 1174 } 1175 return -1; 1136 1176 } 1137 1177 … … 1163 1203 /** 1164 1204 * Checks whether the exception <code>e</code> was thrown by a plugin. If so, 1165 * conditionally deactivates the plugin, but asks the user first.1205 * conditionally updates or deactivates the plugin, but asks the user first. 1166 1206 * 1167 1207 * @param e the exception 1168 */ 1169 public static void disablePluginAfterException(Throwable e) { 1208 * @return plugin download task if the plugin has been updated to a newer version, {@code null} if it has been disabled or kept as it 1209 */ 1210 public static PluginDownloadTask updateOrdisablePluginAfterException(Throwable e) { 1170 1211 PluginProxy plugin = null; 1171 1212 // Check for an explicit problem when calling a plugin function … … 1178 1219 if (plugin == null) 1179 1220 // don't know what plugin threw the exception 1180 return ;1221 return null; 1181 1222 1182 1223 Set<String> plugins = new HashSet<String>( 1183 1224 Main.pref.getCollection("plugins",Collections.<String> emptySet()) 1184 1225 ); 1185 if (! plugins.contains(plugin.getPluginInformation().name)) 1226 final PluginInformation pluginInfo = plugin.getPluginInformation(); 1227 if (! plugins.contains(pluginInfo.name)) 1186 1228 // plugin not activated ? strange in this context but anyway, don't bother 1187 1229 // the user with dialogs, skip conditional deactivation 1188 return; 1189 1190 if (!confirmDeactivatingPluginAfterException(plugin)) 1230 return null; 1231 1232 switch (askUpdateDisableKeepPluginAfterException(plugin)) { 1233 case 0: 1234 // update the plugin 1235 updatePlugins(Main.parent, Collections.singleton(pluginInfo), null); 1236 return pluginDownloadTask; 1237 case 1: 1238 // deactivate the plugin 1239 plugins.remove(plugin.getPluginInformation().name); 1240 Main.pref.putCollection("plugins", plugins); 1241 GuiHelper.runInEDTAndWait(new Runnable() { 1242 @Override 1243 public void run() { 1244 JOptionPane.showMessageDialog( 1245 Main.parent, 1246 tr("The plugin has been removed from the configuration. Please restart JOSM to unload the plugin."), 1247 tr("Information"), 1248 JOptionPane.INFORMATION_MESSAGE 1249 ); 1250 } 1251 }); 1252 return null; 1253 default: 1191 1254 // user doesn't want to deactivate the plugin 1192 return; 1193 1194 // deactivate the plugin 1195 plugins.remove(plugin.getPluginInformation().name); 1196 Main.pref.putCollection("plugins", plugins); 1197 JOptionPane.showMessageDialog( 1198 Main.parent, 1199 tr("The plugin has been removed from the configuration. Please restart JOSM to unload the plugin."), 1200 tr("Information"), 1201 JOptionPane.INFORMATION_MESSAGE 1202 ); 1203 return; 1255 return null; 1256 } 1204 1257 } 1205 1258 -
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r6643 r6797 24 24 import org.openstreetmap.josm.actions.ShowStatusReportAction; 25 25 import org.openstreetmap.josm.gui.ExtendedDialog; 26 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreference; 26 27 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 27 28 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 28 29 import org.openstreetmap.josm.gui.widgets.UrlLabel; 30 import org.openstreetmap.josm.plugins.PluginDownloadTask; 29 31 import org.openstreetmap.josm.plugins.PluginHandler; 30 32 … … 37 39 38 40 private static boolean handlingInProgress = false; 41 private static BugReporterThread bugReporterThread = null; 39 42 private static int exceptionCounter = 0; 40 43 private static boolean suppressExceptionDialogs = false; 44 45 private static class BugReporterThread extends Thread { 46 47 final Throwable e; 48 49 public BugReporterThread(Throwable t) { 50 super("Bug Reporter"); 51 this.e = t; 52 } 53 54 @Override 55 public void run() { 56 // Give the user a chance to deactivate the plugin which threw the exception (if it was thrown from a plugin) 57 final PluginDownloadTask pluginDownloadTask = PluginHandler.updateOrdisablePluginAfterException(e); 58 59 SwingUtilities.invokeLater(new Runnable() { 60 @Override 61 public void run() { 62 // Then ask for submitting a bug report, for exceptions thrown from a plugin too, unless updated to a new version 63 if (pluginDownloadTask == null) { 64 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Unexpected Exception"), new String[] {tr("Do nothing"), tr("Report Bug")}); 65 ed.setIcon(JOptionPane.ERROR_MESSAGE); 66 JPanel pnl = new JPanel(new GridBagLayout()); 67 pnl.add(new JLabel( 68 "<html>" + tr("An unexpected exception occurred.<br>" + 69 "This is always a coding error. If you are running the latest<br>" + 70 "version of JOSM, please consider being kind and file a bug report." 71 ) 72 + "</html>"), GBC.eol()); 73 JCheckBox cbSuppress = null; 74 if (exceptionCounter > 1) { 75 cbSuppress = new JCheckBox(tr("Suppress further error dialogs for this session.")); 76 pnl.add(cbSuppress, GBC.eol()); 77 } 78 ed.setContent(pnl); 79 ed.showDialog(); 80 if (cbSuppress != null && cbSuppress.isSelected()) { 81 suppressExceptionDialogs = true; 82 } 83 if (ed.getValue() != 2) return; 84 askForBugReport(e); 85 } else { 86 // Ask for restart to install new plugin 87 PluginPreference.notifyDownloadResults(Main.parent, pluginDownloadTask); 88 } 89 } 90 }); 91 } 92 } 41 93 42 94 @Override … … 59 111 */ 60 112 public static void handleException(final Throwable e) { 61 if (handlingInProgress )113 if (handlingInProgress || suppressExceptionDialogs) 62 114 return; // we do not handle secondary exceptions, this gets too messy 63 if ( suppressExceptionDialogs)115 if (bugReporterThread != null && bugReporterThread.isAlive()) 64 116 return; 65 117 handlingInProgress = true; … … 80 132 } 81 133 82 83 SwingUtilities.invokeLater(new Runnable() { 84 @Override 85 public void run() { 86 // Give the user a chance to deactivate the plugin which threw the exception (if it 87 // was thrown from a plugin) 88 // 89 PluginHandler.disablePluginAfterException(e); 90 91 // Then ask for submitting a bug report, for exceptions thrown from a plugin too 92 // 93 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Unexpected Exception"), new String[] {tr("Do nothing"), tr("Report Bug")}); 94 ed.setIcon(JOptionPane.ERROR_MESSAGE); 95 JPanel pnl = new JPanel(new GridBagLayout()); 96 pnl.add(new JLabel( 97 "<html>" 98 + tr("An unexpected exception occurred.<br>" + 99 "This is always a coding error. If you are running the latest<br>" + 100 "version of JOSM, please consider being kind and file a bug report." 101 ) 102 + "</html>"), GBC.eol()); 103 JCheckBox cbSuppress = null; 104 if (exceptionCounter > 1) { 105 cbSuppress = new JCheckBox(tr("Suppress further error dialogs for this session.")); 106 pnl.add(cbSuppress, GBC.eol()); 107 } 108 ed.setContent(pnl); 109 ed.showDialog(); 110 if (cbSuppress != null && cbSuppress.isSelected()) { 111 suppressExceptionDialogs = true; 112 } 113 if (ed.getValue() != 2) return; 114 115 try { 116 final int maxlen = 6000; 117 StringWriter stack = new StringWriter(); 118 e.printStackTrace(new PrintWriter(stack)); 119 120 String text = ShowStatusReportAction.getReportHeader() 121 + stack.getBuffer().toString(); 122 String urltext = text.replaceAll("\r",""); /* strip useless return chars */ 123 if(urltext.length() > maxlen) 124 { 125 urltext = urltext.substring(0,maxlen); 126 int idx = urltext.lastIndexOf('\n'); 127 /* cut whole line when not loosing too much */ 128 if(maxlen-idx < 200) { 129 urltext = urltext.substring(0,idx+1); 130 } 131 urltext += "...<snip>...\n"; 132 } 133 134 JPanel p = new JPanel(new GridBagLayout()); 135 p.add(new JMultilineLabel( 136 tr("You have encountered an error in JOSM. Before you file a bug report " + 137 "make sure you have updated to the latest version of JOSM here:")), GBC.eol()); 138 p.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eop().insets(8,0,0,0)); 139 p.add(new JMultilineLabel( 140 tr("You should also update your plugins. If neither of those help please " + 141 "file a bug report in our bugtracker using this link:")), GBC.eol()); 142 p.add(getBugReportUrlLabel(urltext), GBC.eop().insets(8,0,0,0)); 143 p.add(new JMultilineLabel( 144 tr("There the error information provided below should already be " + 145 "filled in for you. Please include information on how to reproduce " + 146 "the error and try to supply as much detail as possible.")), GBC.eop()); 147 p.add(new JMultilineLabel( 148 tr("Alternatively, if that does not work you can manually fill in the information " + 149 "below at this URL:")), GBC.eol()); 150 p.add(new UrlLabel(Main.JOSM_WEBSITE+"/newticket",2), GBC.eop().insets(8,0,0,0)); 151 if (Utils.copyToClipboard(text)) { 152 p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop()); 153 } 154 155 JosmTextArea info = new JosmTextArea(text, 18, 60); 156 info.setCaretPosition(0); 157 info.setEditable(false); 158 p.add(new JScrollPane(info), GBC.eop()); 159 160 for (Component c: p.getComponents()) { 161 if (c instanceof JMultilineLabel) { 162 ((JMultilineLabel)c).setMaxWidth(400); 163 } 164 } 165 166 JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE); 167 } catch (Exception e1) { 168 Main.error(e1); 169 } 170 } 171 }); 134 bugReporterThread = new BugReporterThread(e); 135 bugReporterThread.start(); 172 136 } 173 137 } finally { 174 138 handlingInProgress = false; 139 } 140 } 141 142 private static void askForBugReport(final Throwable e) { 143 try { 144 final int maxlen = 6000; 145 StringWriter stack = new StringWriter(); 146 e.printStackTrace(new PrintWriter(stack)); 147 148 String text = ShowStatusReportAction.getReportHeader() + stack.getBuffer().toString(); 149 String urltext = text.replaceAll("\r",""); 150 if (urltext.length() > maxlen) { 151 urltext = urltext.substring(0,maxlen); 152 int idx = urltext.lastIndexOf('\n'); 153 // cut whole line when not loosing too much 154 if (maxlen-idx < 200) { 155 urltext = urltext.substring(0,idx+1); 156 } 157 urltext += "...<snip>...\n"; 158 } 159 160 JPanel p = new JPanel(new GridBagLayout()); 161 p.add(new JMultilineLabel( 162 tr("You have encountered an error in JOSM. Before you file a bug report " + 163 "make sure you have updated to the latest version of JOSM here:")), GBC.eol()); 164 p.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eop().insets(8,0,0,0)); 165 p.add(new JMultilineLabel( 166 tr("You should also update your plugins. If neither of those help please " + 167 "file a bug report in our bugtracker using this link:")), GBC.eol()); 168 p.add(getBugReportUrlLabel(urltext), GBC.eop().insets(8,0,0,0)); 169 p.add(new JMultilineLabel( 170 tr("There the error information provided below should already be " + 171 "filled in for you. Please include information on how to reproduce " + 172 "the error and try to supply as much detail as possible.")), GBC.eop()); 173 p.add(new JMultilineLabel( 174 tr("Alternatively, if that does not work you can manually fill in the information " + 175 "below at this URL:")), GBC.eol()); 176 p.add(new UrlLabel(Main.JOSM_WEBSITE+"/newticket",2), GBC.eop().insets(8,0,0,0)); 177 if (Utils.copyToClipboard(text)) { 178 p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop()); 179 } 180 181 JosmTextArea info = new JosmTextArea(text, 18, 60); 182 info.setCaretPosition(0); 183 info.setEditable(false); 184 p.add(new JScrollPane(info), GBC.eop()); 185 186 for (Component c: p.getComponents()) { 187 if (c instanceof JMultilineLabel) { 188 ((JMultilineLabel)c).setMaxWidth(400); 189 } 190 } 191 192 JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE); 193 } catch (Exception e1) { 194 Main.error(e1); 175 195 } 176 196 }
Note:
See TracChangeset
for help on using the changeset viewer.