package org.apache.karaf.webconsole.core.internal;

import org.apache.wicket.Page;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.util.ListModel;

public class SidebarPanel extends Panel {

    public SidebarPanel(String id, Class<? extends Page> basePage, ListModel<Class<? extends Page>> listModel) {
        super(id, listModel);

        add(new BookmarkablePageLink<Page>("masterPageLink", basePage).add(new Label("masterPageLabel", basePage.getName())));

        add(new ListView<Class<? extends Page>>("subPageLinks", listModel) {
            @Override
            protected void populateItem(ListItem<Class<? extends Page>> item) {
                BookmarkablePageLink<Page> link = new BookmarkablePageLink<Page>("subPageLink", item.getModelObject());
                link.add(new Label("subPageLabel", item.getModelObject().getName()));
                item.add(link);
            }
        });
    }

}

@@ -691,24 +691,30 @@
 basePage.get
+Simple
 Name())));%0A%0A
@@ -712,16 +712,16 @@
 e())));%0A
-
 %0A       
@@ -888,24 +888,92 @@
 e%3E%3E item) %7B%0A
+                Class%3C? extends Page%3E page = item.getModelObject();%0A
             
@@ -1056,37 +1056,20 @@
 eLink%22, 
-item.getModelObject()
+page
 );%0A     
@@ -1118,33 +1118,22 @@
 l%22, 
-item.getModelObject().get
+page.getSimple
 Name

Improve sidebar a bit - remove long class names from navigation