Changeset 10162 in josm
- Timestamp:
- 2016-04-28T18:30:07+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r10134 r10162 37 37 import org.openstreetmap.josm.data.notes.Note; 38 38 import org.openstreetmap.josm.data.notes.Note.State; 39 import org.openstreetmap.josm.data.notes.NoteComment; 39 40 import org.openstreetmap.josm.data.osm.NoteData; 40 41 import org.openstreetmap.josm.gui.MapView; … … 238 239 Component comp = defaultListCellRenderer.getListCellRendererComponent(list, note, index, isSelected, cellHasFocus); 239 240 if (note != null && comp instanceof JLabel) { 240 String text = note.getFirstComment().getText(); 241 String userName = note.getFirstComment().getUser().getName(); 242 if (userName == null || userName.isEmpty()) { 243 userName = "<Anonymous>"; 241 NoteComment fstComment = note.getFirstComment(); 242 JLabel jlabel = (JLabel) comp; 243 if (fstComment != null) { 244 String text = note.getFirstComment().getText(); 245 String userName = note.getFirstComment().getUser().getName(); 246 if (userName == null || userName.isEmpty()) { 247 userName = "<Anonymous>"; 248 } 249 String toolTipText = userName + " @ " + dateFormat.format(note.getCreatedAt()); 250 jlabel.setToolTipText(toolTipText); 251 jlabel.setText(note.getId() + ": " +text); 252 } else { 253 jlabel.setToolTipText(null); 254 jlabel.setText(Long.toString(note.getId())); 244 255 } 245 String toolTipText = userName + " @ " + dateFormat.format(note.getCreatedAt());246 JLabel jlabel = (JLabel) comp;247 jlabel.setText(note.getId() + ": " +text);248 256 ImageIcon icon; 249 257 if (note.getId() < 0) { … … 255 263 } 256 264 jlabel.setIcon(icon); 257 jlabel.setToolTipText(toolTipText);258 265 } 259 266 return comp;
Note:
See TracChangeset
for help on using the changeset viewer.