Changeset 16696 in josm


Ignore:
Timestamp:
2020-06-21T14:08:23+02:00 (4 years ago)
Author:
simon04
Message:

see #19381 - Upload dialog: (re)validate when showing the dialog

File:
1 edited

Legend:

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

    r16673 r16696  
    3535import org.openstreetmap.josm.gui.MainApplication;
    3636import org.openstreetmap.josm.gui.io.UploadTextComponentValidator.UploadAreaValidator;
     37import org.openstreetmap.josm.gui.io.UploadTextComponentValidator.UploadCommentValidator;
     38import org.openstreetmap.josm.gui.io.UploadTextComponentValidator.UploadSourceValidator;
    3739import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    3840import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
     
    7880    private final transient ChangesetCommentModel changesetSourceModel;
    7981    private final transient ChangesetReviewModel changesetReviewModel;
     82    private final transient JLabel uploadCommentFeedback = new JLabel();
     83    private final transient UploadCommentValidator uploadCommentValidator = new UploadCommentValidator(
     84            hcbUploadComment.getEditorComponent(), uploadCommentFeedback);
     85    private final transient JLabel hcbUploadSourceFeedback = new JLabel();
     86    private final transient UploadSourceValidator uploadSourceValidator = new UploadSourceValidator(
     87            hcbUploadSource.getEditorComponent(), hcbUploadSourceFeedback);
    8088
    8189    protected JPanel buildUploadCommentPanel() {
     
    9098        hcbUploadComment.getEditorComponent().addFocusListener(commentModelListener);
    9199        pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL));
    92         JLabel hcbUploadCommentFeedback = new JLabel();
    93         pnl.add(hcbUploadCommentFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL));
    94         new UploadTextComponentValidator.UploadCommentValidator(hcbUploadComment.getEditorComponent(), hcbUploadCommentFeedback);
     100        pnl.add(uploadCommentFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL));
    95101        return pnl;
    96102    }
     
    129135        hcbUploadSource.getEditorComponent().addFocusListener(sourceModelListener);
    130136        pnl.add(hcbUploadSource, GBC.eol().fill(GBC.HORIZONTAL));
    131         JLabel hcbUploadSourceFeedback = new JLabel();
    132137        pnl.add(hcbUploadSourceFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL));
    133         new UploadTextComponentValidator.UploadSourceValidator(hcbUploadSource.getEditorComponent(), hcbUploadSourceFeedback);
    134138        if (obtainSourceAutomatically.isSelected()) {
    135139            automaticallyAddSource();
     
    264268        hcbUploadComment.requestFocusInWindow();
    265269        hcbUploadComment.getEditorComponent().requestFocusInWindow();
     270        uploadCommentValidator.validate();
     271        uploadSourceValidator.validate();
    266272    }
    267273
Note: See TracChangeset for help on using the changeset viewer.