Search in sources :

Example 11 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class FeedsPanel method getSelectedSyndicatedEntry.

protected FeedEntryModel getSelectedSyndicatedEntry() {
    int viewRow = table.getSelectedRow();
    int modelRow = table.convertRowIndexToModel(viewRow);
    FeedEntryModel entry = tableModel.get(modelRow);
    return entry;
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 12 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class SearchDialog method viewCommit.

protected void viewCommit() {
    FeedEntryModel entry = getSelectedSyndicatedEntry();
    Utils.browse(entry.link);
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 13 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class SearchDialog method getSelectedSyndicatedEntry.

protected FeedEntryModel getSelectedSyndicatedEntry() {
    int viewRow = table.getSelectedRow();
    int modelRow = table.convertRowIndexToModel(viewRow);
    FeedEntryModel entry = tableModel.get(modelRow);
    return entry;
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 14 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class SearchDialog method viewCommitDiff.

protected void viewCommitDiff() {
    FeedEntryModel entry = getSelectedSyndicatedEntry();
    Utils.browse(entry.link.replace("/commit/", "/commitdiff/"));
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel)

Example 15 with FeedEntryModel

use of com.gitblit.models.FeedEntryModel in project gitblit by gitblit.

the class FeedsPanel method updateTable.

protected void updateTable(boolean pack) {
    tableModel.entries.clear();
    tableModel.entries.addAll(gitblit.getSyndicatedEntries());
    tableModel.fireTableDataChanged();
    header.setText(Translation.get("gb.activity") + " (" + gitblit.getSyndicatedEntries().size() + (page > 0 ? (", pg " + (page + 1)) : "") + ")");
    if (pack) {
        Utils.packColumns(table, Utils.MARGIN);
    }
    table.scrollRectToVisible(new Rectangle(table.getCellRect(0, 0, true)));
    if (page == 0) {
        // determine unique repositories
        Set<String> uniqueRepositories = new HashSet<String>();
        for (FeedEntryModel entry : tableModel.entries) {
            uniqueRepositories.add(entry.repository);
        }
        // repositories
        List<String> sortedRespositories = new ArrayList<String>(uniqueRepositories);
        StringUtils.sortRepositorynames(sortedRespositories);
        repositoryChoices.removeAllElements();
        repositoryChoices.addElement(ALL);
        for (String repo : sortedRespositories) {
            repositoryChoices.addElement(repo);
        }
    }
    // update pagination buttons
    next.setEnabled(tableModel.entries.size() > 0);
    prev.setEnabled(page > 0);
}
Also used : FeedEntryModel(com.gitblit.models.FeedEntryModel) Rectangle(java.awt.Rectangle) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Aggregations

FeedEntryModel (com.gitblit.models.FeedEntryModel)19 ArrayList (java.util.ArrayList)6 HashSet (java.util.HashSet)5 Test (org.junit.Test)3 SyndCategory (com.sun.syndication.feed.synd.SyndCategory)2 SyndEntryImpl (com.sun.syndication.feed.synd.SyndEntryImpl)2 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)2 Date (java.util.Date)2 Constants (com.gitblit.Constants)1 GitBlitException (com.gitblit.GitBlitException)1 FeedModel (com.gitblit.models.FeedModel)1 ProjectModel (com.gitblit.models.ProjectModel)1 RefModel (com.gitblit.models.RefModel)1 RepositoryModel (com.gitblit.models.RepositoryModel)1 UserModel (com.gitblit.models.UserModel)1 AuthenticatedRequest (com.gitblit.servlet.AuthenticationFilter.AuthenticatedRequest)1 BugtraqProcessor (com.gitblit.utils.BugtraqProcessor)1 SyndCategoryImpl (com.sun.syndication.feed.synd.SyndCategoryImpl)1 SyndContent (com.sun.syndication.feed.synd.SyndContent)1 SyndContentImpl (com.sun.syndication.feed.synd.SyndContentImpl)1