- Timestamp:
- 2010-02-14T15:05:08+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r2949 r2983 24 24 import javax.swing.table.TableModel; 25 25 26 import org.openstreetmap.josm.Main; 26 27 import org.openstreetmap.josm.data.osm.OsmPrimitive; 27 28 import org.openstreetmap.josm.data.osm.PrimitiveId; 29 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 30 import org.openstreetmap.josm.gui.help.HelpUtil; 28 31 29 32 /** … … 310 313 } 311 314 315 protected void alertCopyFailedForDeletedPrimitives(List<PrimitiveId> deletedIds) { 316 List<String> items = new ArrayList<String>(); 317 for (int i=0; i<Math.min(MAX_DELETED_PRIMITIVE_IN_DIALOG, deletedIds.size()); i++) { 318 items.add(deletedIds.get(i).toString()); 319 } 320 if (deletedIds.size() > MAX_DELETED_PRIMITIVE_IN_DIALOG) { 321 items.add(tr("{0} more...", deletedIds.size() - MAX_DELETED_PRIMITIVE_IN_DIALOG)); 322 } 323 StringBuffer sb = new StringBuffer(); 324 sb.append("<html>"); 325 sb.append(tr("The following primitives could not be copied to the target primitive<br>because they are deleted in the target dataset:")); 326 sb.append("<ul>"); 327 for (String item: items) { 328 sb.append("<li>").append(item).append("</li>"); 329 } 330 sb.append("</ul>"); 331 sb.append("</html>"); 332 HelpAwareOptionPane.showOptionDialog( 333 Main.parent, 334 sb.toString(), 335 tr("Merging deleted primitives failed"), 336 JOptionPane.WARNING_MESSAGE, 337 HelpUtil.ht("/Dialog/ConflictResolution#MergingDeletedPrimitivesFailed") 338 ); 339 } 340 312 341 private void copy(ListRole sourceRole, int[] rows, int position) { 313 342 List<T> newItems = new ArrayList<T>(rows.length); … … 327 356 fireModelDataChanged(); 328 357 if (!deletedIds.isEmpty()) { 329 List<String> items = new ArrayList<String>(); 330 for (int i=0; i<Math.min(MAX_DELETED_PRIMITIVE_IN_DIALOG, deletedIds.size()); i++) { 331 items.add(deletedIds.get(i).toString()); 332 } 333 if (deletedIds.size() > MAX_DELETED_PRIMITIVE_IN_DIALOG) { 334 items.add(tr("{0} more...", deletedIds.size() - MAX_DELETED_PRIMITIVE_IN_DIALOG)); 335 } 336 JOptionPane.showMessageDialog(null, tr("Following primitives could not be added because they are deleted: {0}", items)); 358 alertCopyFailedForDeletedPrimitives(deletedIds); 337 359 } 338 360 }
Note:
See TracChangeset
for help on using the changeset viewer.