4141 */
4242package com .junichi11 .netbeans .modules .github .issues .issue .ui ;
4343
44+ import com .junichi11 .netbeans .modules .github .issues .utils .DateUtils ;
4445import java .awt .Color ;
4546import java .awt .Font ;
47+ import java .util .Date ;
4648import java .util .List ;
4749import javax .swing .JLabel ;
4850import javax .swing .border .EmptyBorder ;
4951import org .eclipse .egit .github .core .Issue ;
5052import org .eclipse .egit .github .core .Label ;
5153import org .eclipse .egit .github .core .Milestone ;
5254import org .eclipse .egit .github .core .User ;
55+ import org .openide .util .NbBundle ;
5356
5457/**
5558 *
@@ -70,6 +73,9 @@ public AttributesViewPanel() {
7073 milestoneNameLabel .setFont (bold );
7174 }
7275
76+ @ NbBundle .Messages ({
77+ "AttributesViewPanel.LBL.dueDate=Due date"
78+ })
7379 public void setAttributes (Issue issue ) {
7480 initAttributes ();
7581 if (issue == null ) {
@@ -88,7 +94,23 @@ public void setAttributes(Issue issue) {
8894 Milestone milestone = issue .getMilestone ();
8995 if (milestone != null ) {
9096 milestoneNameLabel .setText (milestone .getTitle ());
91- milestoneNameLabel .setToolTipText (milestone .getDescription ());
97+
98+ // tooptip
99+ Date dueDate = milestone .getDueOn ();
100+ String description = milestone .getDescription ();
101+ StringBuilder sb = new StringBuilder ();
102+ sb .append ("<html>" ); // NOI18N
103+ if (description == null ) {
104+ description = "" ; // NOI18N
105+ }
106+ description = description .replaceAll ("\n " , "<br>" ); // NOI18N
107+ if (dueDate != null ) {
108+ sb .append (Bundle .AttributesViewPanel_LBL_dueDate ()).append (" : " ).append (DateUtils .DEFAULT_DATE_FORMAT .format (dueDate )).append ("<br>" ); // NOI18N
109+ sb .append ("<hr>" ); // NOI18N
110+ }
111+ sb .append (description );
112+ sb .append ("</html>" ); // NOI18N
113+ milestoneNameLabel .setToolTipText (sb .toString ());
92114 }
93115
94116 List <Label > labels = issue .getLabels ();
0 commit comments