Ticket #11275: josm_patch_multiselect_rev_2.diff
File josm_patch_multiselect_rev_2.diff, 3.2 KB (added by , 9 years ago) |
---|
-
src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
3 3 4 4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 import static org.openstreetmap.josm.tools.I18n.trn; 6 7 7 8 import java.awt.Color; 8 9 import java.awt.Component; 9 10 import java.awt.Font; 11 import java.util.Iterator; 10 12 import java.util.Map; 13 import java.util.Set; 11 14 12 15 import javax.swing.JLabel; 13 16 import javax.swing.JTable; … … 50 53 str = (String) value; 51 54 } else if (value instanceof Map<?, ?>) { 52 55 Map<?, ?> v = (Map<?, ?>) value; 53 if (v.size() != 1) { 54 str=tr("<different>"); 56 if (v.size() != 1) { // Multiple values: give user a short summary of the values 57 Integer blank_count; 58 Integer other_count; 59 if (v.get("") == null) { 60 blank_count = 0; 61 other_count = v.size(); 62 } else { 63 blank_count = (Integer)v.get(""); 64 other_count = v.size()-1; 65 } 66 String temp1 = trn("<{0} unset, ", "<{0} unset, ", blank_count, blank_count); 67 String temp2 = ""; 68 if (other_count == 1) { 69 for (Map.Entry<?, ?> entry : v.entrySet()) { // Find the non-blank value in the map 70 if ( entry.getKey() != "") { 71 temp2 = entry.getValue().toString() + " '" + entry.getKey() + "'>"; 72 } 73 } 74 } else { 75 temp2=tr ("{0} other values>", other_count); 76 } 77 str=temp1 + temp2; 55 78 c.setFont(c.getFont().deriveFont(Font.ITALIC)); 56 } else { 79 80 } else { // One value: display the value 57 81 final Map.Entry<?, ?> entry = v.entrySet().iterator().next(); 58 82 str = (String) entry.getKey(); 59 83 } -
src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
703 703 } 704 704 705 705 if(tagData.getRowCount() != 0 || membershipData.getRowCount() != 0) { 706 setTitle(tr(" Tags: {0} / Memberships: {1}",707 tagData.getRowCount(), membershipData.getRowCount() ));706 setTitle(tr("Objects: {2} / Tags: {0} / Memberships: {1}", 707 tagData.getRowCount(), membershipData.getRowCount(), newSel.size() )); 708 708 } else { 709 709 setTitle(tr("Tags / Memberships")); 710 710 }