Changeset 5059 in josm
- Timestamp:
- 2012-03-08T22:01:06+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r4982 r5059 215 215 HelpAwareOptionPane.showOptionDialog( 216 216 Main.parent, 217 tr( 218 "Cannot merge nodes: Would have to delete way ''{0}'' which is still used.", 219 w.getDisplayName(DefaultNameFormatter.getInstance()) 220 ), 217 tr("Cannot merge nodes: Would have to delete way {0} which is still used by {1}", 218 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(w), 219 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(w.getReferrers())), 221 220 tr("Warning"), 222 221 JOptionPane.WARNING_MESSAGE, -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java
r4907 r5059 160 160 }; 161 161 162 String message = "<html>" 163 + trn("There is {0} object in your local dataset which " 164 + "might be deleted on the server. If you later try to delete or " 165 + "update this the server is likely to report a conflict.", 166 "There are {0} objects in your local dataset which " 167 + "might be deleted on the server. If you later try to delete or " 168 + "update them the server is likely to report a conflict.", potentiallyDeleted.size(), potentiallyDeleted.size()) 169 + "<br>" 170 + trn("Click <strong>{0}</strong> to check the state of this object on the server.", 171 "Click <strong>{0}</strong> to check the state of these objects on the server.", 172 potentiallyDeleted.size(), 173 options[0].text) + "<br>" 174 + tr("Click <strong>{0}</strong> to ignore." + "</html>", options[1].text); 162 String message = "<html>" + trn( 163 "There is {0} object in your local dataset which " 164 + "might be deleted on the server.<br>If you later try to delete or " 165 + "update this the server is likely to report a conflict.", 166 "There are {0} objects in your local dataset which " 167 + "might be deleted on the server.<br>If you later try to delete or " 168 + "update them the server is likely to report a conflict.", 169 potentiallyDeleted.size(), potentiallyDeleted.size()) 170 + "<br>" 171 + trn("Click <strong>{0}</strong> to check the state of this object on the server.", 172 "Click <strong>{0}</strong> to check the state of these objects on the server.", 173 potentiallyDeleted.size(), 174 options[0].text) + "<br>" 175 + tr("Click <strong>{0}</strong> to ignore." + "</html>", options[1].text); 175 176 176 177 int ret = HelpAwareOptionPane.showOptionDialog( -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r4918 r5059 474 474 475 475 private static boolean confirmRelationDeletion(Collection<Relation> relations) { 476 String relationString = "<ul>";477 for(Relation r:relations) {478 relationString += "<li>"+DefaultNameFormatter.getInstance().format(r) + "</li>";479 }480 relationString += "</ul>";481 482 476 JPanel msg = new JPanel(new GridBagLayout()); 483 477 msg.add(new JLabel("<html>" + trn( … … 492 486 + "<br/>" 493 487 + "Do you really want to delete?", 494 relations.size(), relations.size(), relationString) + "</html>")); 488 relations.size(), relations.size(), DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(relations)) 489 + "</html>")); 495 490 boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( 496 491 "delete_relations", -
trunk/src/org/openstreetmap/josm/data/osm/DataIntegrityProblemException.java
r3083 r5059 4 4 public class DataIntegrityProblemException extends RuntimeException { 5 5 6 private String htmlMessage; 7 6 8 public DataIntegrityProblemException(String message) { 7 9 super(message); 8 10 } 9 11 12 public DataIntegrityProblemException(String message, String htmlMessage) { 13 super(message); 14 this.htmlMessage = htmlMessage; 15 } 16 17 public String getHtmlMessage() { 18 return htmlMessage; 19 } 10 20 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r4682 r5059 14 14 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; 15 15 import org.openstreetmap.josm.data.osm.visitor.Visitor; 16 import org.openstreetmap.josm.gui.DefaultNameFormatter; 16 17 import org.openstreetmap.josm.tools.CopyList; 17 18 import org.openstreetmap.josm.tools.Pair; … … 508 509 for (Node n: nodes) { 509 510 if (n.getDataSet() != dataSet) 510 throw new DataIntegrityProblemException("Nodes in way must be in the same dataset"); 511 throw new DataIntegrityProblemException("Nodes in way must be in the same dataset", 512 tr("Nodes in way must be in the same dataset")); 511 513 if (n.isDeleted()) 512 throw new DataIntegrityProblemException("Deleted node referenced: " + toString()); 514 throw new DataIntegrityProblemException("Deleted node referenced: " + toString(), 515 "<html>" + tr("Deleted node referenced by {0}", DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>"); 513 516 } 514 517 if (Main.pref.getBoolean("debug.checkNullCoor", true)) { 515 518 for (Node n: nodes) { 516 519 if (!n.isIncomplete() && (n.getCoor() == null || n.getEastNorth() == null)) 517 throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString() + n.get3892DebugInfo()); 520 throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString() + n.get3892DebugInfo(), 521 "<html>" + tr("Complete node {0} with null coordinates in way {1}", 522 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(n), 523 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>"); 518 524 } 519 525 } -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r4882 r5059 9 9 import java.util.ArrayList; 10 10 import java.util.Arrays; 11 import java.util.Collection; 11 12 import java.util.Collections; 12 13 import java.util.Comparator; … … 23 24 import org.openstreetmap.josm.data.osm.NameFormatter; 24 25 import org.openstreetmap.josm.data.osm.Node; 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 25 27 import org.openstreetmap.josm.data.osm.OsmUtils; 26 28 import org.openstreetmap.josm.data.osm.Relation; … … 708 710 return sb.toString(); 709 711 } 712 713 public String formatAsHtmlUnorderedList(Collection<? extends OsmPrimitive> primitives) { 714 StringBuilder sb = new StringBuilder(1024); 715 sb.append("<ul>"); 716 for (OsmPrimitive i : primitives) { 717 sb.append("<li>").append(i.getDisplayName(this)).append("</li>"); 718 } 719 sb.append("</ul>"); 720 return sb.toString(); 721 } 722 723 public String formatAsHtmlUnorderedList(OsmPrimitive... primitives) { 724 return formatAsHtmlUnorderedList(Arrays.asList(primitives)); 725 } 710 726 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r5025 r5059 329 329 JOptionPane.showMessageDialog( 330 330 Main.parent, 331 e.get Message(),331 e.getHtmlMessage() != null ? e.getHtmlMessage() : e.getMessage(), 332 332 tr("Error"), 333 333 JOptionPane.ERROR_MESSAGE
Note:
See TracChangeset
for help on using the changeset viewer.