Search in sources :

Example 6 with ParameterMenuItem

use of com.gitblit.models.Menu.ParameterMenuItem in project gitblit by gitblit.

the class ProjectPage method addDropDownMenus.

@Override
protected void addDropDownMenus(List<NavLink> navLinks) {
    PageParameters params = getPageParameters();
    DropDownPageMenuNavLink menu = new DropDownPageMenuNavLink("gb.filters", ProjectPage.class);
    // preserve time filter option on repository choices
    menu.menuItems.addAll(getRepositoryFilterItems(params));
    // preserve repository filter option on time choices
    menu.menuItems.addAll(getTimeFilterItems(params));
    if (menu.menuItems.size() > 0) {
        // Reset Filter
        menu.menuItems.add(new ParameterMenuItem(getString("gb.reset"), "p", WicketUtils.getProjectName(params)));
    }
    navLinks.add(menu);
    DropDownPageMenuNavLink projects = new DropDownPageMenuNavLink("gb.projects", ProjectPage.class);
    projects.menuItems.addAll(getProjectsMenu());
    navLinks.add(projects);
}
Also used : DropDownPageMenuNavLink(com.gitblit.models.NavLink.DropDownPageMenuNavLink) PageParameters(org.apache.wicket.PageParameters) ParameterMenuItem(com.gitblit.models.Menu.ParameterMenuItem)

Example 7 with ParameterMenuItem

use of com.gitblit.models.Menu.ParameterMenuItem in project gitblit by gitblit.

the class UserPage method addDropDownMenus.

@Override
protected void addDropDownMenus(List<NavLink> navLinks) {
    PageParameters params = getPageParameters();
    DropDownPageMenuNavLink menu = new DropDownPageMenuNavLink("gb.filters", UserPage.class);
    // preserve time filter option on repository choices
    menu.menuItems.addAll(getRepositoryFilterItems(params));
    // preserve repository filter option on time choices
    menu.menuItems.addAll(getTimeFilterItems(params));
    if (menu.menuItems.size() > 0) {
        // Reset Filter
        menu.menuItems.add(new ParameterMenuItem(getString("gb.reset")));
    }
    navLinks.add(menu);
}
Also used : DropDownPageMenuNavLink(com.gitblit.models.NavLink.DropDownPageMenuNavLink) PageParameters(org.apache.wicket.PageParameters) ParameterMenuItem(com.gitblit.models.Menu.ParameterMenuItem)

Example 8 with ParameterMenuItem

use of com.gitblit.models.Menu.ParameterMenuItem 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)8 PageParameters (org.apache.wicket.PageParameters)7 DropDownPageMenuNavLink (com.gitblit.models.NavLink.DropDownPageMenuNavLink)6 MenuDivider (com.gitblit.models.Menu.MenuDivider)2 MenuItem (com.gitblit.models.Menu.MenuItem)2 ArrayList (java.util.ArrayList)2 ExternalLinkMenuItem (com.gitblit.models.Menu.ExternalLinkMenuItem)1 PageLinkMenuItem (com.gitblit.models.Menu.PageLinkMenuItem)1 ToggleMenuItem (com.gitblit.models.Menu.ToggleMenuItem)1 ProjectModel (com.gitblit.models.ProjectModel)1 TreeSet (java.util.TreeSet)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1