Changeset 11848 in josm
- Timestamp:
- 2017-04-07T00:18:07+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r11017 r11848 22 22 import org.openstreetmap.josm.tools.GBC; 23 23 import org.openstreetmap.josm.tools.Shortcut; 24 import org.openstreetmap.josm.tools.Utils; 24 25 25 26 public abstract class AbstractMergeAction extends JosmAction { … … 100 101 protected void warnNoTargetLayersForSourceLayer(Layer sourceLayer) { 101 102 JOptionPane.showMessageDialog(Main.parent, 102 tr("<html>There are no layers the source layer<br>''{0}''<br>could be merged to.</html>", sourceLayer.getName()), 103 tr("<html>There are no layers the source layer<br>''{0}''<br>could be merged to.</html>", 104 Utils.escapeReservedCharactersHTML(sourceLayer.getName())), 103 105 tr("No target layers"), JOptionPane.WARNING_MESSAGE); 104 106 } -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r11739 r11848 130 130 "<b>This is not the recommended way of merging such data</b>.<br />"+ 131 131 "You should instead check and merge each object, one by one, by using ''<i>Merge selection</i>''.<br /><br />"+ 132 "Are you sure you want to continue?", sourceLayer.getName(), targetLayer.getName(), targetLayer.getName())+ 132 "Are you sure you want to continue?", 133 Utils.escapeReservedCharactersHTML(sourceLayer.getName()), 134 Utils.escapeReservedCharactersHTML(targetLayer.getName()), 135 Utils.escapeReservedCharactersHTML(targetLayer.getName()))+ 133 136 "</html>", 134 137 ImageProvider.get("dialogs", "mergedown"), tr("Ignore this hint and merge anyway")); -
trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
r10552 r11848 18 18 import org.openstreetmap.josm.tools.ImageProvider; 19 19 import org.openstreetmap.josm.tools.Shortcut; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 90 91 "You should instead check and merge each object, <b>one by one</b>.<br /><br />"+ 91 92 "Are you sure you want to continue?", 92 getLayerManager().getEditLayer().getName(), targetLayer.getName(), targetLayer.getName())+ 93 Utils.escapeReservedCharactersHTML(getLayerManager().getEditLayer().getName()), 94 Utils.escapeReservedCharactersHTML(targetLayer.getName()), 95 Utils.escapeReservedCharactersHTML(targetLayer.getName()))+ 93 96 "</html>", 94 97 ImageProvider.get("dialogs", "mergedown"), tr("Ignore this hint and merge anyway")); -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r10601 r11848 39 39 import org.openstreetmap.josm.tools.MultiMap; 40 40 import org.openstreetmap.josm.tools.Shortcut; 41 import org.openstreetmap.josm.tools.Utils; 41 42 import org.xml.sax.SAXException; 42 43 … … 182 183 files.size(), 183 184 files.size(), 184 importer.filter.getDescription()185 Utils.escapeReservedCharactersHTML(importer.filter.getDescription()) 185 186 ) 186 187 ).append("<br><ul>"); -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r11746 r11848 190 190 Main.parent, 191 191 tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>", 192 uri != null ? uri : file.getName(), e.getMessage()),192 uri != null ? uri : file.getName(), Utils.escapeReservedCharactersHTML(e.getMessage())), 193 193 dialogTitle, 194 194 JOptionPane.ERROR_MESSAGE, -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r11109 r11848 170 170 HelpAwareOptionPane.showMessageDialogInEDT( 171 171 Main.parent, 172 tr("<html>Could not save session file ''{0}''.<br>Error is:<br>{1}</html>", file.getName(), ex.getMessage()), 172 tr("<html>Could not save session file ''{0}''.<br>Error is:<br>{1}</html>", 173 file.getName(), Utils.escapeReservedCharactersHTML(ex.getMessage())), 173 174 tr("IO Error"), 174 175 JOptionPane.ERROR_MESSAGE, -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r11709 r11848 29 29 import org.openstreetmap.josm.tools.ImageProvider; 30 30 import org.openstreetmap.josm.tools.Shortcut; 31 import org.openstreetmap.josm.tools.Utils; 31 32 32 33 /** … … 154 155 Main.parent, 155 156 tr("<html>The data to be uploaded participates in unresolved conflicts of layer ''{0}''.<br>" 156 + "You have to resolve them first.</html>", layer.getName()157 + "You have to resolve them first.</html>", Utils.escapeReservedCharactersHTML(layer.getName()) 157 158 ), 158 159 tr("Warning"), … … 173 174 "Sending data from this layer is <b>strongly discouraged</b>. If you continue,<br />"+ 174 175 "it may require you subsequently have to revert your changes, or force other contributors to.<br /><br />"+ 175 "Are you sure you want to continue?", layer.getName())+176 "Are you sure you want to continue?", Utils.escapeReservedCharactersHTML(layer.getName()))+ 176 177 "</html>", 177 178 ImageProvider.get("upload"), tr("Ignore this hint and upload anyway")); -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r10378 r11848 17 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 18 18 import org.openstreetmap.josm.tools.ImageProvider; 19 import org.openstreetmap.josm.tools.Utils; 19 20 20 21 /** … … 41 42 + "''{1}''.<br>" 42 43 + "This conflict cannot be added.</html>", 43 getLayer().getName(),44 conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())44 Utils.escapeReservedCharactersHTML(getLayer().getName()), 45 Utils.escapeReservedCharactersHTML(conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())) 45 46 ), 46 47 tr("Double conflict"), -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java
r10763 r11848 86 86 + "Do you really want to change the way direction, thus its semantic meaning?</html>", 87 87 tags.size(), 88 way.getDisplayName(DefaultNameFormatter.getInstance()),88 Utils.escapeReservedCharactersHTML(way.getDisplayName(DefaultNameFormatter.getInstance())), 89 89 Utils.joinAsHtmlUnorderedList(tags) 90 90 ); -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r11811 r11848 35 35 import org.openstreetmap.josm.tools.LanguageInfo; 36 36 import org.openstreetmap.josm.tools.MultiMap; 37 import org.openstreetmap.josm.tools.Utils; 37 38 38 39 /** … … 872 873 String desc = getDescription(); 873 874 if (desc != null && !desc.isEmpty()) { 874 res.append("<br>").append( desc);875 res.append("<br>").append(Utils.escapeReservedCharactersHTML(desc)); 875 876 html = true; 876 877 } -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r11746 r11848 79 79 import org.openstreetmap.josm.tools.GBC; 80 80 import org.openstreetmap.josm.tools.ImageProvider; 81 import org.openstreetmap.josm.tools.Utils; 81 82 82 83 /** … … 587 588 private JLabel popupBuildPrimitiveLabels(final OsmPrimitive osm) { 588 589 final StringBuilder text = new StringBuilder(32); 589 String name = osm.getDisplayName(DefaultNameFormatter.getInstance());590 String name = Utils.escapeReservedCharactersHTML(osm.getDisplayName(DefaultNameFormatter.getInstance())); 590 591 if (osm.isNewOrUndeleted() || osm.isModified()) { 591 592 name = "<i><b>"+ name + "*</b></i>"; … … 601 602 602 603 if (osm.getUser() != null) { 603 text.append(" [").append(tr("User:")).append(' ').append(osm.getUser().getName()).append(']'); 604 text.append(" [").append(tr("User:")).append(' ') 605 .append(Utils.escapeReservedCharactersHTML(osm.getUser().getName())).append(']'); 604 606 } 605 607 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
r10210 r11848 29 29 import org.openstreetmap.josm.gui.history.VersionInfoPanel; 30 30 import org.openstreetmap.josm.tools.ImageProvider; 31 import org.openstreetmap.josm.tools.Utils; 31 32 32 33 /** … … 315 316 StringBuilder str = new StringBuilder("<html>"); 316 317 for (OsmPrimitive r: referrers) { 317 str.append( r.getDisplayName(DefaultNameFormatter.getInstance())).append("<br>");318 str.append(Utils.escapeReservedCharactersHTML(r.getDisplayName(DefaultNameFormatter.getInstance()))).append("<br>"); 318 319 } 319 320 str.append("</html>"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
r11452 r11848 67 67 JOptionPane.showMessageDialog( 68 68 Main.parent, 69 tr("<html>Error in filter <code>{0}</code>:<br>{1}", Utils.shortenString(filter.text, 80), e.getMessage()), 69 tr("<html>Error in filter <code>{0}</code>:<br>{1}", 70 Utils.escapeReservedCharactersHTML(Utils.shortenString(filter.text, 80)), 71 Utils.escapeReservedCharactersHTML(e.getMessage())), 70 72 tr("Error in filter"), 71 73 JOptionPane.ERROR_MESSAGE); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
r11746 r11848 55 55 import org.openstreetmap.josm.tools.ImageProvider; 56 56 import org.openstreetmap.josm.tools.JosmRuntimeException; 57 import org.openstreetmap.josm.tools.Utils; 57 58 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler; 58 59 … … 199 200 + "edit layer ''{0}''.</html>", 200 201 primitives.size(), 201 Main.getLayerManager().getEditLayer().getName()202 Utils.escapeReservedCharactersHTML(Main.getLayerManager().getEditLayer().getName()) 202 203 ), 203 204 title, JOptionPane.WARNING_MESSAGE, helpTopic -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r10490 r11848 43 43 import org.openstreetmap.josm.io.OnlineResource; 44 44 import org.openstreetmap.josm.tools.ImageProvider; 45 import org.openstreetmap.josm.tools.Utils; 45 46 import org.openstreetmap.josm.tools.date.DateUtils; 46 47 … … 340 341 + "edit layer ''{1}''.</html>", 341 342 currentChangeset.getId(), 342 Main.getLayerManager().getEditLayer().getName()343 Utils.escapeReservedCharactersHTML(Main.getLayerManager().getEditLayer().getName()) 343 344 ), 344 345 tr("Nothing to select"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r11534 r11848 46 46 import org.openstreetmap.josm.tools.CheckParameterUtil; 47 47 import org.openstreetmap.josm.tools.ImageProvider; 48 import org.openstreetmap.josm.tools.Utils; 48 49 import org.xml.sax.SAXException; 49 50 … … 347 348 + "{0}<br>" 348 349 + "is deleted on the server. It cannot be loaded</html>", 349 r.getDisplayName(DefaultNameFormatter.getInstance())350 Utils.escapeReservedCharactersHTML(r.getDisplayName(DefaultNameFormatter.getInstance())) 350 351 ); 351 352 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r11490 r11848 98 98 import org.openstreetmap.josm.tools.CheckParameterUtil; 99 99 import org.openstreetmap.josm.tools.Shortcut; 100 import org.openstreetmap.josm.tools.Utils; 100 101 import org.openstreetmap.josm.tools.WindowGeometry; 101 102 … … 872 873 + "<br>" 873 874 + "Do you really want to add another relation member?</html>", 874 primitive.getDisplayName(DefaultNameFormatter.getInstance())875 Utils.escapeReservedCharactersHTML(primitive.getDisplayName(DefaultNameFormatter.getInstance())) 875 876 ); 876 877 int ret = ConditionalOptionPaneUtil.showOptionDialog( … … 906 907 + "This creates circular references and is therefore discouraged.<br>" 907 908 + "Skipping relation ''{0}''.</html>", 908 primitive.getDisplayName(DefaultNameFormatter.getInstance()));909 Utils.escapeReservedCharactersHTML(primitive.getDisplayName(DefaultNameFormatter.getInstance()))); 909 910 JOptionPane.showMessageDialog( 910 911 Main.parent, -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
r11684 r11848 30 30 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; 31 31 import org.openstreetmap.josm.tools.ImageProvider; 32 import org.openstreetmap.josm.tools.Utils; 32 33 33 34 /** … … 152 153 + "''{1}''.<br>" 153 154 + "Please resolve this conflict first, then try again.</html>", 154 layer.getName(),155 editor.getRelation().getDisplayName(DefaultNameFormatter.getInstance())155 Utils.escapeReservedCharactersHTML(layer.getName()), 156 Utils.escapeReservedCharactersHTML(editor.getRelation().getDisplayName(DefaultNameFormatter.getInstance())) 156 157 ), 157 158 tr("Double conflict"), -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r11435 r11848 152 152 text = tr("<html>Version <strong>{0}</strong> currently edited in layer ''{1}''</html>", 153 153 Long.toString(version), 154 editLayer == null ? tr("unknown") : editLayer.getName()154 editLayer == null ? tr("unknown") : Utils.escapeReservedCharactersHTML(editLayer.getName()) 155 155 ); 156 156 } else { -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
r11608 r11848 15 15 import org.openstreetmap.josm.data.osm.Changeset; 16 16 import org.openstreetmap.josm.tools.ImageProvider; 17 import org.openstreetmap.josm.tools.Utils; 17 18 import org.openstreetmap.josm.tools.date.DateUtils; 18 19 … … 42 43 String comment = cs.get("comment"); 43 44 if (comment != null) { 44 sb.append("<strong>").append(tr("Changeset comment:")).append("</strong>").append(comment).append("<br>"); 45 sb.append("<strong>").append(tr("Changeset comment:")).append("</strong>") 46 .append(Utils.escapeReservedCharactersHTML(comment)).append("<br>"); 45 47 } 46 48 return sb.toString(); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r10308 r11848 16 16 17 17 import org.openstreetmap.josm.tools.GBC; 18 import org.openstreetmap.josm.tools.Utils; 18 19 19 20 class SaveLayersTableColumnModel extends DefaultTableColumnModel { … … 42 43 sb.append("<html>"); 43 44 if (info != null) { 45 String htmlInfoName = Utils.escapeReservedCharactersHTML(info.getName()); 44 46 if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) { 45 47 panel.add(needsUpload, defaultCellStyle); 46 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", info.getName()));48 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", htmlInfoName)); 47 49 48 50 } else { … … 51 53 } 52 54 if (info.getLayer().requiresUploadToServer()) { 53 sb.append(tr("Layer ''{0}'' has modifications which are discouraged to be uploaded.", info.getName()));55 sb.append(tr("Layer ''{0}'' has modifications which are discouraged to be uploaded.", htmlInfoName)); 54 56 } else { 55 sb.append(tr("Layer ''{0}'' has no modifications to be uploaded.", info.getName()));57 sb.append(tr("Layer ''{0}'' has no modifications to be uploaded.", htmlInfoName)); 56 58 } 57 59 } … … 61 63 panel.add(needsSave, defaultCellStyle); 62 64 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", 63 info.getName(), info.getFile().toString()));65 htmlInfoName, info.getFile().toString())); 64 66 } else { 65 67 if (info.isSavable()) { 66 68 panel.add(pnlEmpty, defaultCellStyle); 67 69 } 68 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", info.getName()));70 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", htmlInfoName)); 69 71 } 70 72 } -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r11553 r11848 553 553 if (!isProjectionSupported(newValue)) { 554 554 final String message = "<html><body><p>" + 555 tr("The layer {0} does not support the new projection {1}.", getName(), newValue.toCode()) + "</p>" + 555 tr("The layer {0} does not support the new projection {1}.", 556 Utils.escapeReservedCharactersHTML(getName()), newValue.toCode()) + "</p>" + 556 557 "<p style='width: 450px;'>" + tr("Supported projections are: {0}", nameSupportedProjections()) + "</p>" + 557 558 tr("Change the projection again or remove the layer."); -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r11168 r11848 31 31 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings; 32 32 import org.openstreetmap.josm.tools.CheckParameterUtil; 33 import org.openstreetmap.josm.tools.Utils; 33 34 34 35 /** … … 138 139 if (!isProjectionSupported(newValue)) { 139 140 String message = 140 "<html><body><p>" + tr("The layer {0} does not support the new projection {1}.", getName(), newValue.toCode()) + 141 "<html><body><p>" + tr("The layer {0} does not support the new projection {1}.", 142 Utils.escapeReservedCharactersHTML(getName()), newValue.toCode()) + 141 143 "<p style='width: 450px; position: absolute; margin: 0px;'>" + 142 144 tr("Supported projections are: {0}", nameSupportedProjections()) + "</p>" + -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r11434 r11848 275 275 sb.append("<html>"); 276 276 if (errorMessages.size() == 1) { 277 sb.append( errorMessages.iterator().next());277 sb.append(Utils.escapeReservedCharactersHTML(errorMessages.iterator().next())); 278 278 } else { 279 279 sb.append(Utils.joinAsHtmlUnorderedList(errorMessages)); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java
r11486 r11848 151 151 JPanel msg = new JPanel(new GridBagLayout()); 152 152 msg.add(new JLabel( 153 // CHECKSTYLE.OFF: LineLength 154 tr("<html>Upload of unprocessed GPS data as map data is considered harmful.<br>If you want to upload traces, look here:</html>")), 155 // CHECKSTYLE.ON: LineLength 153 tr("<html>Upload of unprocessed GPS data as map data is considered harmful.<br>" 154 + "If you want to upload traces, look here:</html>")), 156 155 GBC.eol()); 157 156 msg.add(new UrlLabel(Main.getOSMWebsite() + "/traces", 2), GBC.eop()); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r11621 r11848 71 71 String msg = tr("<html>The data in the GPX layer ''{0}'' has been downloaded from the server.<br>" + 72 72 "Because its way points do not include a timestamp we cannot correlate them with audio data.</html>", 73 layer.getName());73 Utils.escapeReservedCharactersHTML(layer.getName())); 74 74 HelpAwareOptionPane.showOptionDialog(Main.parent, msg, tr("Import not possible"), 75 75 JOptionPane.WARNING_MESSAGE, ht("/Action/ImportAudio#CantImportIntoGpxLayerFromServer")); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java
r11747 r11848 36 36 String msg = tr("<html>The data in the GPX layer ''{0}'' has been downloaded from the server.<br>"+ 37 37 "Because its way points do not include a timestamp we cannot correlate them with images.</html>", 38 layer.getName());38 Utils.escapeReservedCharactersHTML(layer.getName())); 39 39 HelpAwareOptionPane.showOptionDialog(Main.parent, msg, tr("Import not possible"), 40 40 JOptionPane.WARNING_MESSAGE, ht("/Action/ImportImages#CantImportIntoGpxLayerFromServer")); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r11381 r11848 51 51 import org.openstreetmap.josm.tools.AudioPlayer; 52 52 import org.openstreetmap.josm.tools.ImageProvider; 53 import org.openstreetmap.josm.tools.Utils; 53 54 54 55 /** … … 247 248 248 249 @Override public Object getInfoComponent() { 249 return "<html>"+trn("{0} consists of {1} marker", "{0} consists of {1} markers", data.size(), getName(), data.size()) + "</html>"; 250 return "<html>"+trn("{0} consists of {1} marker", "{0} consists of {1} markers", 251 data.size(), Utils.escapeReservedCharactersHTML(getName()), data.size()) + "</html>"; 250 252 } 251 253 -
trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
r11604 r11848 50 50 import org.openstreetmap.josm.io.auth.CredentialsManager; 51 51 import org.openstreetmap.josm.tools.ImageProvider; 52 import org.openstreetmap.josm.tools.Utils; 52 53 import org.xml.sax.SAXException; 53 54 … … 456 457 +"</html>", 457 458 loginUrl, 458 getOsmUserName()),459 Utils.escapeReservedCharactersHTML(getOsmUserName())), 459 460 tr("OAuth authorization failed"), 460 461 JOptionPane.ERROR_MESSAGE, -
trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java
r10404 r11848 147 147 token.getKey(), 148 148 apiUrl, 149 userInfo.getDisplayName(),149 Utils.escapeReservedCharactersHTML(userInfo.getDisplayName()), 150 150 userInfo.getId() 151 151 ), -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r11435 r11848 826 826 827 827 private static void appendRow(StringBuilder s, String th, String td) { 828 s.append("<tr><th>").append(th).append("</th><td>").append( td).append("</td</tr>");828 s.append("<tr><th>").append(th).append("</th><td>").append(Utils.escapeReservedCharactersHTML(td)).append("</td</tr>"); 829 829 } 830 830 … … 1621 1621 StringBuilder s = new StringBuilder(128).append("<html><b>"); 1622 1622 if (entry.title != null) { 1623 s.append( entry.title).append("</b> <span color=\"gray\">");1623 s.append(Utils.escapeReservedCharactersHTML(entry.title)).append("</b> <span color=\"gray\">"); 1624 1624 } 1625 1625 s.append(entry.url); -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r10627 r11848 35 35 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader; 36 36 import org.openstreetmap.josm.tools.GBC; 37 import org.openstreetmap.josm.tools.Utils; 37 38 import org.xml.sax.SAXException; 38 39 import org.xml.sax.SAXParseException; … … 89 90 errorMessage = tr("<html>Tagging preset source {0} can be loaded but it contains errors. " + 90 91 "Do you really want to use it?<br><br><table width=600>Error is: [{1}:{2}] {3}</table></html>", 91 source, e.getLineNumber(), e.getColumnNumber(), e.getMessage());92 source, e.getLineNumber(), e.getColumnNumber(), Utils.escapeReservedCharactersHTML(e.getMessage())); 92 93 } else { 93 94 errorMessage = tr("<html>Unable to parse tagging preset source: {0}. " + 94 95 "Do you really want to use it?<br><br><table width=400>Error is: [{1}:{2}] {3}</table></html>", 95 source, e.getLineNumber(), e.getColumnNumber(), e.getMessage());96 source, e.getLineNumber(), e.getColumnNumber(), Utils.escapeReservedCharactersHTML(e.getMessage())); 96 97 } 97 98 Main.warn(e, errorMessage); … … 100 101 errorMessage = tr("<html>Tagging preset source {0} can be loaded but it contains errors. " + 101 102 "Do you really want to use it?<br><br><table width=600>Error is: {1}</table></html>", 102 source, e.getMessage());103 source, Utils.escapeReservedCharactersHTML(e.getMessage())); 103 104 } else { 104 105 errorMessage = tr("<html>Unable to parse tagging preset source: {0}. " + 105 106 "Do you really want to use it?<br><br><table width=600>Error is: {1}</table></html>", 106 source, e.getMessage());107 source, Utils.escapeReservedCharactersHTML(e.getMessage())); 107 108 } 108 109 Main.warn(e, errorMessage); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginCheckBox.java
r10228 r11848 88 88 "Plugin {0} is still required by these {1} plugins:", 89 89 otherPlugins.size(), 90 plugin,90 Utils.escapeReservedCharactersHTML(plugin), 91 91 otherPlugins.size())) 92 92 .append(Utils.joinAsHtmlUnorderedList(otherPlugins)) -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
r11386 r11848 43 43 import org.openstreetmap.josm.io.CachedFile; 44 44 import org.openstreetmap.josm.io.UTFInputStreamReader; 45 import org.openstreetmap.josm.tools.Utils; 45 46 import org.openstreetmap.josm.tools.XmlObjectParser; 46 47 import org.xml.sax.SAXException; … … 377 378 JOptionPane.showMessageDialog( 378 379 Main.parent, 379 "<html>" + tr("Error parsing {0}: ", source) + "<br><br><table width=600>" + e.getMessage() + "</table></html>", 380 "<html>" + tr("Error parsing {0}: ", source) + "<br><br><table width=600>" + 381 Utils.escapeReservedCharactersHTML(e.getMessage()) + "</table></html>", 380 382 tr("Error"), 381 383 JOptionPane.ERROR_MESSAGE -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r10615 r11848 16 16 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 17 17 import org.openstreetmap.josm.gui.util.GuiHelper; 18 import org.openstreetmap.josm.tools.Utils; 18 19 19 20 /** … … 108 109 HelpAwareOptionPane.showMessageDialogInEDT( 109 110 Main.parent, 110 tr("<html>Could not read file ''{0}''.<br>Error is:<br>{1}</html>", f.getName(), e.getMessage()), 111 tr("<html>Could not read file ''{0}''.<br>Error is:<br>{1}</html>", 112 f.getName(), Utils.escapeReservedCharactersHTML(e.getMessage())), 111 113 tr("Error"), 112 114 JOptionPane.ERROR_MESSAGE, null … … 138 140 HelpAwareOptionPane.showMessageDialogInEDT( 139 141 Main.parent, 140 tr("<html>Could not read files.<br>Error is:<br>{0}</html>", e.getMessage()),142 tr("<html>Could not read files.<br>Error is:<br>{0}</html>", Utils.escapeReservedCharactersHTML(e.getMessage())), 141 143 tr("Error"), 142 144 JOptionPane.ERROR_MESSAGE, null -
trunk/src/org/openstreetmap/josm/io/OsmExporter.java
r11809 r11848 94 94 JOptionPane.showMessageDialog( 95 95 Main.parent, 96 tr("<html>An error occurred while saving.<br>Error is:<br>{0}</html>", e.getMessage()), 96 tr("<html>An error occurred while saving.<br>Error is:<br>{0}</html>", 97 Utils.escapeReservedCharactersHTML(e.getMessage())), 97 98 tr("Error"), 98 99 JOptionPane.ERROR_MESSAGE … … 108 109 JOptionPane.showMessageDialog( 109 110 Main.parent, 110 tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", e2.getMessage()), 111 tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", 112 Utils.escapeReservedCharactersHTML(e2.getMessage())), 111 113 tr("Error"), 112 114 JOptionPane.ERROR_MESSAGE -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r11645 r11848 507 507 dialog.show( 508 508 tr("Error loading layer"), 509 tr("<html>Could not load layer {0} ''{1}''.<br>Error is:<br>{2}</html>", idx, name, exception.getMessage()), 509 tr("<html>Could not load layer {0} ''{1}''.<br>Error is:<br>{2}</html>", idx, 510 Utils.escapeReservedCharactersHTML(name), 511 Utils.escapeReservedCharactersHTML(exception.getMessage())), 510 512 JOptionPane.ERROR_MESSAGE, 511 513 progressMonitor -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r11746 r11848 350 350 String msg = tr("<html>Loading of the plugin \"{0}\" was requested." 351 351 + "<br>This plugin is no longer developed and very likely will produce errors." 352 +"<br>It should be disabled.<br>Delete from preferences?</html>", unmaintained); 352 +"<br>It should be disabled.<br>Delete from preferences?</html>", 353 Utils.escapeReservedCharactersHTML(unmaintained)); 353 354 if (confirmDisablePlugin(parent, msg, unmaintained)) { 354 355 Main.pref.removeFromCollection("plugins", unmaintained); … … 506 507 "Plugin {0} requires {1} plugins which were not found. The missing plugins are:", 507 508 missingRequiredPlugin.size(), 508 plugin,509 Utils.escapeReservedCharactersHTML(plugin), 509 510 missingRequiredPlugin.size())) 510 511 .append(Utils.joinAsHtmlUnorderedList(missingRequiredPlugin)) … … 723 724 if (e.getCause() instanceof ClassNotFoundException) { 724 725 msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>" 725 + "Delete from preferences?</html>", plugin.name, plugin.className);726 + "Delete from preferences?</html>", Utils.escapeReservedCharactersHTML(plugin.name), plugin.className); 726 727 } 727 728 } catch (RuntimeException e) { // NOPMD … … 919 920 .append("<ul>"); 920 921 for (PluginInformation pi: plugins) { 921 sb.append("<li>").append( pi.name).append("</li>");922 sb.append("<li>").append(Utils.escapeReservedCharactersHTML(pi.name)).append("</li>"); 922 923 } 923 924 sb.append("</ul>") … … 1270 1271 final StringBuilder msg = new StringBuilder(256); 1271 1272 msg.append("<html>") 1272 .append(tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.getPluginInformation().name)) 1273 .append(tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", 1274 Utils.escapeReservedCharactersHTML(plugin.getPluginInformation().name))) 1273 1275 .append("<br>"); 1274 1276 if (plugin.getPluginInformation().author != null) { 1275 msg.append(tr("According to the information within the plugin, the author is {0}.", plugin.getPluginInformation().author)) 1277 msg.append(tr("According to the information within the plugin, the author is {0}.", 1278 Utils.escapeReservedCharactersHTML(plugin.getPluginInformation().author))) 1276 1279 .append("<br>"); 1277 1280 } -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r11553 r11848 298 298 StringBuilder sb = new StringBuilder(128); 299 299 sb.append("<html><body>") 300 .append(description == null ? tr("no description available") : description);300 .append(description == null ? tr("no description available") : Utils.escapeReservedCharactersHTML(description)); 301 301 if (link != null) { 302 302 sb.append(" <a href=\"").append(link).append("\">").append(tr("More info...")).append("</a>");
Note:
See TracChangeset
for help on using the changeset viewer.