Changeset 18283 in josm for trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
- Timestamp:
- 2021-10-17T15:17:42+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r18221 r18283 103 103 } 104 104 105 protected void build() { 106 setLayout(new GridBagLayout()); 107 setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); 108 GBC gbc = GBC.eop().fill(GBC.HORIZONTAL); 109 add(buildUploadCommentPanel(), gbc); 110 add(buildUploadSourcePanel(), gbc); 111 add(pnlUploadParameterSummary, gbc); 112 if (Config.getPref().getBoolean("upload.show.review.request", true)) { 113 add(cbRequestReview, gbc); 114 cbRequestReview.addItemListener(this); 115 } 116 add(areaValidatorFeedback, gbc); 117 add(new JPanel(), GBC.std().fill(GBC.BOTH)); 118 } 119 105 120 protected JPanel buildUploadCommentPanel() { 106 121 JPanel pnl = new JPanel(new GridBagLayout()); … … 114 129 editor.addFocusListener(this); 115 130 editor.addActionListener(this); 116 pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL)); 117 pnl.add(uploadCommentFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL)); 131 GBC gbc = GBC.eol().insets(3).fill(GBC.HORIZONTAL); 132 pnl.add(hcbUploadComment, gbc); 133 pnl.add(uploadCommentFeedback, gbc); 118 134 return pnl; 119 135 } … … 142 158 obtainSource.add(obtainSourceOnce, GBC.std().anchor(GBC.WEST)); 143 159 obtainSource.add(new JLabel(), GBC.eol().fill(GBC.HORIZONTAL)); 144 if (Config.getPref().getBoolean("upload.show.automatic.source", true)) {145 pnl.add(obtainSource, GBC.eol().insets(0, 0, 10, 3).fill(GBC.HORIZONTAL));146 }147 160 148 161 hcbUploadSource.setToolTipText(tr("Enter a source")); … … 153 166 editor.addFocusListener(this); 154 167 editor.addActionListener(this); 155 pnl.add(hcbUploadSource, GBC.eol().fill(GBC.HORIZONTAL)); 156 pnl.add(hcbUploadSourceFeedback, GBC.eol().insets(0, 3, 0, 0).fill(GBC.HORIZONTAL)); 157 168 GBC gbc = GBC.eol().insets(3).fill(GBC.HORIZONTAL); 169 if (Config.getPref().getBoolean("upload.show.automatic.source", true)) { 170 pnl.add(obtainSource, gbc); 171 } 172 pnl.add(hcbUploadSource, gbc); 173 pnl.add(hcbUploadSourceFeedback, gbc); 158 174 return pnl; 159 175 } … … 162 178 * Initializes this life cycle of the panel. 163 179 * 164 * Adds any changeset tags to the map. 180 * Adds the comment and source tags from history, and/or obtains the source from the layer if 181 * the user said so. 165 182 * 166 183 * @param map Map where tags are added to. … … 179 196 hcbUploadSource.getModel().prefs().load(SOURCE_HISTORY_KEY, getDefaultSources()); 180 197 hcbUploadSource.discardAllUndoableEdits(); 198 hcbUploadComment.getEditorComponent().requestFocusInWindow(); 199 uploadCommentValidator.validate(); 200 uploadSourceValidator.validate(); 181 201 } 182 202 … … 233 253 protected List<UploadTextComponentValidator> getUploadTextValidators() { 234 254 return Arrays.asList(areaValidator, uploadCommentValidator, uploadSourceValidator); 235 }236 237 protected void build() {238 setLayout(new GridBagLayout());239 setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));240 GBC gbc = GBC.eol().insets(0, 0, 0, 20).fill(GBC.HORIZONTAL);241 add(buildUploadCommentPanel(), gbc);242 add(buildUploadSourcePanel(), gbc);243 add(pnlUploadParameterSummary, gbc);244 if (Config.getPref().getBoolean("upload.show.review.request", true)) {245 add(cbRequestReview, gbc);246 cbRequestReview.addItemListener(this);247 }248 add(areaValidatorFeedback, gbc);249 add(new JPanel(), GBC.std().fill(GBC.BOTH));250 255 } 251 256 … … 266 271 // store current value of obtaining source automatically 267 272 Config.getPref().putBoolean("upload.source.obtainautomatically", obtainSourceAutomatically.isSelected()); 268 }269 270 /**271 * Initializes the panel for user input272 */273 public void startUserInput() {274 hcbUploadComment.getEditorComponent().requestFocusInWindow();275 uploadCommentValidator.validate();276 uploadSourceValidator.validate();277 273 } 278 274
Note:
See TracChangeset
for help on using the changeset viewer.