Search in sources :

Example 1 with NavbarDropDownButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton in project ocvn by devgateway.

the class BasePage method newAdminMenu.

protected NavbarDropDownButton newAdminMenu() {
    // admin menu
    NavbarDropDownButton adminMenu = new NavbarDropDownButton(new StringResourceModel("navbar.admin", this, null)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected List<AbstractLink> newSubMenuButtons(final String arg0) {
            List<AbstractLink> list = new ArrayList<>();
            list.add(new MenuBookmarkablePageLink<ListGroupPage>(ListGroupPage.class, null, new StringResourceModel("navbar.groups", this, null)).setIconType(FontAwesomeIconType.tags));
            // list.add(new
            // MenuBookmarkablePageLink<ListTestFormPage>(ListTestFormPage.class,
            // null,
            // new StringResourceModel("navbar.testcomponents", this, null))
            // .setIconType(FontAwesomeIconType.android));
            list.add(new MenuBookmarkablePageLink<ListVietnamImportSourceFiles>(ListVietnamImportSourceFiles.class, null, new StringResourceModel("navbar.importfiles", this, null)).setIconType(FontAwesomeIconType.file_archive_o));
            list.add(new MenuBookmarkablePageLink<VietnamImportPage>(VietnamImportPage.class, null, new StringResourceModel("navbar.import", this, null)).setIconType(FontAwesomeIconType.cloud_upload));
            list.add(new MenuBookmarkablePageLink<ListUserPage>(ListUserPage.class, null, new StringResourceModel("navbar.users", this, null)).setIconType(FontAwesomeIconType.users));
            list.add(new MenuBookmarkablePageLink<SpringEndpointsPage>(SpringEndpointsPage.class, null, new StringResourceModel("navbar.springendpoints", this, null)).setIconType(FontAwesomeIconType.anchor));
            list.add(new MenuBookmarkablePageLink<JminixRedirectPage>(JminixRedirectPage.class, null, new StringResourceModel("navbar.jminix", this, null)).setIconType(FontAwesomeIconType.bug));
            // MenuBookmarkablePageLink<HALRedirectPage> halBrowserLink =
            // new MenuBookmarkablePageLink<HALRedirectPage>(
            // HALRedirectPage.class, null, new StringResourceModel(
            // "navbar.halbrowser", this, null)) {
            // private static final long serialVersionUID = 1L;
            //
            // @Override
            // protected void onComponentTag(ComponentTag tag) {
            // super.onComponentTag(tag);
            // tag.put("target", "_blank");
            // }
            // };
            // halBrowserLink.setIconType(FontAwesomeIconType.rss).setEnabled(true);
            // list.add(halBrowserLink);
            MenuBookmarkablePageLink<UIRedirectPage> uiBrowserLink = new MenuBookmarkablePageLink<UIRedirectPage>(UIRedirectPage.class, null, new StringResourceModel("navbar.ui", this, null)) {

                private static final long serialVersionUID = 1L;

                @Override
                protected void onComponentTag(final ComponentTag tag) {
                    super.onComponentTag(tag);
                    tag.put("target", "_blank");
                }
            };
            uiBrowserLink.setIconType(FontAwesomeIconType.dashboard).setEnabled(true);
            list.add(new MenuBookmarkablePageLink<Void>(EditAdminSettingsPage.class, new StringResourceModel("navbar.adminSettings", BasePage.this, null)).setIconType(FontAwesomeIconType.briefcase));
            list.add(new MenuBookmarkablePageLink<Void>(ListAllDashboardsPage.class, new StringResourceModel("navbar.allDashboard", BasePage.this, null)).setIconType(FontAwesomeIconType.filter));
            list.add(uiBrowserLink);
            return list;
        }
    };
    adminMenu.setIconType(GlyphIconType.cog);
    MetaDataRoleAuthorizationStrategy.authorize(adminMenu, Component.RENDER, SecurityConstants.Roles.ROLE_ADMIN);
    return adminMenu;
}
Also used : NavbarDropDownButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton) ComponentTag(org.apache.wicket.markup.ComponentTag) ArrayList(java.util.ArrayList) MenuBookmarkablePageLink(de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuBookmarkablePageLink) AbstractLink(org.apache.wicket.markup.html.link.AbstractLink) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 2 with NavbarDropDownButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton in project ocvn by devgateway.

the class BasePage method newLanguageMenu.

public NavbarDropDownButton newLanguageMenu() {
    final NavbarDropDownButton languageDropDown = new NavbarDropDownButton(new StringResourceModel("navbar.lang", this, null)) {

        private static final long serialVersionUID = 319842753824102674L;

        @Override
        protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
            final List<AbstractLink> list = new ArrayList<>();
            for (final Locale l : WebConstants.AVAILABLE_LOCALES) {
                final PageParameters params = new PageParameters(BasePage.this.getPageParameters());
                params.set(WebConstants.LANGUAGE_PARAM, l.getLanguage());
                list.add(new MenuBookmarkablePageLink<Page>(BasePage.this.getPageClass(), params, Model.of(l.getDisplayName())));
            }
            return list;
        }
    };
    languageDropDown.setIconType(GlyphIconType.flag);
    return languageDropDown;
}
Also used : NavbarDropDownButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton) Locale(java.util.Locale) ArrayList(java.util.ArrayList) Page(org.apache.wicket.Page) EditUserPage(org.devgateway.toolkit.forms.wicket.page.user.EditUserPage) VietnamImportPage(org.devgateway.ocvn.forms.wicket.page.VietnamImportPage) ListGroupPage(org.devgateway.toolkit.forms.wicket.page.lists.ListGroupPage) RedirectPage(org.apache.wicket.markup.html.pages.RedirectPage) GenericWebPage(org.apache.wicket.markup.html.GenericWebPage) ListAllDashboardsPage(org.devgateway.ocds.forms.wicket.page.list.ListAllDashboardsPage) LogoutPage(org.devgateway.toolkit.forms.wicket.page.user.LogoutPage) ListMyDashboardsPage(org.devgateway.ocds.forms.wicket.page.list.ListMyDashboardsPage) ListUserPage(org.devgateway.toolkit.forms.wicket.page.lists.ListUserPage) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) AbstractLink(org.apache.wicket.markup.html.link.AbstractLink) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Aggregations

NavbarDropDownButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton)2 ArrayList (java.util.ArrayList)2 AbstractLink (org.apache.wicket.markup.html.link.AbstractLink)2 StringResourceModel (org.apache.wicket.model.StringResourceModel)2 MenuBookmarkablePageLink (de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuBookmarkablePageLink)1 Locale (java.util.Locale)1 Page (org.apache.wicket.Page)1 ComponentTag (org.apache.wicket.markup.ComponentTag)1 GenericWebPage (org.apache.wicket.markup.html.GenericWebPage)1 RedirectPage (org.apache.wicket.markup.html.pages.RedirectPage)1 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)1 ListAllDashboardsPage (org.devgateway.ocds.forms.wicket.page.list.ListAllDashboardsPage)1 ListMyDashboardsPage (org.devgateway.ocds.forms.wicket.page.list.ListMyDashboardsPage)1 VietnamImportPage (org.devgateway.ocvn.forms.wicket.page.VietnamImportPage)1 ListGroupPage (org.devgateway.toolkit.forms.wicket.page.lists.ListGroupPage)1 ListUserPage (org.devgateway.toolkit.forms.wicket.page.lists.ListUserPage)1 EditUserPage (org.devgateway.toolkit.forms.wicket.page.user.EditUserPage)1 LogoutPage (org.devgateway.toolkit.forms.wicket.page.user.LogoutPage)1