Changeset 16675 in josm


Ignore:
Timestamp:
2020-06-17T23:03:35+02:00 (3 weeks ago)
Author:
simon04
Message:

fix #19381 - AbstractTextComponentValidator: use NamedColorProperty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java

    r16672 r16675  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.widgets;
     3
     4import static org.openstreetmap.josm.tools.I18n.marktr;
    35
    46import java.awt.Color;
     
    1820import javax.swing.text.JTextComponent;
    1921
     22import org.openstreetmap.josm.data.preferences.NamedColorProperty;
    2023import org.openstreetmap.josm.tools.CheckParameterUtil;
    2124
     
    3336 */
    3437public abstract class AbstractTextComponentValidator implements ActionListener, FocusListener, DocumentListener, PropertyChangeListener {
    35     protected static final Color ERROR_COLOR = Color.RED;
     38
     39    protected static final Color ERROR_COLOR = new NamedColorProperty(marktr("Input validation: error"), Color.RED).get();
    3640    protected static final Border ERROR_BORDER = BorderFactory.createLineBorder(ERROR_COLOR, 1);
    37     protected static final Color ERROR_BACKGROUND = new Color(0xFFCCCC);
    38     protected static final Color WARNING_COLOR = new Color(0xFFA500);
     41    protected static final Color ERROR_BACKGROUND = new NamedColorProperty(
     42            marktr("Input validation: error background"), new Color(0xFFCCCC)).get();
     43
     44    protected static final Color WARNING_COLOR = new NamedColorProperty(marktr("Input validation: warning"), new Color(0xFFA500)).get();
    3945    protected static final Border WARNING_BORDER = BorderFactory.createLineBorder(WARNING_COLOR, 1);
    40     protected static final Color WARNING_BACKGROUND = new Color(0xFFEDCC);
    41     protected static final Color VALID_COLOR = new Color(0x008000);
     46    protected static final Color WARNING_BACKGROUND = new NamedColorProperty(
     47            marktr("Input validation: warning background"), new Color(0xFFEDCC)).get();
     48
     49    protected static final Color VALID_COLOR = new NamedColorProperty(marktr("Input validation: valid"), new Color(0x008000)).get();
    4250    protected static final Border VALID_BORDER = BorderFactory.createLineBorder(VALID_COLOR, 1);
    4351
Note: See TracChangeset for help on using the changeset viewer.