IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java
a
|
b
|
|
29 | 29 | /** The constant value {@code "<different>"}. */ |
30 | 30 | protected static final String DIFFERENT = "<different>"; |
31 | 31 | /** Translation of {@code "<different>"}. */ |
32 | | protected static final String DIFFERENT_I18N = tr(DIFFERENT); |
| 32 | public static final String DIFFERENT_I18N = tr(DIFFERENT); |
33 | 33 | |
34 | 34 | /** True if the default value should also be set on primitives that already have tags. */ |
35 | 35 | protected static final BooleanProperty PROP_FILL_DEFAULT = new BooleanProperty("taggingpreset.fill-default-for-tagged-primitives", false); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/tagging/ac/MaxLengthDocumentFilter.java b/src/org/openstreetmap/josm/gui/tagging/ac/MaxLengthDocumentFilter.java
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.tagging.ac; |
3 | 3 | |
4 | | import static org.openstreetmap.josm.tools.I18n.tr; |
5 | | |
6 | 4 | import javax.swing.text.AttributeSet; |
7 | 5 | import javax.swing.text.BadLocationException; |
8 | 6 | import javax.swing.text.DocumentFilter; |
9 | 7 | import javax.swing.text.StyleConstants; |
10 | 8 | |
| 9 | import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; |
| 10 | |
11 | 11 | /** |
12 | 12 | * A {@link DocumentFilter} to limit the text length in the editor. |
13 | 13 | * @since 18221 |
… |
… |
|
15 | 15 | public class MaxLengthDocumentFilter extends DocumentFilter { |
16 | 16 | /** the document will not accept text longer than this. -1 to disable */ |
17 | 17 | private int maxLength = -1; |
18 | | private static final String DIFFERENT = tr("<different>"); |
19 | 18 | |
20 | 19 | /** |
21 | 20 | * Sets the maximum text length. |
22 | 21 | * |
23 | | * @param length the maximum no. of charactes allowed in this document. -1 to disable |
| 22 | * @param length the maximum no. of characters allowed in this document. -1 to disable |
24 | 23 | */ |
25 | 24 | public void setMaxLength(int length) { |
26 | 25 | maxLength = length; |
… |
… |
|
44 | 43 | |
45 | 44 | private boolean mustInsertOrReplace(FilterBypass fb, int length, String string, AttributeSet attr) { |
46 | 45 | int newLen = fb.getDocument().getLength() - length + ((string == null) ? 0 : string.length()); |
47 | | return (maxLength == -1 || newLen <= maxLength || DIFFERENT.equals(string) || |
| 46 | return (maxLength == -1 || newLen <= maxLength || KeyedItem.DIFFERENT_I18N.equals(string) || |
48 | 47 | // allow longer text while composing characters or it will be hard to compose |
49 | 48 | // the last characters before the limit |
50 | 49 | ((attr != null) && attr.isDefined(StyleConstants.ComposedTextAttribute))); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java b/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.dialogs.properties; |
3 | 3 | |
| 4 | import static org.openstreetmap.josm.actions.search.SearchAction.searchStateless; |
4 | 5 | import static org.openstreetmap.josm.tools.I18n.tr; |
5 | 6 | |
6 | 7 | import java.awt.Component; |
… |
… |
|
102 | 103 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetListener; |
103 | 104 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType; |
104 | 105 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; |
| 106 | import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; |
105 | 107 | import org.openstreetmap.josm.gui.util.AbstractTag2LinkPopupListener; |
106 | 108 | import org.openstreetmap.josm.gui.util.HighlightHelper; |
107 | 109 | import org.openstreetmap.josm.gui.util.TableHelper; |
… |
… |
|
328 | 330 | tagRowSorter.setComparator(0, AlphanumComparator.getInstance()); |
329 | 331 | tagRowSorter.setComparator(1, (o1, o2) -> { |
330 | 332 | if (o1 instanceof Map && o2 instanceof Map) { |
331 | | final String v1 = ((Map) o1).size() == 1 ? (String) ((Map) o1).keySet().iterator().next() : tr("<different>"); |
332 | | final String v2 = ((Map) o2).size() == 1 ? (String) ((Map) o2).keySet().iterator().next() : tr("<different>"); |
| 333 | final String v1 = ((Map) o1).size() == 1 ? (String) ((Map) o1).keySet().iterator().next() : KeyedItem.DIFFERENT_I18N; |
| 334 | final String v2 = ((Map) o2).size() == 1 ? (String) ((Map) o2).keySet().iterator().next() : KeyedItem.DIFFERENT_I18N; |
333 | 335 | return AlphanumComparator.getInstance().compare(v1, v2); |
334 | 336 | } else { |
335 | 337 | return AlphanumComparator.getInstance().compare(String.valueOf(o1), String.valueOf(o2)); |
… |
… |
|
676 | 678 | } |
677 | 679 | tagData.addRow(new Object[]{e.getKey(), e.getValue()}); |
678 | 680 | tags.put(e.getKey(), e.getValue().size() == 1 |
679 | | ? e.getValue().keySet().iterator().next() : tr("<different>")); |
| 681 | ? e.getValue().keySet().iterator().next() : KeyedItem.DIFFERENT_I18N); |
680 | 682 | } |
681 | 683 | |
682 | 684 | membershipData.setRowCount(0); |
… |
… |
|
1084 | 1086 | if (roleString == null) { |
1085 | 1087 | roleString = r.getRole(); |
1086 | 1088 | } else if (!roleString.equals(r.getRole())) { |
1087 | | roleString = tr("<different>"); |
| 1089 | roleString = KeyedItem.DIFFERENT_I18N; |
1088 | 1090 | break; |
1089 | 1091 | } |
1090 | 1092 | } |
… |
… |
|
1343 | 1345 | if (sel.isEmpty()) |
1344 | 1346 | return; |
1345 | 1347 | final SearchSetting ss = createSearchSetting(key, sel, sameType); |
1346 | | org.openstreetmap.josm.actions.search.SearchAction.searchStateless(ss); |
| 1348 | searchStateless(ss); |
1347 | 1349 | } |
1348 | 1350 | } |
1349 | 1351 | |
… |
… |
|
1366 | 1368 | } else if (p instanceof Relation) { |
1367 | 1369 | t = "type:relation "; |
1368 | 1370 | } |
1369 | | String token = new StringBuilder(t).append(val).toString(); |
| 1371 | String token = t + val; |
1370 | 1372 | if (consideredTokens.add(token)) { |
1371 | 1373 | s.append(sep).append('(').append(t).append(SearchCompiler.buildSearchStringForTag(key, val)).append(')'); |
1372 | 1374 | sep = " OR "; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/RelationRoleEditor.java b/src/org/openstreetmap/josm/gui/dialogs/properties/RelationRoleEditor.java
a
|
b
|
|
14 | 14 | import org.openstreetmap.josm.data.osm.Relation; |
15 | 15 | import org.openstreetmap.josm.data.osm.RelationMember; |
16 | 16 | import org.openstreetmap.josm.gui.MainApplication; |
| 17 | import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; |
17 | 18 | import org.openstreetmap.josm.tools.Utils; |
18 | 19 | |
19 | 20 | /** |
… |
… |
|
41 | 42 | formatter.formatAsHtmlUnorderedList(Utils.transform(members, RelationMember::getMember), 5), |
42 | 43 | formatter.formatAsHtmlUnorderedList(relation)), |
43 | 44 | oldRole); |
44 | | if (newRole == null || oldRole.equals(newRole) || tr("<different>").equals(newRole)) { |
| 45 | if (newRole == null || oldRole.equals(newRole) || KeyedItem.DIFFERENT_I18N.equals(newRole)) { |
45 | 46 | return; |
46 | 47 | } |
47 | 48 | final List<RelationMember> newMembers = relation.getMembers(); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java b/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
a
|
b
|
|
88 | 88 | import org.openstreetmap.josm.gui.tagging.ac.AutoCompEvent; |
89 | 89 | import org.openstreetmap.josm.gui.tagging.ac.AutoCompListener; |
90 | 90 | import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; |
| 91 | import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; |
91 | 92 | import org.openstreetmap.josm.gui.util.GuiHelper; |
92 | 93 | import org.openstreetmap.josm.gui.util.WindowGeometry; |
93 | 94 | import org.openstreetmap.josm.gui.widgets.JosmListCellRenderer; |
… |
… |
|
537 | 538 | |
538 | 539 | List<AutoCompletionItem> valueList = autocomplete.getTagValues(getAutocompletionKeys(key), usedValuesAwareComparator); |
539 | 540 | |
540 | | final String selection = m.size() != 1 ? tr("<different>") : m.entrySet().iterator().next().getKey(); |
| 541 | final String selection = m.size() != 1 ? KeyedItem.DIFFERENT_I18N : m.entrySet().iterator().next().getKey(); |
541 | 542 | |
542 | 543 | values = new AutoCompComboBox<>(); |
543 | 544 | values.getModel().setComparator(Comparator.naturalOrder()); |
… |
… |
|
585 | 586 | newkey = key; |
586 | 587 | value = null; // delete the key instead |
587 | 588 | } |
588 | | if (key.equals(newkey) && tr("<different>").equals(value)) |
| 589 | if (key.equals(newkey) && KeyedItem.DIFFERENT_I18N.equals(value)) |
589 | 590 | return; |
590 | 591 | if (key.equals(newkey) || value == null) { |
591 | 592 | UndoRedoHandler.getInstance().add(new ChangePropertyCommand(sel, newkey, value)); |
… |
… |
|
605 | 606 | } |
606 | 607 | Collection<Command> commands = new ArrayList<>(); |
607 | 608 | commands.add(new ChangePropertyCommand(sel, key, null)); |
608 | | if (value.equals(tr("<different>"))) { |
| 609 | if (value.equals(KeyedItem.DIFFERENT_I18N)) { |
609 | 610 | String newKey = newkey; |
610 | 611 | sel.stream() |
611 | 612 | .filter(osm -> osm.hasKey(key)) |