Changeset 3279 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-05-24T23:36:44+02:00 (14 years ago)
Author:
stoecker
Message:

fix #4192 - allow definition of true/false values in presets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r3273 r3279  
    224224        public String text_context;
    225225        public String locale_text;
     226        public String value_on = OsmUtils.trueval;
     227        public String value_off = OsmUtils.falseval;
    226228        public boolean default_ = false; // only used for tagless objects
    227229        public boolean use_last_as_default = false;
     
    249251                oneValue = s;
    250252            }
    251             if (usage.values.size() < 2 && (oneValue == null || OsmUtils.trueval.equals(oneValue) || OsmUtils.falseval.equals(oneValue))) {
     253            if (usage.values.size() < 2 && (oneValue == null || value_on.equals(oneValue) || value_off.equals(oneValue))) {
    252254                if(def)
    253255                {
     
    260262                // all selected objects share the same value which is either true or false or unset,
    261263                // we can display a standard check box.
    262                 initialState = OsmUtils.trueval.equals(oneValue) ?
     264                initialState = value_on.equals(oneValue) ?
    263265                        QuadStateCheckBox.State.SELECTED :
    264                             OsmUtils.falseval.equals(oneValue) ?
     266                            value_off.equals(oneValue) ?
    265267                                    QuadStateCheckBox.State.NOT_SELECTED :
    266268                                        def ? QuadStateCheckBox.State.SELECTED
     
    294296            // otherwise change things according to the selected value.
    295297            cmds.add(new ChangePropertyCommand(sel, key,
    296                     check.getState() == QuadStateCheckBox.State.SELECTED ? OsmUtils.trueval :
    297                         check.getState() == QuadStateCheckBox.State.NOT_SELECTED ? OsmUtils.falseval :
     298                    check.getState() == QuadStateCheckBox.State.SELECTED ? value_on :
     299                        check.getState() == QuadStateCheckBox.State.NOT_SELECTED ? value_off :
    298300                            null));
    299301        }
Note: See TracChangeset for help on using the changeset viewer.