Package de.agilecoders.wicket.core.markup.html.bootstrap.navbar

Examples of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.Navbar


     *
     * @param markupId The components markup id.
     * @return a new {@link Navbar} instance
     */
    protected Navbar newNavbar(String markupId) {
        Navbar navbar = new Navbar(markupId);
        navbar.setPosition(Navbar.Position.TOP);
        navbar.setInverted(false);

        // show brand name and logo
        navbar.brandName(Model.of("Mystic Paste"));

        navbar.addComponents(NavbarComponents.transform(Navbar.ComponentPosition.LEFT,
                new NavbarButton<PasteItemPage>(PasteItemPage.class, Model.of("New")),
                new NavbarButton<HistoryPage>(HistoryPage.class, Model.of("History")),
//                new NavbarButton<PopularPage>(PopularPage.class, Model.of("Popular")),
                new NavbarButton<PluginPage>(PluginPage.class, Model.of("Plugins")),
                new NavbarButton<HelpPage>(HelpPage.class, Model.of("Help"))
View Full Code Here


     *
     * @param markupId The components markup id.
     * @return a new {@link Navbar} instance
     */
    protected Navbar newNavbar(String markupId) {
        Navbar navbar = new Navbar(markupId);

        navbar.setPosition(Navbar.Position.TOP);
        navbar.setInverted(true);

        // show brand name
        navbar.setBrandName(Model.of("Wicket Bootstrap"));

        navbar.addComponents(NavbarComponents.transform(Navbar.ComponentPosition.LEFT,
                        new NavbarButton<Void>(HomePage.class, Model.of("Overview")).setIconType(GlyphIconType.home),
                        new NavbarButton<Void>(BaseCssPage.class, Model.of("Base CSS")),
                        new NavbarButton<Void>(ComponentsPage.class, Model.of("Components")),
                        new NavbarButton<Void>(Scaffolding.class, Model.of("Scaffolding")),
                        new NavbarExternalLink(Model.of("https://github.com/l0rdn1kk0n/wicket-bootstrap"))
                                .setLabel(Model.of("Github"))
                                .setTarget(BootstrapExternalLink.Target.blank)
                                .setIconType(GlyphIconType.export),
                        newAddonsDropDownButton())
        );
        navbar.addComponents(new NavbarText(navbar.newExtraItemId(), "Plain text").position(Navbar.ComponentPosition.RIGHT));

        DropDownButton dropdown = new NavbarDropDownButton(Model.of("Themes")) {
            @Override
            public boolean isActive(Component item) {
                return false;
            }

            @Override
            protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
                final List<AbstractLink> subMenu = new ArrayList<AbstractLink>();
                subMenu.add(new MenuHeader(Model.of("all available themes:")));
                subMenu.add(new MenuDivider());

                final IBootstrapSettings settings = Bootstrap.getSettings(getApplication());
                final List<ITheme> themes = settings.getThemeProvider().available();

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

                    subMenu.add(new MenuBookmarkablePageLink<Void>(getPageClass(), params, Model.of(theme.name())));
                }

                return subMenu;
            }
        }.setIconType(GlyphIconType.book);

        navbar.addComponents(new ImmutableNavbarComponent(dropdown, Navbar.ComponentPosition.RIGHT));

        return navbar;
    }
View Full Code Here

        // issue #88
        add(createDatePickerForm("datepicker-form"));

        // issue #-1
        add(new Navbar("navbar-form").addComponents(new AbstractNavbarComponent(Navbar.ComponentPosition.LEFT) {
            @Override
            public Component create(String markupId) {
                return new CustomNavbarForm(markupId);
            }
        }));
View Full Code Here

TOP

Related Classes of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.Navbar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.