diff --git a/resources/data/defaultpresets.xml b/resources/data/defaultpresets.xml
index 6d9592a71..9e933a4b7 100644
|
a
|
b
|
|
| 5024 | 5024 | <text key="ref" text="Reference" /> |
| 5025 | 5025 | <reference ref="operator_substance" /> |
| 5026 | 5026 | <combo key="location" text="Location" values="underground,underwater,overground" values_context="pipeline" /> |
| 5027 | | <combo key="diameter" text="Diameter (mm)" values="800,1000,1200,1500,1600,1800,2200,2300,2400,2500,2600,2800,3200,3300,3400,3500,4000,4200,4300,4800" /> |
| 5028 | | <text key="pressure" text="Pressure (bar)" /> |
| | 5027 | <combo key="diameter" text="Diameter" suffix="mm" values="800,1000" /> |
| | 5028 | <text key="pressure" text="Pressure" suffix="bar" /> |
| 5029 | 5029 | </item> <!-- Pipeline --> |
| 5030 | 5030 | <item name="Pipeline Valve" icon="presets/misc/valve.svg" type="node" preset_name_label="true"> |
| 5031 | 5031 | <link wiki="Tag:pipeline=valve" /> |
diff --git a/resources/data/tagging-preset.xsd b/resources/data/tagging-preset.xsd
index 006aa9841..d4db3f96d 100644
|
a
|
b
|
|
| 173 | 173 | <attribute name="key" type="string" use="required" /> |
| 174 | 174 | <attribute name="text" type="string" /> |
| 175 | 175 | <attribute name="text_context" type="string" /> |
| | 176 | <attribute name="suffix" type="string" /> |
| 176 | 177 | <attribute name="default" type="string" /> |
| 177 | 178 | <attribute name="use_last_as_default" type="tns:last_default" /> |
| 178 | 179 | <attribute name="auto_increment" type="string" /> |
| … |
… |
|
| 205 | 206 | <attribute name="key" type="string" use="required" /> |
| 206 | 207 | <attribute name="text" type="string" /> |
| 207 | 208 | <attribute name="text_context" type="string" /> |
| | 209 | <attribute name="suffix" type="string" /> |
| 208 | 210 | <attribute name="values" type="string" /> |
| 209 | 211 | <attribute name="values_from" type="string" /> |
| 210 | 212 | <attribute name="values_context" type="string" /> |
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
index 2c4ca7a24..520faa7ae 100644
|
a
|
b
|
|
| 10 | 10 | import javax.swing.AbstractAction; |
| 11 | 11 | import javax.swing.JButton; |
| 12 | 12 | import javax.swing.JColorChooser; |
| | 13 | import javax.swing.JLabel; |
| 13 | 14 | import javax.swing.JPanel; |
| 14 | 15 | |
| 15 | 16 | import org.openstreetmap.josm.data.tagging.ac.AutoCompletionPriority; |
| … |
… |
|
| 34 | 35 | /** The length of the combo box (number of characters allowed). */ |
| 35 | 36 | public short length; // NOSONAR |
| 36 | 37 | |
| | 38 | public String suffix; |
| | 39 | |
| 37 | 40 | protected JosmComboBox<PresetListEntry> combobox; |
| 38 | 41 | |
| 39 | 42 | /** |
| … |
… |
protected void addToPanelAnchor(JPanel p, String def, boolean presetInitiallyMat
|
| 107 | 110 | ActionListener updateColor = ignore -> button.setBackground(getColor()); |
| 108 | 111 | updateColor.actionPerformed(null); |
| 109 | 112 | combobox.addActionListener(updateColor); |
| | 113 | } else if (suffix != null) { |
| | 114 | p.add(combobox, GBC.std().fill(GBC.HORIZONTAL)); |
| | 115 | p.add(new JLabel(suffix), GBC.eol().insets(3, 0, 0, 0)); |
| 110 | 116 | } else { |
| 111 | 117 | p.add(combobox, GBC.eol().fill(GBC.HORIZONTAL)); |
| 112 | 118 | } |
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
index 143c21ea5..59d7e9327 100644
|
a
|
b
|
|
| 57 | 57 | /** A comma separated list of alternative keys to use for autocompletion. */ |
| 58 | 58 | public String alternative_autocomplete_keys; // NOSONAR |
| 59 | 59 | |
| | 60 | public String suffix; |
| | 61 | |
| 60 | 62 | private JComponent value; |
| 61 | 63 | |
| 62 | 64 | @Override |
| … |
… |
public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel, boolean preset
|
| 168 | 170 | label.setComponentPopupMenu(getPopupMenu()); |
| 169 | 171 | label.setLabelFor(value); |
| 170 | 172 | p.add(label, GBC.std().insets(0, 0, 10, 0)); |
| 171 | | p.add(value, GBC.eol().fill(GBC.HORIZONTAL)); |
| | 173 | if (suffix != null) { |
| | 174 | p.add(value, GBC.std().fill(GBC.HORIZONTAL)); |
| | 175 | p.add(new JLabel(suffix), GBC.eol().insets(3, 0, 0, 0)); |
| | 176 | } else { |
| | 177 | p.add(value, GBC.eol().fill(GBC.HORIZONTAL)); |
| | 178 | } |
| 172 | 179 | value.setToolTipText(getKeyTooltipText()); |
| 173 | 180 | return true; |
| 174 | 181 | } |