Panel navigation element
When generating a panel navigation a <div>
element is written to the output.
Element and builder
The PanelsNavComponentBuilder
is provided to easily build panel navigation.
A builder can be created using BootstrapViewElements.bootstrap.builders.panels()
factory methods.
Examples
Creating a simple panel navigation
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
Menu menu = new PathBasedMenuBuilder()
.item( "/one", "one" ).and()
.item( "/one/sub", "sub one" ).and()
.item( "/one/sub2", "sub one 2" ).and()
.item( "/two", "two" ).and()
.item( "/three", "three" ).and()
.build();
menu.select( MenuSelector.byPath( "/two" ) );
NodeViewElement panelNav = bootstrap.builders.panels().menu( menu ).build();
Creating a panel navigation with groups
Given the following builder configuration
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
Menu menu = new PathBasedMenuBuilder()
.item( "/one", "one" )
.attribute( ATTR_ICON, IconSet.iconSet( FONT_AWESOME_BRANDS_ICON_SET ).icon( "apple" ) )
.group( true ).and()
.item( "/one/sub", "sub one" ).and()
.item( "/one/sub2", "sub one 2" ).and()
.build();
menu.select( MenuSelector.byPath( "/one/sub2" ) );
NodeViewElement panelNav = bootstrap.builders.panels().menu( menu ).build();
Creating a panel navigation with custom styling
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
Menu menu = new PathBasedMenuBuilder()
.item( "/one", "" )
.group( true )
.attribute( customizeViewElement( HtmlViewElement.Functions.css( "border border-danger" ) ) ).and()
.item( "/one/sub", "sub one" ).and()
.item( "/one/sub2", "sub one 2" ).and()
.build();
menu.select( MenuSelector.byPath( "/one" ) );
NodeViewElement panelNav = bootstrap.builders.panels().menu( menu ).build();