Ticket #10606: show_note_id.patch

File show_note_id.patch, 2.2 KB (added by ToeBee, 10 years ago)
  • src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

     
    226226                }
    227227                String toolTipText = userName + " @ " + sdf.format(note.getCreatedAt());
    228228                JLabel jlabel = (JLabel)comp;
    229                 jlabel.setText(text);
     229                jlabel.setText(note.getId() + ": " +text);
    230230                ImageIcon icon;
    231231                if (note.getId() < 0) {
    232232                    icon = ICON_NEW_SMALL;
  • src/org/openstreetmap/josm/gui/layer/NoteLayer.java

     
    110110        }
    111111        if (noteData.getSelectedNote() != null) {
    112112            StringBuilder sb = new StringBuilder("<html>");
     113            sb.append(tr("Note"));
     114            sb.append(" " + noteData.getSelectedNote().getId());
    113115            List<NoteComment> comments = noteData.getSelectedNote().getComments();
    114             String sep = "";
    115116            SimpleDateFormat dayFormat = new SimpleDateFormat("MMM d, yyyy");
    116117            for (NoteComment comment : comments) {
    117118                String commentText = comment.getText();
    118119                //closing a note creates an empty comment that we don't want to show
    119120                if (commentText != null && commentText.trim().length() > 0) {
    120                     sb.append(sep);
     121                    sb.append("<hr/>");
    121122                    String userName = XmlWriter.encode(comment.getUser().getName());
    122123                    if (userName == null || userName.trim().length() == 0) {
    123124                        userName = "&lt;Anonymous&gt;";
     
    130131                    htmlText = htmlText.replace("&#xA;", "<br/>"); //encode method leaves us with entity instead of \n
    131132                    sb.append(htmlText);
    132133                }
    133                 sep = "<hr/>";
    134134            }
    135135            sb.append("</html>");
    136136            JToolTip toolTip = new JToolTip();