Ignore:
Timestamp:
2013-12-27T17:14:34+01:00 (10 years ago)
Author:
simon04
Message:

see #9414 - MapCSS-based tagchecker: migrate remaining tagchecks

All former tagchecker.cfg checks are now located in data/validator/*mapcss :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r6538 r6548  
    255255                cmds.add(new ChangePropertyKeyCommand(p, oldKey, newKey));
    256256            }
    257             return new SequenceCommand(tr("Fix of {0}", getDescription()), cmds);
     257            return new SequenceCommand(tr("Fix of {0}", getDescriptionForMatchingSelector(matchingSelector)), cmds);
    258258        }
    259259
     
    271271         *
    272272         * @return a description (possibly with alternative suggestions)
     273         * @see {@link #getDescriptionForMatchingSelector(Selector)}
    273274         */
    274275        String getDescription() {
     
    281282        }
    282283
     284        /**
     285         * Constructs a (localized) description for this deprecation check
     286         * where any placeholders are replaced by values of the matched selector.
     287         *
     288         * @return a description (possibly with alternative suggestions)
     289         */
     290        String getDescriptionForMatchingSelector(Selector matchingSelector) {
     291            return insertArguments(matchingSelector, getDescription());
     292        }
     293
    283294        Severity getSeverity() {
    284295            return errors.values().iterator().next();
     296        }
     297
     298        @Override
     299        public String toString() {
     300            return getDescription();
    285301        }
    286302
     
    295311            if (matchingSelector != null) {
    296312                final Command fix = fixPrimitive(p);
    297                 final String description = TagCheck.insertArguments(matchingSelector, getDescription());
     313                final String description = getDescriptionForMatchingSelector(matchingSelector);
    298314                if (fix != null) {
    299315                    return new FixableTestError(null, getSeverity(), description, 3000, p, fix);
     
    363379        addMapCSS("religion.mapcss");
    364380        addMapCSS("relation.mapcss");
     381        addMapCSS("combinations.mapcss");
     382        addMapCSS("unnecessary.mapcss");
     383        addMapCSS("wikipedia.mapcss");
     384        addMapCSS("power.mapcss");
    365385    }
    366386}
Note: See TracChangeset for help on using the changeset viewer.