Changeset 9492 in josm for trunk/src


Ignore:
Timestamp:
2016-01-16T19:53:47+01:00 (4 years ago)
Author:
Don-vip
Message:

presets items: fix sonar issues, add javadoc

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

Legend:

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

    r9360 r9492  
    2121
    2222    /** The localized version of {@link #text}. */
    23     public String locale_text;
     23    public String locale_text; // NOSONAR
    2424    /** the value to set when checked (default is "yes") */
    25     public String value_on = OsmUtils.trueval;
     25    public String value_on = OsmUtils.trueval; // NOSONAR
    2626    /** the value to set when unchecked (default is "no") */
    27     public String value_off = OsmUtils.falseval;
     27    public String value_off = OsmUtils.falseval; // NOSONAR
    2828    /** whether the off value is disabled in the dialog, i.e., only unset or yes are provided */
    29     public boolean disable_off;
     29    public boolean disable_off; // NOSONAR
    3030    /** "on" or "off" or unset (default is unset) */
    31     public String default_; // only used for tagless objects
     31    public String default_; // only used for tagless objects // NOSONAR
    3232
    3333    private QuadStateCheckBox check;
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroup.java

    r8863 r9492  
    2424     * Number of columns (positive integer)
    2525     */
    26     public String columns;
     26    public String columns; // NOSONAR
    2727
    2828    /**
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java

    r9465 r9492  
    1616public class Combo extends ComboMultiSelect {
    1717
    18     public boolean editable = true;
    19     protected JosmComboBox<PresetListEntry> combo;
    20     public String length;
     18    /**
     19     * Whether the combo box is editable, which means that the user can add other values as text.
     20     * Default is {@code true}. If {@code false} it is readonly, which means that the user can only select an item in the list.
     21     */
     22    public boolean editable = true; // NOSONAR
     23    /** The length of the combo box (number of characters allowed). */
     24    public String length; // NOSONAR
     25
     26    protected JosmComboBox<PresetListEntry> combobox;
    2127
    2228    /**
     
    4349        }
    4450
    45         combo = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[0]));
    46         component = combo;
    47         combo.setRenderer(getListCellRenderer());
    48         combo.setEditable(editable);
    49         combo.reinitialize(lhm.values());
     51        combobox = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[0]));
     52        component = combobox;
     53        combobox.setRenderer(getListCellRenderer());
     54        combobox.setEditable(editable);
     55        combobox.reinitialize(lhm.values());
    5056        AutoCompletingTextField tf = new AutoCompletingTextField();
    5157        initAutoCompletionField(tf, key);
     
    6066            acList.add(getDisplayValues(), AutoCompletionItemPriority.IS_IN_STANDARD);
    6167        }
    62         combo.setEditor(tf);
     68        combobox.setEditor(tf);
    6369
    6470        if (usage.hasUniqueValue()) {
    6571            // all items have the same value (and there were no unset items)
    6672            originalValue = lhm.get(usage.getFirst());
    67             combo.setSelectedItem(originalValue);
     73            combobox.setSelectedItem(originalValue);
    6874        } else if (def != null && usage.unused()) {
    6975            // default is set and all items were unset
    7076            if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) {
    7177                // selected osm primitives are untagged or filling default feature is enabled
    72                 combo.setSelectedItem(lhm.get(def).getDisplayValue(true));
     78                combobox.setSelectedItem(lhm.get(def).getDisplayValue(true));
    7379            } else {
    7480                // selected osm primitives are tagged and filling default feature is disabled
    75                 combo.setSelectedItem("");
     81                combobox.setSelectedItem("");
    7682            }
    7783            originalValue = lhm.get(DIFFERENT);
     
    8086            originalValue = lhm.get("");
    8187            if ("force".equals(use_last_as_default) && LAST_VALUES.containsKey(key) && !presetInitiallyMatches) {
    82                 combo.setSelectedItem(lhm.get(LAST_VALUES.get(key)));
     88                combobox.setSelectedItem(lhm.get(LAST_VALUES.get(key)));
    8389            } else {
    84                 combo.setSelectedItem(originalValue);
     90                combobox.setSelectedItem(originalValue);
    8591            }
    8692        } else {
    8793            originalValue = lhm.get(DIFFERENT);
    88             combo.setSelectedItem(originalValue);
     94            combobox.setSelectedItem(originalValue);
    8995        }
    90         p.add(combo, GBC.eol().fill(GBC.HORIZONTAL));
     96        p.add(combobox, GBC.eol().fill(GBC.HORIZONTAL));
    9197    }
    9298
    9399    @Override
    94100    protected Object getSelectedItem() {
    95         return combo.getSelectedItem();
    96 
     101        return combobox.getSelectedItem();
    97102    }
    98103
    99104    @Override
    100105    protected String getDisplayIfNull() {
    101         if (combo.isEditable())
    102             return combo.getEditor().getItem().toString();
     106        if (combobox.isEditable())
     107            return combobox.getEditor().getItem().toString();
    103108        else
    104109            return null;
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r9465 r9492  
    4444public abstract class ComboMultiSelect extends KeyedItem {
    4545
    46     private static final ListCellRenderer<PresetListEntry> RENDERER = new ListCellRenderer<PresetListEntry>() {
     46    private static final Renderer RENDERER = new Renderer();
     47
     48    /** The localized version of {@link #text}. */
     49    public String locale_text; // NOSONAR
     50    /**
     51     * A list of entries.
     52     * The list has to be separated by commas (for the {@link Combo} box) or by the specified delimiter (for the {@link MultiSelect}).
     53     * If a value contains the delimiter, the delimiter may be escaped with a backslash.
     54     * If a value contains a backslash, it must also be escaped with a backslash. */
     55    public String values; // NOSONAR
     56    /**
     57     * To use instead of {@link #values} if the list of values has to be obtained with a Java method of this form:
     58     * <p>{@code public static String[] getValues();}<p>
     59     * The value must be: {@code full.package.name.ClassName#methodName}.
     60     */
     61    public String values_from; // NOSONAR
     62    /** The context used for translating {@link #values} */
     63    public String values_context; // NOSONAR
     64    /** Disabled internationalisation for value to avoid mistakes, see #11696 */
     65    public boolean values_no_i18n; // NOSONAR
     66    /** Whether to sort the values, defaults to true. */
     67    public boolean values_sort = true; // NOSONAR
     68    /**
     69     * A list of entries that is displayed to the user.
     70     * Must be the same number and order of entries as {@link #values} and editable must be false or not specified.
     71     * For the delimiter character and escaping, see the remarks at {@link #values}.
     72     */
     73    public String display_values; // NOSONAR
     74    /** The localized version of {@link #display_values}. */
     75    public String locale_display_values; // NOSONAR
     76    /**
     77     * A delimiter-separated list of texts to be displayed below each {@code display_value}.
     78     * (Only if it is not possible to describe the entry in 2-3 words.)
     79     * Instead of comma separated list instead using {@link #values}, {@link #display_values} and {@link #short_descriptions},
     80     * the following form is also supported:<p>
     81     * {@code <list_entry value="" display_value="" short_description="" icon="" icon_size="" />}
     82     */
     83    public String short_descriptions; // NOSONAR
     84    /** The localized version of {@link #short_descriptions}. */
     85    public String locale_short_descriptions; // NOSONAR
     86    /** The default value for the item. If not specified, the current value of the key is chosen as default (if applicable).*/
     87    public String default_; // NOSONAR
     88    /**
     89     * The character that separates values.
     90     * In case of {@link Combo} the default is comma.
     91     * In case of {@link MultiSelect} the default is semicolon and this will also be used to separate selected values in the tag.
     92     */
     93    public String delimiter = ";"; // NOSONAR
     94    /** whether the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".*/
     95    public String use_last_as_default = "false"; // NOSONAR
     96    /** whether to use values for search via {@link TaggingPresetSelector} */
     97    public String values_searchable = "false"; // NOSONAR
     98
     99    protected JComponent component;
     100    protected final Map<String, PresetListEntry> lhm = new LinkedHashMap<>();
     101    private boolean initialized;
     102    protected Usage usage;
     103    protected Object originalValue;
     104
     105    private static final class Renderer implements ListCellRenderer<PresetListEntry> {
    47106
    48107        private final JLabel lbl = new JLabel();
     
    89148            return lbl;
    90149        }
    91     };
    92 
    93     /** The localized version of {@link #text}. */
    94     public String locale_text;
    95     public String values;
    96     public String values_from;
    97     /** The context used for translating {@link #values} */
    98     public String values_context;
    99     /** Disabled internationalisation for value to avoid mistakes, see #11696 */
    100     public boolean values_no_i18n;
    101     /** Whether to sort the values, defaults to true. */
    102     public boolean values_sort = true;
    103     public String display_values;
    104     /** The localized version of {@link #display_values}. */
    105     public String locale_display_values;
    106     public String short_descriptions;
    107     /** The localized version of {@link #short_descriptions}. */
    108     public String locale_short_descriptions;
    109     public String default_;
    110     public String delimiter = ";";
    111     public String use_last_as_default = "false";
    112     /** whether to use values for search via {@link TaggingPresetSelector} */
    113     public String values_searchable = "false";
    114 
    115     protected JComponent component;
    116     protected final Map<String, PresetListEntry> lhm = new LinkedHashMap<>();
    117     private boolean initialized;
    118     protected Usage usage;
    119     protected Object originalValue;
     150    }
    120151
    121152    /**
     
    169200    }
    170201
     202    /**
     203     * Preset list entry.
     204     */
    171205    public static class PresetListEntry implements Comparable<PresetListEntry> {
    172         public String value;
     206        /** Entry value */
     207        public String value; // NOSONAR
    173208        /** The context used for translating {@link #value} */
    174         public String value_context;
    175         public String display_value;
    176         public String short_description;
     209        public String value_context; // NOSONAR
     210        /** Value displayed to the user */
     211        public String display_value; // NOSONAR
     212        /** Text to be displayed below {@code display_value}. */
     213        public String short_description; // NOSONAR
    177214        /** The location of icon file to display */
    178         public String icon;
     215        public String icon; // NOSONAR
    179216        /** The size of displayed icon. If not set, default is size from icon file */
    180         public String icon_size;
     217        public String icon_size; // NOSONAR
    181218        /** The localized version of {@link #display_value}. */
    182         public String locale_display_value;
     219        public String locale_display_value; // NOSONAR
    183220        /** The localized version of {@link #short_description}. */
    184         public String locale_short_description;
     221        public String locale_short_description; // NOSONAR
    185222        private final File zipIcons = TaggingPresetReader.getZipIcons();
    186223
    187         // Cached size (currently only for Combo) to speed up preset dialog initialization
    188         public int prefferedWidth = -1;
    189         public int prefferedHeight = -1;
     224        /** Cached width (currently only for Combo) to speed up preset dialog initialization */
     225        public int prefferedWidth = -1; // NOSONAR
     226        /** Cached height (currently only for Combo) to speed up preset dialog initialization */
     227        public int prefferedHeight = -1; // NOSONAR
    190228
    191229        /**
     
    193231         */
    194232        public PresetListEntry() {
    195         }
    196 
     233            // Public default constructor is needed
     234        }
     235
     236        /**
     237         * Constructs a new {@code PresetListEntry}, initialized with a value.
     238         * @param value value
     239         */
    197240        public PresetListEntry(String value) {
    198241            this.value = value;
    199242        }
    200243
     244        /**
     245         * Returns HTML formatted contents.
     246         * @return HTML formatted contents
     247         */
    201248        public String getListDisplay() {
    202249            if (value.equals(DIFFERENT))
     
    223270        }
    224271
     272        /**
     273         * Returns the value to display.
     274         * @param translated whether the text must be translated
     275         * @return the value to display
     276         */
    225277        public String getDisplayValue(boolean translated) {
    226278            return translated
     
    229281        }
    230282
     283        /**
     284         * Returns the short description to display.
     285         * @param translated whether the text must be translated
     286         * @return the short description to display
     287         */
    231288        public String getShortDescription(boolean translated) {
    232289            return translated
     
    297354    }
    298355
     356    /**
     357     * Returns the values to display.
     358     * @return the values to display
     359     */
    299360    public Collection<String> getDisplayValues() {
    300361        initListEntries();
     
    365426        char delChar = getDelChar();
    366427
    367         String[] value_array = null;
     428        String[] valueArray = null;
    368429
    369430        if (values_from != null) {
    370             String[] class_method = values_from.split("#");
    371             if (class_method != null && class_method.length == 2) {
     431            String[] classMethod = values_from.split("#");
     432            if (classMethod != null && classMethod.length == 2) {
    372433                try {
    373                     Method method = Class.forName(class_method[0]).getMethod(class_method[1]);
     434                    Method method = Class.forName(classMethod[0]).getMethod(classMethod[1]);
    374435                    // Check method is public static String[] methodName()
    375436                    int mod = method.getModifiers();
    376437                    if (Modifier.isPublic(mod) && Modifier.isStatic(mod)
    377438                            && method.getReturnType().equals(String[].class) && method.getParameterTypes().length == 0) {
    378                         value_array = (String[]) method.invoke(null);
     439                        valueArray = (String[]) method.invoke(null);
    379440                    } else {
    380441                        Main.error(tr("Broken tagging preset \"{0}-{1}\" - Java method given in ''values_from'' is not \"{2}\"", key, text,
     
    388449        }
    389450
    390         if (value_array == null) {
    391             value_array = splitEscaped(delChar, values);
    392         }
    393 
    394         String[] display_array = value_array;
     451        if (valueArray == null) {
     452            valueArray = splitEscaped(delChar, values);
     453        }
     454
     455        String[] displayArray = valueArray;
    395456        if (!values_no_i18n) {
    396457            final String displ = Utils.firstNonNull(locale_display_values, display_values);
    397             display_array = displ == null ? value_array : splitEscaped(delChar, displ);
     458            displayArray = displ == null ? valueArray : splitEscaped(delChar, displ);
    398459        }
    399460
    400461        final String descr = Utils.firstNonNull(locale_short_descriptions, short_descriptions);
    401         String[] short_descriptions_array = descr == null ? null : splitEscaped(delChar, descr);
    402 
    403         if (display_array.length != value_array.length) {
     462        String[] shortDescriptionsArray = descr == null ? null : splitEscaped(delChar, descr);
     463
     464        if (displayArray.length != valueArray.length) {
    404465            Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''display_values'' must be the same as in ''values''",
    405466                            key, text));
    406             Main.error(tr("Detailed information: {0} <> {1}", Arrays.toString(display_array), Arrays.toString(value_array)));
    407             display_array = value_array;
    408         }
    409 
    410         if (short_descriptions_array != null && short_descriptions_array.length != value_array.length) {
     467            Main.error(tr("Detailed information: {0} <> {1}", Arrays.toString(displayArray), Arrays.toString(valueArray)));
     468            displayArray = valueArray;
     469        }
     470
     471        if (shortDescriptionsArray != null && shortDescriptionsArray.length != valueArray.length) {
    411472            Main.error(tr("Broken tagging preset \"{0}-{1}\" - number of items in ''short_descriptions'' must be the same as in ''values''",
    412473                            key, text));
    413             Main.error(tr("Detailed information: {0} <> {1}", Arrays.toString(short_descriptions_array), Arrays.toString(value_array)));
    414             short_descriptions_array = null;
    415         }
    416 
    417         final List<PresetListEntry> entries = new ArrayList<>(value_array.length);
    418         for (int i = 0; i < value_array.length; i++) {
    419             final PresetListEntry e = new PresetListEntry(value_array[i]);
     474            Main.error(tr("Detailed information: {0} <> {1}", Arrays.toString(shortDescriptionsArray), Arrays.toString(valueArray)));
     475            shortDescriptionsArray = null;
     476        }
     477
     478        final List<PresetListEntry> entries = new ArrayList<>(valueArray.length);
     479        for (int i = 0; i < valueArray.length; i++) {
     480            final PresetListEntry e = new PresetListEntry(valueArray[i]);
    420481            e.locale_display_value = locale_display_values != null || values_no_i18n
    421                     ? display_array[i]
    422                     : trc(values_context, fixPresetString(display_array[i]));
    423             if (short_descriptions_array != null) {
     482                    ? displayArray[i]
     483                    : trc(values_context, fixPresetString(displayArray[i]));
     484            if (shortDescriptionsArray != null) {
    424485                e.locale_short_description = locale_short_descriptions != null
    425                         ? short_descriptions_array[i]
    426                         : tr(fixPresetString(short_descriptions_array[i]));
     486                        ? shortDescriptionsArray[i]
     487                        : tr(fixPresetString(shortDescriptionsArray[i]));
    427488            }
    428489
     
    481542    }
    482543
     544    /**
     545     * Adds a preset list entry.
     546     * @param e list entry to add
     547     */
    483548    public void addListEntry(PresetListEntry e) {
    484549        lhm.put(e.value, e);
    485550    }
    486551
     552    /**
     553     * Adds a collection of preset list entries.
     554     * @param e list entries to add
     555     */
    487556    public void addListEntries(Collection<PresetListEntry> e) {
    488557        for (PresetListEntry i : e) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparator.java

    r8863 r9492  
    2727    @Override
    2828    public void addCommands(List<Tag> changedTags) {
     29        // Do nothing
    2930    }
    3031
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Key.java

    r9467 r9492  
    1717
    1818    /** The hardcoded value for key */
    19     public String value;
     19    public String value; // NOSONAR
    2020
    2121    @Override
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java

    r9360 r9492  
    2929    protected static final Map<String, String> LAST_VALUES = new HashMap<>();
    3030
    31     public String key;
     31    /** This specifies the property key that will be modified by the item. */
     32    public String key; // NOSONAR
    3233    /** The text to display */
    33     public String text;
     34    public String text; // NOSONAR
    3435    /** The context used for translating {@link #text} */
    35     public String text_context;
    36     public String match = getDefaultMatch().getValue();
     36    public String text_context; // NOSONAR
     37    /**
     38     * Allows to change the matching process, i.e., determining whether the tags of an OSM object fit into this preset.
     39     * If a preset fits then it is linked in the Tags/Membership dialog.<ul>
     40     * <li>none: neutral, i.e., do not consider this item for matching</li>
     41     * <li>key: positive if key matches, neutral otherwise</li>
     42     * <li>key!: positive if key matches, negative otherwise</li>
     43     * <li>keyvalue: positive if key and value matches, neutral otherwise</li>
     44     * <li>keyvalue!: positive if key and value matches, negative otherwise</li></ul>
     45     * Note that for a match, at least one positive and no negative is required.
     46     * Default is "keyvalue!" for {@link Key} and "none" for {@link Text}, {@link Combo}, {@link MultiSelect} and {@link Check}.
     47     */
     48    public String match = getDefaultMatch().getValue(); // NOSONAR
    3749
    3850    /**
     
    8193
    8294    protected static class Usage {
    83         public SortedSet<String> values;
     95        public SortedSet<String> values; // NOSONAR
    8496        private boolean hadKeys;
    8597        private boolean hadEmpty;
     
    132144    }
    133145
     146    /**
     147     * Returns the default match.
     148     * @return the default match
     149     */
    134150    public abstract MatchType getDefaultMatch();
    135151
     152    /**
     153     * Returns the list of values.
     154     * @return the list of values
     155     */
    136156    public abstract Collection<String> getValues();
    137157
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Label.java

    r8863 r9492  
    1919
    2020    /** The location of icon file to display (optional) */
    21     public String icon;
     21    public String icon; // NOSONAR
    2222    /** The size of displayed icon. If not set, default is 16px */
    23     public String icon_size;
     23    public String icon_size; // NOSONAR
    2424
    2525    @Override
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Link.java

    r8863 r9492  
    1818
    1919    /** The link to display. */
    20     public String href;
     20    public String href; // NOSONAR
    2121
    2222    /** The localized version of {@link #href}. */
    23     public String locale_href;
     23    public String locale_href; // NOSONAR
    2424
    2525    @Override
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelect.java

    r8863 r9492  
    2020     * Number of rows to display (positive integer, optional).
    2121     */
    22     public String rows;
     22    public String rows; // NOSONAR
     23
    2324    protected ConcatenatingJList list;
    2425
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Optional.java

    r8863 r9492  
    1212import org.openstreetmap.josm.tools.GBC;
    1313
     14/**
     15 * Used to group optional attributes.
     16 * @since 8863
     17 */
    1418public class Optional extends TextItem {
    1519
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetLink.java

    r8863 r9492  
    2020import org.openstreetmap.josm.tools.Utils;
    2121
     22/**
     23 * Adds a link to an other preset.
     24 * @since 8863
     25 */
    2226public class PresetLink extends TaggingPresetItem {
    2327
    24     public String preset_name = "";
     28    /** The exact name of the preset to link to. Required. */
     29    public String preset_name = ""; // NOSONAR
    2530
    2631    @Override
     
    3338            }
    3439        }).iterator().next();
    35         if (t == null) return false;
     40        if (t == null)
     41            return false;
    3642        JLabel lbl = new TaggingPresetLabel(t);
    3743        lbl.addMouseListener(new MouseAdapter() {
     
    4753    @Override
    4854    public void addCommands(List<Tag> changedTags) {
     55        // Do nothing
    4956    }
    5057}
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java

    r9231 r9492  
    2626
    2727    public static class Role {
    28         public Set<TaggingPresetType> types;
    29         public String key;
     28        public Set<TaggingPresetType> types; // NOSONAR
     29        /** Role name used in a relation */
     30        public String key; // NOSONAR
    3031        /** The text to display */
    31         public String text;
     32        public String text; // NOSONAR
    3233        /** The context used for translating {@link #text} */
    33         public String text_context;
     34        public String text_context; // NOSONAR
    3435        /** The localized version of {@link #text}. */
    35         public String locale_text;
    36         public SearchCompiler.Match memberExpression;
     36        public String locale_text; // NOSONAR
     37        /** An expression (cf. search dialog) for objects of this role */
     38        public SearchCompiler.Match memberExpression; // NOSONAR
    3739
    38         public boolean required;
     40        public boolean required; // NOSONAR
    3941        private long count;
    4042
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Space.java

    r8863 r9492  
    2626    @Override
    2727    public void addCommands(List<Tag> changedTags) {
     28        // Do nothing
    2829    }
    2930
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java

    r9360 r9492  
    3838public class Text extends KeyedItem {
    3939
    40     private static int auto_increment_selected;
     40    private static int auto_increment_selected; // NOSONAR
    4141
    4242    /** The localized version of {@link #text}. */
    43     public String locale_text;
    44     public String default_;
    45     public String originalValue;
    46     public String use_last_as_default = "false";
    47     public String auto_increment;
    48     public String length;
    49     public String alternative_autocomplete_keys;
     43    public String locale_text; // NOSONAR
     44    /** The default value for the item. If not specified, the current value of the key is chosen as default (if applicable). Defaults to "". */
     45    public String default_; // NOSONAR
     46    public String originalValue; // NOSONAR
     47    /** whether the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".*/
     48    public String use_last_as_default = "false"; // NOSONAR
     49    /**
     50     * May contain a comma separated list of integer increments or decrements, e.g. "-2,-1,+1,+2".
     51     * A button will be shown next to the text field for each value, allowing the user to select auto-increment with the given stepping.
     52     * Auto-increment only happens if the user selects it. There is also a button to deselect auto-increment.
     53     * Default is no auto-increment. Mutually exclusive with {@link use_last_as_default}.
     54     */
     55    public String auto_increment; // NOSONAR
     56    /** The length of the text box (number of characters allowed). */
     57    public String length; // NOSONAR
     58    /** A comma separated list of alternative keys to use for autocompletion. */
     59    public String alternative_autocomplete_keys; // NOSONAR
    5060
    5161    private JComponent value;
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/TextItem.java

    r8863 r9492  
    1414
    1515    /** The text to display */
    16     public String text;
     16    public String text; // NOSONAR
    1717
    1818    /** The context used for translating {@link #text} */
    19     public String text_context;
     19    public String text_context; // NOSONAR
    2020
    2121    /** The localized version of {@link #text} */
    22     public String locale_text;
     22    public String locale_text; // NOSONAR
    2323
    2424    protected final void initializeLocaleText(String defaultText) {
     
    3030    @Override
    3131    public void addCommands(List<Tag> changedTags) {
     32        // Do nothing
    3233    }
    3334
Note: See TracChangeset for help on using the changeset viewer.