• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ImmutableNavbarComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent的典型用法代码示例。如果您正苦于以下问题:Java ImmutableNavbarComponent类的具体用法?Java ImmutableNavbarComponent怎么用?Java ImmutableNavbarComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ImmutableNavbarComponent类属于de.agilecoders.wicket.core.markup.html.bootstrap.navbar包,在下文中一共展示了ImmutableNavbarComponent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: newNavbar

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
protected Navbar newNavbar(String markupId) {
	Navbar navbar = new Navbar(markupId);

	navbar.setPosition(Navbar.Position.TOP);

	// show brand name
	navbar.brandName(Model.of("matetracker.de"));
	navbar.addComponents(NavbarComponents.transform(
			Navbar.ComponentPosition.LEFT, new NavbarButton<Homepage>(
					Homepage.class, Model.of("Home"))
					.setIconType(IconType.home)

	));

	if (getUser().getObject().getRole() == Role.Admin) {
		navbar.addComponents(NavbarComponents.transform(
				Navbar.ComponentPosition.RIGHT,
				new NavbarButton<UserPage>(UserPage.class, Model.of(_(
						"menu.user").getString()))
						.setIconType(IconType.user)));

		navbar.addComponents(NavbarComponents.transform(
				Navbar.ComponentPosition.RIGHT,
				new NavbarButton<AdminPage>(AdminPage.class, Model.of(_(
						"menu.admin").getString()))
						.setIconType(IconType.warningsign)));

	}
	navbar.addComponents(new ImmutableNavbarComponent(
			new NavbarButton<LogoutPage>(LogoutPage.class, Model
					.of("Logout")).setIconType(IconType.off),
			Navbar.ComponentPosition.RIGHT));

	return navbar;
}
 
开发者ID:atomfrede,项目名称:freezing-octo-bear,代码行数:36,代码来源:BasePage.java


示例2: addThemesNav

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
private void addThemesNav(final Navbar navbar, final ComponentPosition position) {
    final DropDownButton dropdown = new NavbarDropDownButton(Model.of(" Themes")) {

        @Override
        public boolean isActive(final Component item) {
            return false;
        }

        @Override
        protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
            final List<AbstractLink> subMenu = new ArrayList<AbstractLink>();
            final IBootstrapSettings settings = Bootstrap.getSettings(getApplication());
            final List<ITheme> themes = settings.getThemeProvider().available();

            for (final ITheme theme : themes) {
                final PageParameters params = new PageParameters();
                final String themeName = theme.name();
                params.set(PAGE_PARAM_THEME, themeName);

                final IModel<String> labelModel = new AbstractReadOnlyModel<String>() {
                    @Override
                    public String getObject() {
                        final String activeThemeName = Bootstrap.getSettings(getApplication())
                                .getActiveThemeProvider()
                                .getActiveTheme()
                                .name();
                        String themeLabel = themeName.toLowerCase();
                        if (themeName.equals(activeThemeName)) {
                            themeLabel = "<b>" + themeLabel + "</b>";
                        }
                        return themeLabel;
                    }
                };

                subMenu.add(new MenuBookmarkablePageLink<Void>(getPageClass(), params, labelModel) {

                    @Override
                    protected Component newLabel(final String markupId) {
                        final Label label = (Label) super.newLabel(markupId);
                        label.setEscapeModelStrings(false);
                        return label;
                    }

                });
            }

            return subMenu;
        }
    }.setIconType(GlyphIconType.book);
    navbar.addComponents(new ImmutableNavbarComponent(dropdown, position));
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:52,代码来源:AExampleWebPage.java


