public class NavigationPanel
extends Nav
{
public NavigationPanel( Class<? extends Page>... pages )
{
Ul menu = new Ul();
add( menu );
for ( Class<? extends Page> page : pages )
{
Li menuItem = new Li();
Anchor link = new Anchor( localize( "menu." + page.getSimpleName().toLowerCase() ), page );
menuItem.add( link );
if ( WebApplication.get().getPageClassByPath( RequestCycle.get().getRequest().getServletPath() ) == page )
{
link.setClassName( "selected" );
}
menu.add( menuItem );
}
// TODO: implement search
Form form = new Form( "search-form" );
form.add( new TextBox( "search" ).setPlaceHolder( localize( "placeholder.search" ) ) );