Search in sources :

Example 1 with MenuBookmarkablePageLink

use of de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuBookmarkablePageLink 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)

Aggregations

MenuBookmarkablePageLink (de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.MenuBookmarkablePageLink)1 NavbarDropDownButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownButton)1 ArrayList (java.util.ArrayList)1 ComponentTag (org.apache.wicket.markup.ComponentTag)1 AbstractLink (org.apache.wicket.markup.html.link.AbstractLink)1 StringResourceModel (org.apache.wicket.model.StringResourceModel)1