Repository: wicket Updated Branches: refs/heads/3435-use-bootstrap-for-examples 780324757 -> a86282577
WICKET-3435 Revamp Wicket Examples with the new website L&F Bootstrapify all examples. Fix Gym.js tests. TODO: make it as prettier as possible Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a8628257 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a8628257 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a8628257 Branch: refs/heads/3435-use-bootstrap-for-examples Commit: a86282577ae854fe45ed9821cc7ee249757c3e09 Parents: 7803247 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Sun Nov 30 13:30:12 2014 +0100 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Sun Nov 30 13:30:12 2014 +0100 ---------------------------------------------------------------------- .../atmosphere/AtmosphereApplication.java | 5 +- .../wicket/examples/atmosphere/HomePage.html | 48 ++++++--- .../wicket/examples/atmosphere/HomePage.java | 4 +- .../validation/BeanValidationApplication.java | 1 + .../bean/validation/BeanValidationPage.html | 100 +++++++++-------- .../bean/validation/BeanValidationPage.java | 15 +-- .../wicket/examples/cdi/CdiApplication.java | 4 +- .../wicket/examples/cdi/CdiExamplePage.html | 7 +- .../org/apache/wicket/examples/echo/Echo.html | 2 +- .../apache/wicket/examples/events/BasePage.html | 5 +- .../events/DecoupledAjaxUpdatePage.html | 24 +++-- .../wicket/examples/forminput/FormInput.html | 2 +- .../apache/wicket/examples/guice/HomePage.html | 4 +- .../wicket/examples/library/EditBook.html | 107 +++++++++---------- .../wicket/examples/library/EditBook.java | 5 +- .../requestmapper/RequestMapperHomePage.java | 5 - .../examples/resourcedecoration/HomePage.css | 4 +- .../examples/resourcedecoration/HomePage.html | 17 ++- .../examples/resourcedecoration/HomePage.java | 11 +- .../ResourceDecorationApplication.java | 4 +- .../wicket/examples/resourcedecoration/ajax.css | 19 ---- .../wicket/examples/resourcedecoration/ajax.js | 20 ---- .../wicket/examples/resourcedecoration/app.css | 8 +- .../examples/spring/annot/web/AnnotPage.java | 1 - .../examples/spring/common/web/BasePage.html | 14 ++- .../spring/common/web/ExampleApplication.java | 9 +- .../wicket/examples/velocity/DynamicPage.html | 4 +- .../apache/wicket/examples/velocity/Home.html | 3 +- .../wicket/examples/velocity/TemplatePage.html | 52 ++++----- .../wicket/examples/velocity/TemplatePage.java | 9 +- .../velocity/VelocityTemplateApplication.java | 17 +-- .../examples/requestmapper/LocalizedPage.html | 7 +- .../requestmapper/RequestMapperHomePage.html | 6 +- .../packageMount/PackageMountedPage.html | 7 +- .../src/main/webapp/js-test/tests/ajax/form.js | 6 +- .../js-test/tests/bean-validation/birthdate.js | 4 +- .../js-test/tests/bean-validation/email.js | 4 +- .../js-test/tests/bean-validation/name.js | 4 +- .../js-test/tests/bean-validation/password.js | 4 +- .../js-test/tests/bean-validation/phone.js | 4 +- .../src/main/webapp/js-test/tests/echo.js | 4 +- .../src/main/webapp/js-test/tests/forminput.js | 6 +- .../main/webapp/js-test/tests/mailtemplate.js | 8 +- 43 files changed, 294 insertions(+), 300 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/AtmosphereApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/AtmosphereApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/AtmosphereApplication.java index 90e838a..54380bb 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/AtmosphereApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/AtmosphereApplication.java @@ -21,18 +21,17 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import de.agilecoders.wicket.webjars.WicketWebjars; import org.apache.wicket.Application; import org.apache.wicket.atmosphere.EventBus; import org.apache.wicket.atmosphere.config.AtmosphereLogLevel; import org.apache.wicket.atmosphere.config.AtmosphereTransport; -import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.examples.WicketExampleApplication; /** * Application object for your web application. If you want to run this application without * deploying, run the Start class. */ -public class AtmosphereApplication extends WebApplication +public class AtmosphereApplication extends WicketExampleApplication { private EventBus eventBus; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.html index 6787a86..289b3f9 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.html @@ -1,11 +1,7 @@ <!DOCTYPE html> <html xmlns:wicket="http://wicket.apache.org"> -<head> -<title>Wicket Examples - atmosphere</title> -<link rel="stylesheet" type="text/css" href="style.css" /> -</head> <body> - <span wicket:id="mainNavigation"></span> +<wicket:extend> <p> The current time is (updated every 2 seconds from the server using push): <span wicket:id="time"></span> </p> @@ -13,13 +9,39 @@ second input field and send it to everyone. To send a private message, paste the session id (you can find this in the session cookie) of the receiver in the first input field and send a message.</p> - <p> - Message received: <span wicket:id="message"></span> - </p> - <form wicket:id="form"> - <div>Session id of receiver: <input wicket:id="receiver" /></div> - Message: <input wicket:id="input" /> <a href="#" wicket:id="send">Send - message</a> - </form> + + <div class="row"> + <div class="col-sm-6"> + + <form wicket:id="form" class="form-horizontal"> + <div class="form-group"> + <label class="control-label col-sm-3" wicket:for="receiver" style="text-align: start">Session id of receiver:</label> + <div class="col-sm-4"> + <input wicket:id="receiver" class="form-control" /> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" wicket:for="receiver" style="text-align: start">Message:</label> + <div class="col-sm-4"> + <input wicket:id="input" class="form-control" /> + </div> + <div class="col-sm-1"> + <button type="button" class="btn btn-primary btn-sm" wicket:id="send">Send message</button> + </div> + </div> + </form> + + <div class="row"> + <label class="col-sm-3" wicket:for="receiver">Message received:</label> + <div class="col-sm-4"> + <span wicket:id="message" style="padding-left: 18px"></span> + </div> + </div> + + </div> + </div> + + +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.java index 7377c48..fa9a682 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/atmosphere/HomePage.java @@ -20,7 +20,7 @@ import java.util.Date; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink; +import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.atmosphere.AtmosphereInternalEvent; import org.apache.wicket.atmosphere.EventBus; import org.apache.wicket.atmosphere.Subscribe; @@ -51,7 +51,7 @@ public class HomePage extends WicketExamplePage add(form); form.add(receiver = new TextField<>("receiver", Model.of(""))); form.add(input = new TextField<>("input", Model.of(""))); - form.add(new AjaxSubmitLink("send", form) + form.add(new AjaxButton("send", form) { private static final long serialVersionUID = 1L; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationApplication.java index a2fd84c..08dfc7b 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationApplication.java @@ -31,6 +31,7 @@ public class BeanValidationApplication extends WicketExampleApplication @Override protected void init() { + super.init(); new BeanValidationConfiguration().configure(this); } } http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.html index 4ac3cb5..2684e0f 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.html @@ -1,54 +1,70 @@ <html xmlns:wicket="http://wicket.apache.org"> -<head> -<title>Wicket Examples - Bean Validation</title> -<link rel="stylesheet" type="text/css" href="style.css" /> +<wicket:head> <style> .note { font-size:.8em; } .required {font-weight: bold;} </style> -</head> +</wicket:head> <body> - <span wicket:id="mainNavigation" /> +<wicket:extend> <div wicket:id="feedback"></div> - <form wicket:id="form" novalidate="novalidate"> - <table cellspacing="0" cellpadding="4"> - <tr> - <td><label wicket:for="name"><wicket:label>Name</wicket:label></label></td> - <td><input wicket:id="name" type="text" size="30"/></td> - <td><pre class="note">@NotNull @Size(min = 2, max = 30)</pre></td> - </tr> - <tr> - <td><label wicket:for="email"><wicket:label>Email</wicket:label></label></td> - <td><input wicket:id="email" type="text" size="30"/></td> - <td><pre class="note">@NotNull @Email</pre></td> - </tr> - <tr> - <td><label wicket:for="phone"><wicket:label>Phone</wicket:label></label></td> - <td><input wicket:id="phone" type="text" size="20"/></td> - <td><pre class="note">@Pattern(regexp = "[0-9]{3}-[0-9]{4}")</pre></td> - </tr> - <tr> - <td><label wicket:for="birthdate"><wicket:label>Birthdate</wicket:label></label></td> - <td><input wicket:id="birthdate" type="text" size="10"/></td> - <td><pre class="note">m/d/yyyy field with @Past</pre></td> - </tr> - <tr> - <td><label wicket:for="password"><wicket:label>Password</wicket:label></label></td> - <td><input wicket:id="password" type="text" size="10"/></td> - <td><pre class="note">Custom constraint @ValidPassword with custom message bundles.<br/>A valid password must contain only alphanumeric chars and at least two digits.</pre> - </td> - </tr> - <tr> - <td></td> - <td> - <input type="submit" value="Submit"/> - </td> - <td><span class="note">press to submit the form and run the validation</span></td> - </tr> - </table> - </form> + <form wicket:id="form" class="form-horizontal" novalidate="novalidate"> + <div class="form-group"> + <label wicket:for="name" class="control-label col-sm-1"><wicket:label>Name</wicket:label></label> + <div class="col-sm-2"> + <input wicket:id="name" type="text" size="30" class="form-control"/> + </div> + <div class="col-sm-2"> + <pre class="note">@NotNull @Size(min = 2, max = 30)</pre> + </div> + </div> + + <div class="form-group"> + <label wicket:for="email" class="control-label col-sm-1"><wicket:label>Email</wicket:label></label> + <div class="col-sm-2"> + <input wicket:id="email" type="text" size="30" class="form-control"/> + </div> + <div class="col-sm-2"> + <pre class="note">@NotNull @Email</pre> + </div> + </div> + + + <div class="form-group"> + <label wicket:for="phone" class="control-label col-sm-1"><wicket:label>Phone</wicket:label></label> + <div class="col-sm-2"> + <input wicket:id="phone" type="text" size="20" class="form-control"/> + </div> + <div class="col-sm-3"> + <pre class="note">@Pattern(regexp = "[0-9]{3}-[0-9]{4}")</pre> + </div> + </div> + <div class="form-group"> + <label wicket:for="birthdate" class="control-label col-sm-1"><wicket:label>Birthdate</wicket:label></label> + <div class="col-sm-2"> + <input wicket:id="birthdate" type="text" size="10" class="form-control"/> + </div> + <div class="col-sm-2"> + <pre class="note">m/d/yyyy field with @Past</pre> + </div> + </div> + + <div class="form-group"> + <label wicket:for="password" class="control-label col-sm-1"><wicket:label>Password</wicket:label></label> + <div class="col-sm-2"> + <input wicket:id="password" type="text" size="10" class="form-control"/> + </div> + <div class="col-sm-7"> + <pre><code class="note">Custom constraint @ValidPassword with custom message bundles.A valid password must contain only alphanumeric chars and at least two digits.</code></pre> + </div> + </div> + + <input type="submit" value="Submit" class="btn btn-primary"/> + + </form> +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.java index 63015df..9ea571d 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/bean/validation/BeanValidationPage.java @@ -24,9 +24,10 @@ import org.apache.wicket.datetime.markup.html.form.DateTextField; import org.apache.wicket.examples.WicketExamplePage; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.PropertyModel; +import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel; + public class BeanValidationPage extends WicketExamplePage { @@ -34,17 +35,17 @@ public class BeanValidationPage extends WicketExamplePage public BeanValidationPage() { - add(new FeedbackPanel("feedback")); + add(new NotificationPanel("feedback")); Form<?> form = new Form<>("form"); add(form); - form.add(new TextField<String>("name", new PropertyModel<String>(this, "person.name")).add(new PropertyValidator<>())); - form.add(new TextField<String>("phone", new PropertyModel<String>(this, "person.phone")).add(new PropertyValidator<>())); - form.add(new TextField<String>("email", new PropertyModel<String>(this, "person.email")).add(new PropertyValidator<>())); + form.add(new TextField<>("name", new PropertyModel<String>(this, "person.name")).add(new PropertyValidator<>())); + form.add(new TextField<>("phone", new PropertyModel<String>(this, "person.phone")).add(new PropertyValidator<>())); + form.add(new TextField<>("email", new PropertyModel<String>(this, "person.email")).add(new PropertyValidator<>())); form.add(new DateTextField("birthdate", new PropertyModel<Date>(this, "person.birthdate"), new StyleDateConverter("S-", true)).add(new PropertyValidator<>())); - form.add(new TextField<String>("password", new PropertyModel<String>(this, "person.password")).add(new PropertyValidator<>())); + form.add(new TextField<>("password", new PropertyModel<String>(this, "person.password")).add(new PropertyValidator<>())); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java index 1d2111a..e9eee37 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java @@ -18,9 +18,9 @@ package org.apache.wicket.examples.cdi; import org.apache.wicket.Page; import org.apache.wicket.cdi.CdiConfiguration; -import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.examples.WicketExampleApplication; -public class CdiApplication extends WebApplication +public class CdiApplication extends WicketExampleApplication { @Override http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html index ce30e2d..fe83941 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html @@ -1,5 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org" xml:lang="en" lang="en"> <head> @@ -7,12 +6,14 @@ <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> - <span wicket:id="mainNavigation" /> + <wicket:extend> <h2>Welcome to Context, Dependencies, and Injection Integration Examples</h2> <p><wicket:link><a href="CdiHomePage.html">[go back]</a></wicket:link></p> <wicket:child/> + + </wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/echo/Echo.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/echo/Echo.html b/wicket-examples/src/main/java/org/apache/wicket/examples/echo/Echo.html index 7c397cd..e014e64 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/echo/Echo.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/echo/Echo.html @@ -10,7 +10,7 @@ <button type="submit"class="btn btn-primary">Set message</button> </form> - <span wicket:id="msg">Message goes here</span> + <span wicket:id="msg" id="gym-msg">Message goes here</span> </wicket:extend> </body> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/events/BasePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/events/BasePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/events/BasePage.html index 4caa435..410a8c8 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/events/BasePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/events/BasePage.html @@ -4,8 +4,9 @@ <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> - <span wicket:id="mainNavigation"></span> +<wicket:extend> <a href="Index.html" wicket:id="back">[go back]</a><p/> <wicket:child/> +</wicket:extend> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/events/DecoupledAjaxUpdatePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/events/DecoupledAjaxUpdatePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/events/DecoupledAjaxUpdatePage.html index 5ce6bb5..9129056 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/events/DecoupledAjaxUpdatePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/events/DecoupledAjaxUpdatePage.html @@ -1,10 +1,22 @@ <wicket:extend xmlns:wicket="http://wicket.apache.org"> -Counter Label 1: <span wicket:id="label1">1</span> + <div class="row"> + <label class="col-sm-1">Counter Label 1:</label> + <div class="col-sm-3"><span wicket:id="label1" style="padding-left: 18px">1</span></div> + </div> -<div wicket:id="container">Counter Label 2: <span wicket:id="label2">1</span></div> + <div class="row" wicket:id="container"> + <label class="col-sm-1">Counter Label 2:</label> + <div class="col-sm-3"><span wicket:id="label2" style="padding-left: 18px">1</span></div> + </div> -<form wicket:id="form"> - Counter Value: <input wicket:id="counter" type="text"/> <input wicket:id="submit" type="submit" value="Update"/> -</form> -</wicket:extend> \ No newline at end of file + <form wicket:id="form" class="form-horizontal"> + <div class="form-group"> + <label wicket:for="counter" class="control-label col-sm-1" style="text-align: start">Counter Value:</label> + <div class="col-sm-3"> + <input wicket:id="counter" type="text" class="form-control"/> + </div> + </div> + <input wicket:id="submit" type="submit" value="Update" class="btn btn-primary btn-sm"/> + </form> +</wicket:extend> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html b/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html index 43fdc9c..748ec75 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.html @@ -77,7 +77,7 @@ <div class="form-group"> <label wicket:for="integerInRangeProperty" class="col-sm-5 control-label"><wicket:message key="value.between.0.and.100"/></label> <div class="col-sm-7"> - <input wicket:id="integerInRangeProperty" class="form-control" type="text" size="40"/> + <input wicket:id="integerInRangeProperty" id="gym-integerInRangeProperty" class="form-control" type="text" size="40"/> </div> </div> <div class="form-group"> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/guice/HomePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/guice/HomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/guice/HomePage.html index 32ef2ac..3d789b9 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/guice/HomePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/guice/HomePage.html @@ -5,7 +5,7 @@ <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> - <span wicket:id="mainNavigation"/> +<wicket:extend> <p> This page uses <a href="http://code.google.com/p/google-guice/">Google Guice</a>. There is a service interface called <code>IMyService</code>, with an implementation POJO called <code>MyService</code>. @@ -26,6 +26,6 @@ The wicket-guice project will take care of proxying the injected beans so that your pages can be serialized safely. To configure your application for Guice injection, see the javadoc for <code>GuiceComponentInjector</code>. </p> - +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.html b/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.html index 87a436d..e7c1a1a 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.html @@ -1,67 +1,64 @@ <wicket:extend xmlns:wicket="http://wicket.apache.org"> <div wicket:id = "feedback"></div> <p> - <form wicket:id = "editBookForm" style="width: 300px"> - <table cellpadding="3"> - <tr> - <td align="right">Title:</td> - <td wicket:id="titleFeedback"> - <input wicket:id="title" type="text" value="Huckleberry Finn" size="30"/> - </td> - </tr> - <tr> - <td align="right">Author:</td> - <td wicket:id="authorFeedback"> - <input wicket:id="author" type="text" value="Mark Twain" hidden="1" size="30"/> - </td> - </tr> - <tr> - <td align="right">Fiction:</td> - <td> - <input wicket:id = "fiction" type="checkbox"/> - </td> - </tr> - <tr> - <td align="right">Favorite Companion Book:</td> - <td> - <select wicket:id = "companionBook"> - <option>Volvo</option> - <option>Saab</option> - <option>Fiat</option> - <option>Audi</option> + <form wicket:id="editBookForm" style="width: 600px" class="form-horizontal"> + <div class="form-group"> + <label wicket:for="title" class="col-sm-4 control-label">Title:</label> + <div class="col-sm-8" wicket:id="titleFeedback"> + <input type="text" class="form-control" wicket:id="title"> + </div> + </div> + + <div class="form-group"> + <label wicket:for="author" class="col-sm-4 control-label">Author:</label> + <div class="col-sm-8" wicket:id="authorFeedback"> + <input type="text" class="form-control" wicket:id="author"> + </div> + </div> + + <div class="form-group"> + <label wicket:for="fiction" class="col-sm-4 control-label">Fiction:</label> + <div class="col-sm-8 checkbox"> + <label> + <input wicket:id="fiction" type="checkbox"/> + </label> + </div> + </div> + + <div class="form-group"> + <label wicket:for="author" class="col-sm-4 control-label">Favorite Companion Book:</label> + <div class="col-sm-8"> + <select wicket:id="companionBook" class="form-control"> + <option>Volvo</option> + <option>Saab</option> + <option>Fiat</option> + <option>Audi</option> </select> - </td> - </tr> - <tr> - <td align="right" valign="top">Styles:</td> - <td> - <select multiple="multiple" wicket:id = "writingStyles"> - <option>Foo</option> - <option>Bar</option> + </div> + </div> + + <div class="form-group"> + <label wicket:for="author" class="col-sm-4 control-label">Styles:</label> + <div class="col-sm-8"> + <select multiple="multiple" wicket:id="writingStyles" class="form-control"> + <option>Foo</option> + <option>Bar</option> </select> - </td> - </tr> - <tr> - <td align="right" valign="top">Related book:</td> - <td valign="top"> - <span valign="top" wicket:id = "relatedBook"> + </div> + </div> + + <div class="form-group"> + <label wicket:for="author" class="col-sm-4 control-label">Related book:</label> + <div class="col-sm-8"> + <span valign="top" wicket:id="relatedBook"> <input type="radio" value="A" />A <input type="radio" value="B" />B <input type="radio" value="C" />C </span> - </td> - </tr> - <tr> - <td> - </td> - <td> - <p> - <br /> - <input type="submit" value="Save Changes"/> - </p> - </td> - </tr> - </table> + </div> + </div> + + <input type="submit" value="Save Changes" class="btn btn-primary"/> </form> </p> </wicket:extend> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.java b/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.java index f237b50..c819194 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/library/EditBook.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.html.form.AbstractChoice; import org.apache.wicket.markup.html.form.CheckBox; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; @@ -132,11 +133,11 @@ public final class EditBook extends AuthenticatedWebPage // Add radio choice test final RadioChoice<Book> relatedBook = new RadioChoice<>("relatedBook", books); + relatedBook.setLabelPosition(AbstractChoice.LabelPosition.WRAP_AFTER).setSuffix("<br/>"); add(relatedBook); // Multi-select among writing styles - add(new ListMultipleChoice<EnumeratedType>("writingStyles", - EnumeratedType.getValues(Book.WritingStyle.class))); + add(new ListMultipleChoice<>("writingStyles", EnumeratedType.getValues(Book.WritingStyle.class))); } /** http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.java index 8302d5c..4db502c 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.java @@ -19,14 +19,9 @@ package org.apache.wicket.examples.requestmapper; import org.apache.wicket.examples.WicketExamplePage; import org.apache.wicket.request.mapper.parameter.PageParameters; -/** - * @author mgrigorov - */ public class RequestMapperHomePage extends WicketExamplePage { - /** - * * Construct. * * @param pageParameters http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.css ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.css b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.css index 34e16e2..d725028 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.css +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.css @@ -16,9 +16,9 @@ */ .borderedThing { - border: 1px solid red; + border: 1px solid red; } .pending { - border: 1px solid yellow; + border: 2px solid yellow; } http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.html index 0ac8033..cdce126 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.html @@ -1,12 +1,8 @@ -<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > - <wicket:head> - <title>Resource Aggregation Example Application</title> - <link rel="stylesheet" type="text/css" href="style.css"/> - </wicket:head> +<html xmlns:wicket="http://wicket.apache.org" > <body> - <div wicket:id="mainNavigation"></div> + <wicket:extend> - <div id="bodyContent" class="bodyContent"> + <div id="bodyContent" > <h1 class="header">Resource Aggregation Example Application</h1> <p style="font-size: 1.5em">If the background is light grey, then app.css was loaded.</p> <p style="font-size: 1.5em">If this box has a red border, top.js was not loaded from the header</p> @@ -18,11 +14,12 @@ <div wicket:id="ajaxProofPlaceholder" class="ajaxProofPlaceholder pending"> after five seconds, you should see ajax update this container (to a green border) </div> - <div class="complete">Everything is done when all three boxes are green</div> + <div class="completed">Everything is done when all three boxes are green</div> <h1 class="footer">footer h1</h1> </div> - <wicket:container wicket:id="footerJS"></wicket:container> - + <wicket:container wicket:id="footerJS"/> + + </wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.java index f8b19ba..1bae398 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/HomePage.java @@ -32,7 +32,6 @@ import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.request.mapper.parameter.PageParameters; 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.resource.JQueryPluginResourceReference; import org.apache.wicket.util.time.Duration; @@ -64,13 +63,13 @@ public class HomePage extends WicketExamplePage { response.render(OnDomReadyHeaderItem.forScript("$('#" + jsPlaceholder.getMarkupId() + - "').html('the ondomready script ran').css('border-color', 'green');")); + "').html('the ondomready script ran').removeClass('borderedThing').addClass('completed');")); } }); add(jsPlaceholder); add(new AjaxProofContainer("ajaxProofPlaceholder")); - add(new AbstractAjaxTimerBehavior(Duration.seconds(4)) + add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) { private static final long serialVersionUID = 1L; @@ -131,11 +130,7 @@ public class HomePage extends WicketExamplePage { if (getRequestCycle().find(AjaxRequestTarget.class) != null) { - response.render(CssHeaderItem.forReference(new PackageResourceReference( - HomePage.class, "ajax.css"))); - response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference( - HomePage.class, "ajax.js"))); - response.render(OnDomReadyHeaderItem.forScript("updatePending();")); + response.render(OnDomReadyHeaderItem.forScript("$('.pending').removeClass('pending').addClass('completed');")); } } } http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java index 80ce478..e6dd273 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ResourceDecorationApplication.java @@ -17,6 +17,7 @@ package org.apache.wicket.examples.resourcedecoration; import org.apache.wicket.Application; +import org.apache.wicket.examples.WicketExampleApplication; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.filter.JavaScriptFilteredIntoFooterHeaderResponse; import org.apache.wicket.markup.html.IHeaderResponseDecorator; @@ -33,9 +34,8 @@ import org.apache.wicket.request.resource.CssResourceReference; * * @author jthomerson */ -public class ResourceDecorationApplication extends WebApplication +public class ResourceDecorationApplication extends WicketExampleApplication { - @Override protected void init() { http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.css ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.css b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.css deleted file mode 100644 index e56336f..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -.complete { - border: 1px solid green; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.js b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.js deleted file mode 100644 index 09f8ac5..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/ajax.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function updatePending() { - $('.pending').addClass('complete'); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/app.css ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/app.css b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/app.css index 83d0397..18eb152 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/app.css +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/resourcedecoration/app.css @@ -20,4 +20,10 @@ .bodyContent.error { border: 3px solid red; -} \ No newline at end of file +} + +.completed { + border: 3px solid green; + margin-top: 5px; + margin-bottom: 5px; +} http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/spring/annot/web/AnnotPage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/annot/web/AnnotPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/annot/web/AnnotPage.java index b894f54..4a28837 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/annot/web/AnnotPage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/annot/web/AnnotPage.java @@ -19,7 +19,6 @@ package org.apache.wicket.examples.spring.annot.web; import org.apache.wicket.examples.spring.common.ContactDao; import org.apache.wicket.examples.spring.common.web.ContactDataProvider; import org.apache.wicket.examples.spring.common.web.ContactsDisplayPage; -import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; import org.apache.wicket.spring.injection.annot.SpringBean; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/BasePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/BasePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/BasePage.html index b0dd3a9..ae9b510 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/BasePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/BasePage.html @@ -21,12 +21,16 @@ </head> <body> - <span wicket:id="mainNavigation"/> - <a href="#" wicket:id="home-link">Home Page</a> + <wicket:extend> + <a wicket:id="home-link">Home Page</a> <hr/> <wicket:child/> <br/><br/> - All this is discussed in more detail here:<br/> - <a href="http://cwiki.apache.org/WICKET/spring.html" target="_blank">Wicket Wiki Spring Page</a> + More details could be found here at + <ul> + <li>the <a href="http://wicket.apache.org/guide/guide/jee.html#jee_2" target="_blank">reference guide</a></li> + <li>the <a href="https://cwiki.apache.org/confluence/display/WICKET/Spring" target="_blank">Wiki</a></li> + </ul> + </wicket:extend> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/ExampleApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/ExampleApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/ExampleApplication.java index 7fc6784..02546d1 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/ExampleApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/spring/common/web/ExampleApplication.java @@ -16,8 +16,8 @@ */ package org.apache.wicket.examples.spring.common.web; +import org.apache.wicket.examples.WicketExampleApplication; import org.apache.wicket.examples.spring.common.ContactDao; -import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.spring.injection.annot.SpringComponentInjector; /** @@ -26,7 +26,7 @@ import org.apache.wicket.spring.injection.annot.SpringComponentInjector; * @author Igor Vaynberg (ivaynberg) * */ -public class ExampleApplication extends WebApplication +public class ExampleApplication extends WicketExampleApplication { /** @@ -44,7 +44,7 @@ public class ExampleApplication extends WebApplication @Override protected void init() { - getDebugSettings().setDevelopmentUtilitiesEnabled(true); + super.init(); // THIS LINE IS IMPORTANT - IT INSTALLS THE COMPONENT INJECTOR THAT WILL // INJECT NEWLY CREATED COMPONENTS WITH THEIR SPRING DEPENDENCIES @@ -52,9 +52,8 @@ public class ExampleApplication extends WebApplication } @Override - public Class getHomePage() + public Class<HomePage> getHomePage() { return HomePage.class; } - } http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/DynamicPage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/DynamicPage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/DynamicPage.html index 6622332..45c8738 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/DynamicPage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/DynamicPage.html @@ -4,8 +4,7 @@ <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> - - <span wicket:id="mainNavigation"/> +<wicket:extend> <div style="border: 2px dotted #fc0; padding: 5px; margin-right: 25%;"> The fields in this page are driven by your data model, creating a new field will automatically add it to the @@ -18,5 +17,6 @@ </fieldset> </div> +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/Home.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/Home.html b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/Home.html index 5fb3da7..0f1c0e1 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/Home.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/Home.html @@ -4,7 +4,7 @@ <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> - <span wicket:id="mainNavigation"/> +<wicket:extend> <h3>Velocity Template Component</h3> <div style="border: 2px dotted #fc0; padding: 5px; margin-right: 25%;"> @@ -27,5 +27,6 @@ </li> </ul> </wicket:link> +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.html index ee18322..23b1567d 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.html @@ -4,44 +4,38 @@ <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> +<wicket:extend> - <span wicket:id="mainNavigation"/> - -<table cellpadding="5px"> +<table class="table table-bordered"> <tr> - <td valign="top" height="100%"> - - <div id="templateInputBox"> - <form wicket:id="templateForm"> - <fieldset> - <legend><a target="#" href="http://jakarta.apache.org/velocity/">velocity</a> template input</legend> - - <textarea wicket:id="templateInput" rows="16" cols="36">Template input comes here</textarea> + <td width="35%"> + <div id="templateInputBox"> + <form wicket:id="templateForm"> + <fieldset> + <legend><a target="_blank" href="http://velocity.apache.org/">Apache Velocity</a> template</legend> + <div class="form-group"> + <textarea wicket:id="templateInput" rows="16" cols="36" class="form-control" style="resize: none">Template input comes here</textarea> + </div> - <div id="templateUpdateButton"> - <input type="submit" value="update"/> - </div> - </fieldset> - </form> - </div> + <input type="submit" value="update" class="btn btn-primary"/> + </fieldset> + </form> + </div> </td> - <td valign="top" height="100%"> - - <div id="templateOutputBox"> - <fieldset> - <legend>output</legend> - <span wicket:id="templatePanel">Template output will be put here</span> - </fieldset> - </div> - + <td> + <div id="templateOutputBox"> + <fieldset> + <legend>output</legend> + <span wicket:id="templatePanel">Template output will be put here</span> + </fieldset> + </div> </td> </tr> </table> - <div> - <span wicket:id="feedback"/> - </div> + <div wicket:id="feedback"></div> +</wicket:extend> </body> </html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.java index 02b553f..4be1f01 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/TemplatePage.java @@ -20,10 +20,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.wicket.core.util.resource.PackageResourceStream; import org.apache.wicket.examples.WicketExamplePage; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; @@ -31,10 +31,11 @@ import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.resource.ResourceUtil; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.IStringResourceStream; -import org.apache.wicket.core.util.resource.PackageResourceStream; import org.apache.wicket.util.resource.StringResourceStream; import org.apache.wicket.velocity.markup.html.VelocityPanel; +import de.agilecoders.wicket.core.markup.html.bootstrap.common.NotificationPanel; + /** * Template example page. * @@ -99,7 +100,7 @@ public class TemplatePage extends WicketExamplePage return template; } }); - add(new FeedbackPanel("feedback")); + add(new NotificationPanel("feedback")); } /** @@ -122,4 +123,4 @@ public class TemplatePage extends WicketExamplePage { this.template = new StringResourceStream(template); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/VelocityTemplateApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/VelocityTemplateApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/VelocityTemplateApplication.java index 611801d..ce26a4e 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/VelocityTemplateApplication.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/velocity/VelocityTemplateApplication.java @@ -22,16 +22,16 @@ import java.util.List; import org.apache.velocity.app.Velocity; import org.apache.wicket.Page; import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.examples.WicketExampleApplication; import org.apache.wicket.markup.html.IPackageResourceGuard; import org.apache.wicket.markup.html.SecurePackageResourceGuard; -import org.apache.wicket.protocol.http.WebApplication; /** * Application class for velocity template example. * * @author Eelco Hillenius */ -public class VelocityTemplateApplication extends WebApplication +public class VelocityTemplateApplication extends WicketExampleApplication { private static List<Field> fields = new ArrayList<>(); @@ -72,13 +72,6 @@ public class VelocityTemplateApplication extends WebApplication } /** - * Constructor. - */ - public VelocityTemplateApplication() - { - } - - /** * @return class */ @Override @@ -87,13 +80,11 @@ public class VelocityTemplateApplication extends WebApplication return Home.class; } - /** - * @see org.apache.wicket.protocol.http.WebApplication#init() - */ @Override protected void init() { - getDebugSettings().setDevelopmentUtilitiesEnabled(true); + super.init();; + IPackageResourceGuard packageResourceGuard = getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/LocalizedPage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/LocalizedPage.html b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/LocalizedPage.html index 111c00d..298864c 100644 --- a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/LocalizedPage.html +++ b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/LocalizedPage.html @@ -22,13 +22,14 @@ </head> <body> - <span wicket:id="mainNavigation"/> + <wicket:extend> <a href="Index.html" wicket:id="back">[go back]</a><p/> <wicket:child/> <p> <span wicket:id="localizedLabel">[I am a localized depending on the URL's first segment]</span> - </p> + </p> + </wicket:extend> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html index 11acba3..d90eff9 100644 --- a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html +++ b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html @@ -22,7 +22,7 @@ </head> <body> - <span wicket:id="mainNavigation"/> + <wicket:extend> <a href="index.html">[go back]</a><br/> <wicket:child/> @@ -46,7 +46,7 @@ <p><wicket:link><a href="pMount/PackageMountedPage">A page mounted with PackageMapper</a></wicket:link></p> <p><wicket:link><a href="print/sheet1/a4">A mounted resource that prints sheets in different formats</a></wicket:link></p> - + </wicket:extend> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/packageMount/PackageMountedPage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/packageMount/PackageMountedPage.html b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/packageMount/PackageMountedPage.html index 8ed7f3c..277877c 100644 --- a/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/packageMount/PackageMountedPage.html +++ b/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/packageMount/PackageMountedPage.html @@ -22,7 +22,7 @@ </head> <body> - <span wicket:id="mainNavigation"/> + <wicket:extend> <a href="Index.html" wicket:id="back">[go back]</a><p/> <wicket:child/> @@ -42,7 +42,8 @@ } </pre> </div> - </p> + </p> + </wicket:extend> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js b/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js index 8082e7f..ff86682 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js +++ b/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js @@ -37,9 +37,9 @@ $q(document).ready(function() { }).then(function($) { // an error feedback message that email is mandatory is expected - var $feedback = $('li.feedbackPanelERROR > span'); + var $feedback = $('div.alert-danger'); equal($feedback.length, 1, 'The error feedback message that email is missing is here'); - equal($feedback.text(), 'Email is required', 'The error feedback matches'); + ok($feedback.text().indexOf('Email is required') > 0, 'The error feedback matches'); // enter the email field too var $emailInput = $('input[name=email]'); @@ -50,7 +50,7 @@ $q(document).ready(function() { }).then(function($) { // the feedback panel must be empty now - var $feedback = $('li.feedbackPanelERROR > span'); + var $feedback = $('div.alert-danger'); equal($feedback.length, 0, 'The error feedback message should be gone'); }).always(start); http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js index b8644a2..88ee8e5 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js +++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js @@ -24,8 +24,8 @@ $q(document).ready(function() { var selectors = { birthdateInput: "input[name=birthdate]", - birthdateInvalidDateErrorFeedback: "li.feedbackPanelERROR > span:contains(\"The value of 'Birthdate' is not a valid Date.\")", - birthdateNotInPastErrorFeedback: "li.feedbackPanelERROR > span:contains(\"'Birthdate' must be in the past\")" + birthdateInvalidDateErrorFeedback: "div.alert-danger:contains(\"The value of 'Birthdate' is not a valid Date.\")", + birthdateNotInPastErrorFeedback: "div.alert-danger:contains(\"'Birthdate' must be in the past\")" }; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js index 2f73ab0..a0fb8fd 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js +++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js @@ -24,8 +24,8 @@ $q(document).ready(function() { var selectors = { emailInput: "input[name=email]", - emailNullErrorFeedback: "li.feedbackPanelERROR > span:contains(\"'Email' is required\")", - emailInvalidErrorFeedback: "li.feedbackPanelERROR > span:contains(\"'Email' is not a well-formed email address\")" + emailNullErrorFeedback: "div.alert-danger:contains(\"'Email' is required\")", + emailInvalidErrorFeedback: "div.alert-danger:contains(\"'Email' is not a well-formed email address\")" }; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js index 5647fb0..2861350 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js +++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js @@ -23,8 +23,8 @@ $q(document).ready(function() { var selectors = { nameInput: "input[name='p::name']", - nameNullErrorFeedback: "li.feedbackPanelERROR > span:contains(\"'Name' is required\")", - nameRangeErrorFeedback: "li.feedbackPanelERROR > span:contains(\"'Name' length must be between 2 and 30\")" + nameNullErrorFeedback: "div.alert-danger:contains(\"'Name' is required\")", + nameRangeErrorFeedback: "div.alert-danger:contains(\"'Name' length must be between 2 and 30\")" }; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/bean-validation/password.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/password.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/password.js index 42345fb..e30c168 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/password.js +++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/password.js @@ -24,8 +24,8 @@ $q(document).ready(function() { var selectors = { passwordInput: "input[name=password]", - passwordMissingDigitsErrorFeedback: "li.feedbackPanelERROR > span:contains(\"You need to have at least 2 digits in your password.\")", - passwordInvalidContentErrorFeedback: "li.feedbackPanelERROR > span:contains(\"Password value can contain only characters and digits.\")" + passwordMissingDigitsErrorFeedback: "div.alert-danger:contains(\"You need to have at least 2 digits in your password.\")", + passwordInvalidContentErrorFeedback: "div.alert-danger:contains(\"Password value can contain only characters and digits.\")" }; http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js index 70fc464..2e7785d 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js +++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js @@ -24,7 +24,7 @@ $q(document).ready(function() { var selectors = { phoneInput: "input[name=phone]", - phoneInvalidErrorFeedback: "li.feedbackPanelERROR > span:contains(Phone)" + phoneInvalidErrorFeedback: "div.alert-danger:contains(Phone)" }; var submit = function($) { @@ -50,7 +50,7 @@ $q(document).ready(function() { var $phoneErrorSpan = $(selectors.phoneInvalidErrorFeedback); equal($phoneErrorSpan.length, 1, 'The feedback message for invalid phone is there'); - equal($phoneErrorSpan.text(), "'Phone' must match \"[0-9]{3}-[0-9]{4}\"", 'The feedback error message for invalid phone is correct'); + ok($phoneErrorSpan.text().indexOf("'Phone' must match \"[0-9]{3}-[0-9]{4}\"") > 0, 'The feedback error message for invalid phone is correct'); // enter valid phone var $input = $(selectors.phoneInput); http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/echo.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/echo.js b/wicket-examples/src/main/webapp/js-test/tests/echo.js index 77fe1a0..5fd1f07 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/echo.js +++ b/wicket-examples/src/main/webapp/js-test/tests/echo.js @@ -33,10 +33,10 @@ $q(document).ready(function() { var $messageInput = $('input[name=msgInput]'); $messageInput.val(message); - return gym.click($('input[type=submit]')); + return gym.click($('button[type=submit]')); }).then(function($) { - var $msg = $('#msg'); + var $msg = $('#gym-msg'); equal($msg.length, 1, 'The entered message is here'); equal($msg.text(), message, 'The entered message is here'); http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/forminput.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/forminput.js b/wicket-examples/src/main/webapp/js-test/tests/forminput.js index e6b17e6..079d8fc 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/forminput.js +++ b/wicket-examples/src/main/webapp/js-test/tests/forminput.js @@ -37,9 +37,9 @@ $q(document).ready(function() { return gym.click($('input[value=save]')); }).then(function($) { - var $feedback = $('li.feedbackPanelINFO > span'); + var $feedback = $('div.alert-info'); equal($feedback.length, 1, 'The feedback is here'); - equal($feedback.text().indexOf("stringProperty = '"+text+"'"), 29, 'The entered text is here'); + equal($feedback.text().indexOf("stringProperty = '"+text+"'"), 82, 'The entered text is here'); }).always(start); }); @@ -57,7 +57,7 @@ $q(document).ready(function() { return gym.click($('input[value=save]')); }).then(function($) { - var $integerInRangeProperty = $('label[for=integerInRangeProperty]'); + var $integerInRangeProperty = $('label[for=gym-integerInRangeProperty]'); equal($integerInRangeProperty.length, 1, 'The label for integerInRangeProperty is here'); equal($integerInRangeProperty.text(), 'Nur Werte zwischen 0 und 100 sind erlaubt', 'The german version is correct'); http://git-wip-us.apache.org/repos/asf/wicket/blob/a8628257/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js b/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js index 6847f6f..942c3b1 100644 --- a/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js +++ b/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js @@ -45,7 +45,7 @@ $q(document).ready(function() { var $resultText = $('#result').text(); ok($resultText, 'The page is rendered'); ok($resultText.indexOf("<!DOCTYPE html>") > -1, 'The HTML5 doctype is here'); - ok($resultText.indexOf("Hello, <span wicket:id=\"name\">"+text+"</span>") > -1, + ok($resultText.indexOf(text+"</span>") > -1, 'The entered text is here'); }).always(start); @@ -53,7 +53,7 @@ $q(document).ready(function() { asyncTest('Panel', function () { - expect(3); + expect(2); gym.load('/mailtemplate').then(function($) { return generate($, 1); @@ -61,9 +61,7 @@ $q(document).ready(function() { var $resultText = $('#result').text(); ok($resultText, 'The panel is rendered'); - ok($resultText.indexOf("<wicket:panel>") > -1, 'The panel markup is here'); - ok($resultText.indexOf("Hello, <span wicket:id=\"name\">"+text+"</span>") > -1, - 'The entered text is here'); + ok($resultText.indexOf(text+"</span>") > -1, 'The entered text is here'); }).always(start); });