示例3: onConfigure

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
@Override
protected void onConfigure() {
	super.onConfigure();
	if (!menusAdded) {
		menusAdded = true;

		// add logo
		addUQasarLogo();

		if (UQasar.getSession().getLoggedInUser() != null) {
			// add projects submenu
			addComponents(new ImmutableNavbarComponent(new ProjectsSubMenu(
					new StringResourceModel("menu.projects.link.text", this,
							null)), Navbar.ComponentPosition.LEFT));
			

			// add quality models submenu
			addComponents(new ImmutableNavbarComponent(new QModelsSubMenu(
					new StringResourceModel("menu.qmodels.link.text", this,
							null)), Navbar.ComponentPosition.LEFT));

			// add search form
			addComponents(newNavbarSearchForm());

			// add notifications
			addComponents(new ImmutableNavbarComponent(
					new NotificationsSubMenu(
							NotificationDropDownMenu.createNotifications(treeNodeService)),
							Navbar.ComponentPosition.RIGHT));

			// add languages
			addComponents(newLanguageMenu());

			// add admin menu, if user has admin rights
			if (UQasar.getSession().getLoggedInUser().getRole() == Role.Administrator) {
				addComponents(new ImmutableNavbarComponent(new AdminSubMenu(
						Model.of("")), Navbar.ComponentPosition.RIGHT));
			}

			// add user menu
			addComponents(new ImmutableNavbarComponent(new UserSubMenu(
					UQasar.getSession().getLoggedInUser()),
					Navbar.ComponentPosition.RIGHT));
		} else {
			addComponents(newLanguageMenu());
			addComponents(newLoginButton());
		}
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:50,代码来源:HeaderNavigationBar.java


示例4: newLanguageMenu

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
private AbstractNavbarComponent newLanguageMenu() {
	return new ImmutableNavbarComponent(
			new LanguageSubMenu(containingPage, new StringResourceModel("menu.languages.submenu.text", this, null)),
			Navbar.ComponentPosition.RIGHT);
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:6,代码来源:HeaderNavigationBar.java


示例5: newLoginButton

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
private AbstractNavbarComponent newLoginButton() {
	NavbarButton<LoginPage> loginButton = new NavbarButton<>(LoginPage.class, new StringResourceModel(
			"menu.login.link.text", this, null));
	return new ImmutableNavbarComponent(loginButton, Navbar.ComponentPosition.RIGHT);
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:6,代码来源:HeaderNavigationBar.java


示例6: initLayout

import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent; //导入依赖的package包/类
private void initLayout() {
    Navbar navbar = new Navbar(ID_NAVBAR) {

        @Override
        protected Label newBrandLabel(String markupId) {
            Label label = super.newBrandLabel(markupId);
            label.add(AttributeAppender.replace("title", createStringResource("GizmoApplication.projectVersion")));
            return label;
        }
    };
    navbar.setBrandName(createStringResource("GizmoApplication.projectName"));
    navbar.setPosition(Navbar.Position.STATIC_TOP);
    add(navbar);

    TopMenuItem item = new TopMenuItem(createStringResource("PageAppTemplate.menu.dashboard"), PageDashboard.class);
    navbar.addComponents(new ImmutableNavbarComponent(item));

    item = new TopMenuItem(createStringResource("PageAppTemplate.menu.customers"), PageCustomers.class);
    navbar.addComponents(new ImmutableNavbarComponent(item));

    item = new TopMenuItem(createStringResource("PageAppTemplate.menu.projects"), PageProjects.class);
    navbar.addComponents(new ImmutableNavbarComponent(item));

    item = new TopMenuItem(createStringResource("PageAppTemplate.menu.users"), PageUsers.class);
    navbar.addComponents(new ImmutableNavbarComponent(item));

    item = new TopMenuItem(createStringResource("PageAppTemplate.menu.emails"), PageEmails.class);
    navbar.addComponents(new ImmutableNavbarComponent(item));

    item = new TopMenuItem(createUsernameModel(), PageUser.class, createUserPageParams());
    item.setActive(true);
    navbar.addComponents(new ImmutableNavbarComponent(item, Navbar.ComponentPosition.RIGHT));

    NavbarExternalLink logoutLink = new NavbarExternalLink(
            new Model<>(RequestCycle.get().getRequest().getContextPath() + "/j_spring_security_logout"));
    logoutLink.setLabel(createStringResource("PageAppTemplate.menu.logout"));
    navbar.addComponents(new ImmutableNavbarComponent(logoutLink, Navbar.ComponentPosition.RIGHT));

    Label title = new Label(ID_TITLE, createPageTitleModel());
    add(title);

    MainFeedback feedback = new MainFeedback(ID_FEEDBACK);
    feedback.setOutputMarkupId(true);
    add(feedback);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:46,代码来源:PageAppTemplate.java



注:本文中的de.agilecoders.wicket.core.markup.html.bootstrap.navbar.ImmutableNavbarComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormType类代码示例发布时间:2022-05-22
下一篇:
Java FinishedListener类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap