Changeset 12494 in josm
- Timestamp:
- 2017-07-22T22:41:19+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r12033 r12494 10 10 import java.util.Map; 11 11 import java.util.Objects; 12 import java.util.Optional; 12 13 13 14 import org.openstreetmap.josm.data.Bounds; … … 264 265 265 266 /** 266 * Replies the number of comments for this changeset. 267 * @return the number of comments for this changeset 267 * Replies this changeset comment. 268 * @return this changeset comment (empty string if missing) 269 * @since 12494 270 */ 271 public String getComment() { 272 return Optional.ofNullable(get("comment")).orElse(""); 273 } 274 275 /** 276 * Replies the number of comments for this changeset discussion. 277 * @return the number of comments for this changeset discussion 268 278 * @since 7700 269 279 */ … … 273 283 274 284 /** 275 * Sets the number of comments for this changeset .276 * @param commentsCount the number of comments for this changeset 285 * Sets the number of comments for this changeset discussion. 286 * @param commentsCount the number of comments for this changeset discussion 277 287 * @since 7700 278 288 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
r10217 r12494 19 19 20 20 protected void renderUploadComment(Changeset cs) { 21 String comment = cs.get ("comment");22 if (comment == null || comment.trim().isEmpty()) {21 String comment = cs.getComment(); 22 if (comment.trim().isEmpty()) { 23 23 setText(trc("changeset.upload-comment", "empty")); 24 24 setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r11878 r12494 221 221 if (cs == null) return; 222 222 tfID.setText(Integer.toString(cs.getId())); 223 String comment = cs.get("comment"); 224 taComment.setText(comment == null ? "" : comment); 223 taComment.setText(cs.getComment()); 225 224 226 225 if (cs.isOpen()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListCellRenderer.java
r12372 r12494 42 42 sb.append(tr("{0} [incomplete]", cs.getId())); 43 43 } else { 44 String comment = cs.get ("comment");44 String comment = cs.getComment(); 45 45 sb.append(cs.getId()) 46 46 .append(" - ") 47 47 .append(cs.isOpen() ? tr("open") : tr("closed")); 48 if ( comment != null) {48 if (!comment.isEmpty()) { 49 49 sb.append(" - '").append(comment).append('\''); 50 50 } -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
r11878 r12494 43 43 DateUtils.formatDateTime(createdDate, DateFormat.SHORT, DateFormat.SHORT)).append("<br>"); 44 44 } 45 String comment = cs.get ("comment");46 if ( comment != null) {45 String comment = cs.getComment(); 46 if (!comment.isEmpty()) { 47 47 sb.append("<strong>").append(tr("Changeset comment:")).append("</strong>") 48 48 .append(Utils.escapeReservedCharactersHTML(comment)).append("<br>"); … … 64 64 setIcon(icon); 65 65 StringBuilder sb = new StringBuilder(); 66 String comment = cs.get ("comment");67 if ( comment != null) {66 String comment = cs.getComment(); 67 if (!comment.isEmpty()) { 68 68 sb.append(cs.getId()).append(" - ").append(comment); 69 69 } else if (cs.get("name") != null) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
r12370 r12494 8 8 import java.beans.PropertyChangeEvent; 9 9 import java.beans.PropertyChangeListener; 10 import java.util.Optional;11 10 12 11 import javax.swing.BorderFactory; … … 52 51 msg.append(tr("Objects are uploaded to the <strong>open changeset</strong> {0} with upload comment ''{1}''.", 53 52 selectedChangeset.getId(), 54 Optional.ofNullable(selectedChangeset.get("comment")).orElse("")53 selectedChangeset.getComment() 55 54 )); 56 55 }
Note:
See TracChangeset
for help on using the changeset viewer.