- Timestamp:
- 2015-01-31T15:17:59+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r7715 r7995 13 13 import org.openstreetmap.josm.data.coor.LatLon; 14 14 import org.openstreetmap.josm.data.osm.visitor.Visitor; 15 import org.openstreetmap.josm.tools.CheckParameterUtil; 15 16 16 17 /** … … 21 22 public final class Changeset implements Tagged { 22 23 23 /** The maximum changeset comment textlength allowed by API 0.6 **/24 public static final int MAX_C OMMENT_LENGTH = 255;24 /** The maximum changeset tag length allowed by API 0.6 **/ 25 public static final int MAX_CHANGESET_TAG_LENGTH = 255; 25 26 26 27 /** the changeset id */ … … 191 192 @Override 192 193 public void setKeys(Map<String, String> keys) { 194 CheckParameterUtil.ensureParameterNotNull(keys, "keys"); 195 for (String value : keys.values()) { 196 if (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH) { 197 throw new IllegalArgumentException("Changeset tag value is too long: "+value); 198 } 199 } 193 200 this.tags = keys; 194 201 } … … 204 211 @Override 205 212 public void put(String key, String value) { 213 CheckParameterUtil.ensureParameterNotNull(key, "key"); 214 if (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH) { 215 throw new IllegalArgumentException("Changeset tag value is too long: "+value); 216 } 206 217 this.tags.put(key, value); 207 218 } -
trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
r7039 r7995 34 34 35 35 /** 36 * BasicUploadSettingsPanel allows to enter the basic parameters required for uploading 37 * data. 38 * 36 * BasicUploadSettingsPanel allows to enter the basic parameters required for uploading data. 37 * @since 2599 39 38 */ 40 39 public class BasicUploadSettingsPanel extends JPanel { … … 56 55 JPanel pnl = new JPanel(new GridBagLayout()); 57 56 58 finalJEditorPane commentLabel = new JMultilineLabel("<html><b>" + tr("Provide a brief comment for the changes you are uploading:"));57 JEditorPane commentLabel = new JMultilineLabel("<html><b>" + tr("Provide a brief comment for the changes you are uploading:")); 59 58 pnl.add(commentLabel, GBC.eol().insets(0, 5, 10, 3).fill(GBC.HORIZONTAL)); 60 59 hcbUploadComment.setToolTipText(tr("Enter an upload comment")); 61 hcbUploadComment.setMaxTextLength(Changeset.MAX_C OMMENT_LENGTH);60 hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 62 61 List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>())); 63 62 Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 64 63 hcbUploadComment.setPossibleItems(cmtHistory); 65 finalCommentModelListener commentModelListener = new CommentModelListener(hcbUploadComment, changesetCommentModel);64 CommentModelListener commentModelListener = new CommentModelListener(hcbUploadComment, changesetCommentModel); 66 65 hcbUploadComment.getEditor().addActionListener(commentModelListener); 67 66 hcbUploadComment.getEditor().getEditorComponent().addFocusListener(commentModelListener); 68 67 pnl.add(hcbUploadComment, GBC.eol().fill(GBC.HORIZONTAL)); 69 68 70 finalJEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes")69 JEditorPane sourceLabel = new JMultilineLabel("<html><b>" + tr("Specify the data source for the changes") 71 70 + "</b> (<a href=\"urn:changeset-source\">" + tr("obtain from current layers") + "</a>)<b>:</b>"); 72 71 sourceLabel.addHyperlinkListener(new HyperlinkListener() { … … 83 82 84 83 hcbUploadSource.setToolTipText(tr("Enter a source")); 85 List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, Arrays.asList("knowledge", "survey", "Bing"))); 84 hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH); 85 List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, 86 Arrays.asList("knowledge", "survey", "Bing"))); 86 87 Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 87 88 hcbUploadSource.setPossibleItems(sourceHistory); 88 finalCommentModelListener sourceModelListener = new CommentModelListener(hcbUploadSource, changesetSourceModel);89 CommentModelListener sourceModelListener = new CommentModelListener(hcbUploadSource, changesetSourceModel); 89 90 hcbUploadSource.getEditor().addActionListener(sourceModelListener); 90 91 hcbUploadSource.getEditor().getEditorComponent().addFocusListener(sourceModelListener);
Note:
See TracChangeset
for help on using the changeset viewer.