| | |
| | | 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
|
| | |
| | |
|
| | | private final JLabel branchLabel;
|
| | |
|
| | | public MessageRenderer() {
|
| | | this(null);
|
| | | }
|
| | |
|
| | | public MessageRenderer(GitblitClient gitblit) {
|
| | | super(new FlowLayout(FlowLayout.LEFT, 10, 1));
|
| | | this.gitblit = gitblit;
|
| | |
| | | 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
|