Ignore:
Timestamp:
2020-03-04T20:57:37+01:00 (4 years ago)
Author:
simon04
Message:

TaggingPreset/KeyedItem: inherit from TextItem

Location:
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java

    r15441 r16035  
    2727public class Check extends KeyedItem {
    2828
    29     /** The localized version of {@link #text}. */
    30     public String locale_text; // NOSONAR
    3129    /** the value to set when checked (default is "yes") */
    3230    public String value_on = OsmUtils.TRUE_VALUE; // NOSONAR
     
    5452        def = "on".equals(default_) ? Boolean.TRUE : "off".equals(default_) ? Boolean.FALSE : null;
    5553
    56         if (locale_text == null) {
    57             locale_text = getLocaleText(text, text_context, null);
    58         }
     54        initializeLocaleText(null);
    5955
    6056        if (usage.values.size() < 2 && (oneValue == null || value_on.equals(oneValue) || value_off.equals(oneValue))) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r16034 r16035  
    4848    private static final Renderer RENDERER = new Renderer();
    4949
    50     /** The localized version of {@link #text}. */
    51     public String locale_text; // NOSONAR
    5250    /**
    5351     * A list of entries.
     
    422420            }
    423421        }
    424         if (locale_text == null) {
    425             locale_text = getLocaleText(text, text_context, null);
    426         }
     422        initializeLocaleText(null);
    427423        initialized = true;
    428424    }
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java

    r15836 r16035  
    2020 * Preset item associated to an OSM key.
    2121 */
    22 public abstract class KeyedItem extends TaggingPresetItem {
     22public abstract class KeyedItem extends TextItem {
    2323
    2424    /** Translation of "&lt;different&gt;". Use in combo boxes to display an entry matching several different values. */
     
    3232    /** This specifies the property key that will be modified by the item. */
    3333    public String key; // NOSONAR
    34     /** The text to display */
    35     public String text; // NOSONAR
    36     /** The context used for translating {@link #text} */
    37     public String text_context; // NOSONAR
    3834    /**
    3935     * Allows to change the matching process, i.e., determining whether the tags of an OSM object fit into this preset.
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java

    r13597 r16035  
    4040    private static int auto_increment_selected; // NOSONAR
    4141
    42     /** The localized version of {@link #text}. */
    43     public String locale_text; // NOSONAR
    4442    /** The default value for the item. If not specified, the current value of the key is chosen as default (if applicable). Defaults to "". */
    4543    public String default_; // NOSONAR
     
    115113            originalValue = DIFFERENT;
    116114        }
    117         if (locale_text == null) {
    118             locale_text = getLocaleText(text, text_context, null);
    119         }
     115        initializeLocaleText(null);
    120116
    121117        // if there's an auto_increment setting, then wrap the text field
Note: See TracChangeset for help on using the changeset viewer.