Search in sources :

Example 6 with DropDownPageMenuNavLink

use of com.gitblit.models.NavLink.DropDownPageMenuNavLink in project gitblit by gitblit.

the class ActivityPage method addDropDownMenus.

@Override
protected void addDropDownMenus(List<NavLink> navLinks) {
    DropDownPageMenuNavLink filters = new DropDownPageMenuNavLink("gb.filters", ActivityPage.class);
    PageParameters currentParameters = getPageParameters();
    int daysBack = app().settings().getInteger(Keys.web.activityDuration, 7);
    if (currentParameters != null && !currentParameters.containsKey("db")) {
        currentParameters.put("db", daysBack);
    }
    // preserve time filter options on repository choices
    filters.menuItems.addAll(getRepositoryFilterItems(currentParameters));
    // preserve repository filter options on time choices
    filters.menuItems.addAll(getTimeFilterItems(currentParameters));
    if (filters.menuItems.size() > 0) {
        // Reset Filter
        filters.menuItems.add(new ParameterMenuItem(getString("gb.reset")));
    }
    navLinks.add(filters);
}
Also used : DropDownPageMenuNavLink(com.gitblit.models.NavLink.DropDownPageMenuNavLink) PageParameters(org.apache.wicket.PageParameters) ParameterMenuItem(com.gitblit.models.Menu.ParameterMenuItem)

Aggregations

ParameterMenuItem (com.gitblit.models.Menu.ParameterMenuItem)6 DropDownPageMenuNavLink (com.gitblit.models.NavLink.DropDownPageMenuNavLink)6 PageParameters (org.apache.wicket.PageParameters)6