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;
}
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;
}
Aggregations