Ignore:
Timestamp:
2017-08-26T21:28:55+02:00 (7 years ago)
Author:
Don-vip
Message:

see #14704 - allow to export validator errors ("Save as" in validator layer contextual menu). Same format than Osmose

File:
1 edited

Legend:

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

    r12620 r12667  
    1414    // CHECKSTYLE.OFF: SingleSpaceSeparator
    1515    /** Error messages */
    16     ERROR(tr("Errors"), /* ICON(data/) */"error",       new ColorProperty(marktr("validation error"), Color.RED).get()),
     16    ERROR(1, tr("Errors"), /* ICON(data/) */"error",       new ColorProperty(marktr("validation error"), Color.RED).get()),
    1717    /** Warning messages */
    18     WARNING(tr("Warnings"), /* ICON(data/) */"warning", new ColorProperty(marktr("validation warning"), Color.YELLOW).get()),
     18    WARNING(2, tr("Warnings"), /* ICON(data/) */"warning", new ColorProperty(marktr("validation warning"), Color.YELLOW).get()),
    1919    /** Other messages */
    20     OTHER(tr("Other"), /* ICON(data/) */"other",        new ColorProperty(marktr("validation other"), Color.CYAN).get());
     20    OTHER(3, tr("Other"), /* ICON(data/) */"other",        new ColorProperty(marktr("validation other"), Color.CYAN).get());
    2121    // CHECKSTYLE.ON: SingleSpaceSeparator
     22
     23    /** Numeric ordering of the severities, 1 being major, 3 being minor */
     24    private final int level;
    2225
    2326    /** Description of the severity code */
     
    3336     * Constructor
    3437     *
     38     * @param level Numeric ordering, 1 being major, 3 being minor
    3539     * @param message Description
    3640     * @param icon Associated icon
    3741     * @param color The color of this severity
    3842     */
    39     Severity(String message, String icon, Color color) {
     43    Severity(int level, String message, String icon, Color color) {
     44        this.level = level;
    4045        this.message = message;
    4146        this.icon = icon;
     
    7277        return color;
    7378    }
     79
     80    /**
     81     * Gets the severity level, 1 being major, 3 being minor
     82     * @return The severity level
     83     * @since 12667
     84     */
     85    public int getLevel() {
     86        return level;
     87    }
    7488}
Note: See TracChangeset for help on using the changeset viewer.