Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This piece of code is dedicated to the wicket project (http://www.wicketframework.org).
*/
package org.wicketstuff.menu;
import java.util.List;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
import org.apache.wicket.markup.html.list.Loop;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.protocol.http.ClientProperties;
import org.apache.wicket.protocol.http.WebSession;
import org.apache.wicket.protocol.http.request.WebClientInfo;
import org.apache.wicket.request.ClientInfo;
import org.wicketstuff.jwicket.IStyleResolver;
import org.wicketstuff.jwicket.JQueryCssResourceReference;
/**
* A {@code MenuBarPanel} consits of several {@link Menu}s where each {@link Menu} consist of {@link MenuItem}s.
* A {@code MenuBarPanel} can be constructed e.g. like this:
List<Menu> menus = new ArrayList<Menu>();
// The MenuItems for the first Menu
List<MenuItem> menu1Items = new ArrayList<MenuItem>();
menu1Items.add(new MenuItem(new Model<String>("Visible menu item 1.1"), new LinkToPage(Page1.class)));
menu1Items.add(new MenuItem(new Model<String>("Visible but disabled menu item 1.2"), new LinkToPage(Page2.class)).setEnabled(false));
menu1Items.add(new MenuItem(new Model<String>("Invisible menu item 1.3"), new LinkToPage(Page3.class)).setVisible(false));
menu1Items.add(new MenuItem(new Model<String>("visible menu item 1.4"), new LinkToPage(Page4.class)));
menus.add(new Menu(new Model<String>("First menu"), menu1Items));
// The MenuItems for the second Menu
List<MenuItem> menu2Items = new ArrayList<MenuItem>();
menu2Items.add(new MenuItem(new Model<String>("Visible menu item 2.1"), "http://www.wicketframework.org"));
menu2Items.add(new MenuItem(new Model<String>("Visible but disabled menu item 2.2"), new LinkToPage(Page1.class)).setEnabled(false));
menu2Items.add(new MenuItem(new Model<String>("Invisible menu item 2.3"), new LinkToPage(null, Page2.class)).setVisible(false));
menu2Items.add(new MenuItem(new Model<String>("visible menu item 2.4"), new LinkToPage(Page3.class)));
menus.add(new Menu(new Model<String>("Second menu"), menu2Items));
add(new MenuBarPanel("menuBar", menus);
...
private class LinkToPage implements IPageLink {
private Class<? extends Page> pageClass;
public LinkToPage(Class<? extends Page> pageClass) {
this.pageClass = pageClass;
}
public Page getPage() {
return pageClass.newInstance();
}
* The HTML markup for this example looks like this:
<div wicket:id="menuBar">[[The menu bar goes here]]</div>
* You need the following css code to get this example to work with IE:
*
* @author Stefan Lindner ([email protected])
*/
public class MenuBarPanel extends Panel implements IStyleResolver {
private static final long serialVersionUID = 1L;
public static JQueryCssResourceReference[] CSS = {new JQueryCssResourceReference(MenuBarPanel.class, "menu.css")};
protected final List