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

Last change on this file since 8918 was 8510, checked in by Don-vip, 9 years ago

checkstyle: enable relevant whitespace checks and fix them

  • 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.Objects;
5import java.util.Observable;
6
7/**
8 * ChangesetCommentModel is an observable model for the changeset comment edited
9 * in the {@link UploadDialog}.
10 * @since 3133
11 */
12public class ChangesetCommentModel extends Observable {
13 private String comment = "";
14
15 /**
16 * Sets the current changeset comment and notifies observers if the comment 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 (!Objects.equals(oldValue, 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.