Changeset 16697 in josm


Ignore:
Timestamp:
2020-06-21T14:08:25+02:00 (2 weeks ago)
Author:
simon04
Message:

see #19381 - Upload dialog: avoid unnecessary UI updates when validating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/UploadTextComponentValidator.java

    r16695 r16697  
    66import java.util.Collection;
    77import java.util.Collections;
     8import java.util.Objects;
    89
    910import javax.swing.JLabel;
     
    3334        msg = msg != null ? "<html>\u2714 " + msg : null;
    3435        super.feedbackValid(msg);
    35         feedback.setText(msg);
    36         feedback.setForeground(VALID_COLOR);
    37         feedback.setBackground(null);
    38         feedback.setBorder(null);
     36        if (!Objects.equals(msg, feedback.getText())) {
     37            feedback.setText(msg);
     38            feedback.setForeground(VALID_COLOR);
     39            feedback.setBackground(null);
     40            feedback.setBorder(null);
     41        }
    3942    }
    4043
     
    4346        msg = msg != null ? "<html>" + msg : null;
    4447        super.feedbackWarning(msg);
    45         feedback.setText(msg);
    46         feedback.setForeground(null);
    47         feedback.setBackground(WARNING_BACKGROUND);
    48         feedback.setBorder(WARNING_BORDER);
     48        if (!Objects.equals(msg, feedback.getText())) {
     49            feedback.setText(msg);
     50            feedback.setForeground(null);
     51            feedback.setBackground(WARNING_BACKGROUND);
     52            feedback.setBorder(WARNING_BORDER);
     53        }
    4954    }
    5055
Note: See TracChangeset for help on using the changeset viewer.