Ignore:
Timestamp:
2008-07-11T20:49:51+02:00 (16 years ago)
Author:
stoecker
Message:

added tooltip text for presets menu (very helpful in toolbar)

File:
1 edited

Legend:

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

    r700 r702  
    3939import org.openstreetmap.josm.command.SequenceCommand;
    4040import org.openstreetmap.josm.data.osm.OsmPrimitive;
     41import org.openstreetmap.josm.data.osm.OsmUtils;
    4142import org.openstreetmap.josm.gui.QuadStateCheckBox;
    4243import org.openstreetmap.josm.tools.GBC;
     
    8283                returnValue.values = new HashSet<String>();
    8384                for (OsmPrimitive s : sel) {
    84                         String v = s.get(key);
    85                         if ("true".equalsIgnoreCase(v)) v = "true";
    86                         else if ("yes".equalsIgnoreCase(v)) v = "true";
    87                         else if ("1".equals(v)) v = "true";
    88                         else if ("false".equalsIgnoreCase(v)) v = "false";
    89                         else if ("no".equalsIgnoreCase(v)) v = "false";
    90                         else if ("0".equals(v)) v = "false";                   
    91                         returnValue.values.add(v);
     85                        returnValue.values.add(OsmUtils.getNamedOsmBoolean(s.get(key)));
    9286                }
    9387                return returnValue;
     
    173167                        String oneValue = null;
    174168                        for (String s : usage.values) oneValue = s;
    175                         if (usage.values.size() < 2 && (oneValue == null || "true".equals(oneValue) || "false".equals(oneValue))) {
     169                        if (usage.values.size() < 2 && (oneValue == null || OsmUtils.trueval.equals(oneValue) || OsmUtils.falseval.equals(oneValue))) {
    176170                                // all selected objects share the same value which is either true or false or unset,
    177171                                // we can display a standard check box.
    178                                 initialState = "true".equals(oneValue) ?
     172                                initialState = OsmUtils.trueval.equals(oneValue) ?
    179173                                                        QuadStateCheckBox.State.SELECTED :
    180                                                         "false".equals(oneValue) ?
     174                                                        OsmUtils.falseval.equals(oneValue) ?
    181175                                                        QuadStateCheckBox.State.NOT_SELECTED :
    182176                                                        QuadStateCheckBox.State.UNSET;
     
    207201                        // otherwise change things according to the selected value.
    208202                        cmds.add(new ChangePropertyCommand(sel, key,
    209                                         check.getState() == QuadStateCheckBox.State.SELECTED ? "true" :
    210                                         check.getState() == QuadStateCheckBox.State.NOT_SELECTED ? "false" :
     203                                        check.getState() == QuadStateCheckBox.State.SELECTED ? OsmUtils.trueval :
     204                                        check.getState() == QuadStateCheckBox.State.NOT_SELECTED ? OsmUtils.falseval :
    211205                                        null));
    212206                }
     
    355349        public void setDisplayName(String name) {
    356350                putValue(Action.NAME, tr(name));
     351                String tooltip = tr("Use presets ''{0}''", tr(name));
     352                putValue(SHORT_DESCRIPTION, "<html>"+tooltip+"</html>");
    357353        }
    358354
Note: See TracChangeset for help on using the changeset viewer.