source: josm/trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java@ 5003

Last change on this file since 5003 was 4414, checked in by bastiK, 13 years ago

applied #6742 - allow script generated files to set default changeset info (based on patch by brycenesbitt)

To set a default upload comment and other tags, include a changeset element in the osm file like this:
<osm version='0.6' upload-changeset='-1'>

<changeset id='-1'>

<tag k='comment' v='suggested upload comment'/>
<tag k='source' v='the source'/>

</changeset>
<node .../>
...

</osm>

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import java.util.Observable;
5
6/**
7 * ChangesetCommentModel is an observable model for the changeset comment edited
8 * in the {@see UploadDialog}.
9 *
10 */
11public class ChangesetCommentModel extends Observable {
12 private String comment = "";
13
14 /**
15 * Sets the current changeset comment and notifies observers if the comment
16 * has changed.
17 *
18 * @param comment the new upload comment. Empty string assumed if null.
19 */
20 public void setComment(String comment) {
21 String oldValue = this.comment;
22 this.comment = comment == null ? "" : comment;
23 if (!oldValue.equals(this.comment)) {
24 setChanged();
25 notifyObservers(this.comment);
26 }
27 }
28
29 /**
30 * Replies the current changeset comment in this model.
31 *
32 * @return the current changeset comment in this model.
33 */
34 public String getComment() {
35 return comment == null ? "": comment;
36 }
37}
Note: See TracBrowser for help on using the repository browser.