Snippet Plugin (sample) - the behavior
public class SnippetBehavior extends JQueryBehavior { private static final long serialVersionUID = 1L; public SnippetBehavior(String selector, Options options) { super(selector, "snippet", options); this.add(new JavaScriptResourceReference(SnippetBehavior.class, "jquery.snippet.min.js")); this.add(new CssResourceReference(SnippetBehavior.class, "jquery.snippet.min.css")); } }
Components / Samples
Description
Sources
package com.googlecode.wicket.jquery.ui.samples.jqueryui.plugins; import com.googlecode.wicket.jquery.core.Options; import com.googlecode.wicket.jquery.ui.plugins.SnippetBehavior; public class DefaultSnippetPage extends AbstractSnippetPage { private static final long serialVersionUID = 1L; public DefaultSnippetPage() { Options options = new Options(); options.set("style", Options.asString("ide-eclipse")); //Options.asString() converts a string or an object to its javascript representation. ie: "myvalue" (including the double quote) this.add(new SnippetBehavior("#code", "java", options)); } }
<!DOCTYPE html> <html xmlns:wicket="http://wicket.apache.org"> <head> <wicket:head> <title>Wicket jQuery UI: plugin / snippet</title> </wicket:head> </head> <body> <wicket:extend> <pre id="code"> public class SnippetBehavior extends JQueryBehavior { private static final long serialVersionUID = 1L; public SnippetBehavior(String selector, Options options) { super(selector, "snippet", options); this.add(new JavaScriptResourceReference(SnippetBehavior.class, "jquery.snippet.min.js")); this.add(new CssResourceReference(SnippetBehavior.class, "jquery.snippet.min.css")); } }</pre> </wicket:extend> </body> </html>