com.cooldatasoft.horizontal.dropdown.multiLevelCss.MultiLevelCssMenu Maven / Gradle / Ivy
package com.cooldatasoft.horizontal.dropdown.multiLevelCss;
import java.security.InvalidParameterException;
import java.util.List;
import org.apache.wicket.core.util.string.JavaScriptUtils;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.html.IHeaderContributor;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
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.request.cycle.RequestCycle;
import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
import org.apache.wicket.request.resource.PackageResourceReference;
import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.resource.DynamicJQueryResourceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cooldatasoft.common.MenuItem;
/**
* http://www.dynamicdrive.com/style/csslibrary/item/ jquery_multi_level_css_menu_2/
*
* @author Fatih Mehmet UCAR - [email protected]
*
*/
public class MultiLevelCssMenu extends Panel implements IHeaderContributor {
private final static Logger LOGGER = LoggerFactory.getLogger(MultiLevelCssMenu.class);
private static final long serialVersionUID = 1L;
private final static ResourceReference DOWN_GIF = new PackageResourceReference(MultiLevelCssMenu.class, "js/down.gif");
private final static ResourceReference RIGHT_GIF = new PackageResourceReference(MultiLevelCssMenu.class, "js/right.gif");
private final static ResourceReference MENU_CSS = new CssResourceReference(MultiLevelCssMenu.class,
"css/MultiLevelCssMenu.css");
private final static ResourceReference MENU_JAVASCRIPT = new JavaScriptResourceReference(MultiLevelCssMenu.class,
"js/MultiLevelCssMenu.js");
@Override
public void renderHead(IHeaderResponse response) {
StringBuffer buffer = new StringBuffer();
buffer.append("var downGifRelativeLocation='").append(RequestCycle.get().urlFor(DOWN_GIF, null)).append("';");
buffer.append("var rightGifRelativeLocation='").append(RequestCycle.get().urlFor(RIGHT_GIF, null)).append("';");
response.getResponse().write(JavaScriptUtils.SCRIPT_OPEN_TAG);
response.getResponse().write(buffer.toString());
response.getResponse().write(JavaScriptUtils.SCRIPT_CLOSE_TAG);
response.render(JavaScriptHeaderItem.forReference(DynamicJQueryResourceReference.get()));
response.render(JavaScriptHeaderItem.forReference(MENU_JAVASCRIPT));
response.render(CssHeaderItem.forReference(MENU_CSS));
}
public MultiLevelCssMenu(String id, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy