James Moger
2011-11-10 a568f2ac97f4c7b73ee0cdf2007f553bb8c81c2c
src/com/gitblit/client/MessageRenderer.java
@@ -28,7 +28,7 @@
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellRenderer;
import com.gitblit.models.SyndicatedEntryModel;
import com.gitblit.models.FeedEntryModel;
/**
 * Message renderer displays the short log message and then any refs in a style
@@ -53,6 +53,10 @@
   private final JLabel branchLabel;
   public MessageRenderer() {
      this(null);
   }
   public MessageRenderer(GitblitClient gitblit) {
      super(new FlowLayout(FlowLayout.LEFT, 10, 1));
      this.gitblit = gitblit;
@@ -74,13 +78,21 @@
         setBackground(table.getBackground());
      messageLabel.setForeground(isSelected ? table.getSelectionForeground() : table
            .getForeground());
      SyndicatedEntryModel entry = (SyndicatedEntryModel) value;
      // show message in BOLD if its a new entry
      if (entry.published.after(gitblit.getLastFeedRefresh(entry.repository, entry.branch))) {
         messageLabel.setText("<html><body><b>" + entry.title);
      } else {
      if (value == null) {
         return this;
      }
      FeedEntryModel entry = (FeedEntryModel) value;
      if (gitblit == null) {
         // no gitblit client, just display message
         messageLabel.setText(entry.title);
      } else {
         // show message in BOLD if its a new entry
         if (entry.published.after(gitblit.getLastFeedRefresh(entry.repository, entry.branch))) {
            messageLabel.setText("<html><body><b>" + entry.title);
         } else {
            messageLabel.setText(entry.title);
         }
      }
      // reset ref label