You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/12/25 10:58:07 UTC
svn commit: r1052764 - in
/click/trunk/click/examples/src/org/apache/click/examples/page/general:
ExceptionPage.java FlashPage.java NavigationA.java
Author: sabob
Date: Sat Dec 25 09:58:07 2010
New Revision: 1052764
URL: http://svn.apache.org/viewvc?rev=1052764&view=rev
Log:
Remove auto binding from examples CLK-742
Modified:
click/trunk/click/examples/src/org/apache/click/examples/page/general/ExceptionPage.java
click/trunk/click/examples/src/org/apache/click/examples/page/general/FlashPage.java
click/trunk/click/examples/src/org/apache/click/examples/page/general/NavigationA.java
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/general/ExceptionPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/ExceptionPage.java?rev=1052764&r1=1052763&r2=1052764&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/ExceptionPage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/ExceptionPage.java Sat Dec 25 09:58:07 2010
@@ -21,7 +21,6 @@ package org.apache.click.examples.page.g
import org.apache.click.Page;
import org.apache.click.control.ActionLink;
import org.apache.click.examples.page.BorderPage;
-import org.apache.click.util.Bindable;
/**
* Provides examples of the Click Exception handling.
@@ -30,14 +29,23 @@ public class ExceptionPage extends Borde
private static final long serialVersionUID = 1L;
- @Bindable protected ActionLink nullPointerLink = new ActionLink(this, "onNullPointerClick");
- @Bindable protected ActionLink illegalArgumentLink = new ActionLink(this, "onIllegalArgumentExceptionClick");
- @Bindable protected ActionLink missingMethodLink = new ActionLink(this, "onMissingMethodClick");
- @Bindable protected ActionLink brokenRendererLink = new ActionLink(this, "onBrokenRendererClick");
- @Bindable protected ActionLink brokenBorderLink = new ActionLink(this, "onBrokenBorderClick");
- @Bindable protected ActionLink brokenContentLink = new ActionLink(this, "onBrokenContentClick");
-
- private String template;
+ private ActionLink nullPointerLink = new ActionLink("nullPointerLink", this, "onNullPointerClick");
+ private ActionLink illegalArgumentLink = new ActionLink("illegalArgumentLink", this, "onIllegalArgumentExceptionClick");
+ private ActionLink missingMethodLink = new ActionLink("missingMethodLink", this, "onMissingMethodClick");
+ private ActionLink brokenRendererLink = new ActionLink("brokenRendererLink", this, "onBrokenRendererClick");
+ private ActionLink brokenBorderLink = new ActionLink("brokenBorderLink", this, "onBrokenBorderClick");
+ private ActionLink brokenContentLink = new ActionLink("brokenContentLink", this, "onBrokenContentClick");
+
+ private String templateValue;
+
+ public ExceptionPage() {
+ addControl(nullPointerLink);
+ addControl(illegalArgumentLink);
+ addControl(missingMethodLink);
+ addControl(brokenRendererLink);
+ addControl(brokenBorderLink);
+ addControl(brokenContentLink);
+ }
// Event Handlers ---------------------------------------------------------
@@ -61,7 +69,7 @@ public class ExceptionPage extends Borde
public boolean onBrokenBorderClick() {
setPath("broken-border.htm");
- template = "/general/broken-border.htm";
+ templateValue = "/general/broken-border.htm";
return true;
}
@@ -79,7 +87,7 @@ public class ExceptionPage extends Borde
*/
@Override
public String getTemplate() {
- return (template != null) ? template : super.getTemplate();
+ return (templateValue != null) ? templateValue : super.getTemplate();
}
// Inner Classes ----------------------------------------------------------
@@ -96,6 +104,7 @@ public class ExceptionPage extends Borde
* @see Object#toString()
*/
@SuppressWarnings("null")
+ @Override
public String toString() {
Object object = null;
return object.toString();
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/general/FlashPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/FlashPage.java?rev=1052764&r1=1052763&r2=1052764&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/FlashPage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/FlashPage.java Sat Dec 25 09:58:07 2010
@@ -23,7 +23,6 @@ import org.apache.click.control.Submit;
import org.apache.click.control.TextField;
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.page.HomePage;
-import org.apache.click.util.Bindable;
/**
* Provides an example of a flash session attribute.
@@ -32,11 +31,13 @@ public class FlashPage extends BorderPag
private static final long serialVersionUID = 1L;
- @Bindable protected Form form = new Form();
+ private Form form = new Form("form");
private TextField valueField = new TextField("value", "Value:", true);
public FlashPage() {
+ addControl(form);
+
form.add(valueField);
form.add(new Submit("flashPage", " Flash Page ", this, "onFlashClick"));
form.add(new Submit("homePage", " Home Page ", this, "onHomeClick"));
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/general/NavigationA.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/NavigationA.java?rev=1052764&r1=1052763&r2=1052764&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/NavigationA.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/NavigationA.java Sat Dec 25 09:58:07 2010
@@ -20,7 +20,6 @@ package org.apache.click.examples.page.g
import org.apache.click.control.ActionLink;
import org.apache.click.examples.page.BorderPage;
-import org.apache.click.util.Bindable;
/**
* Provides an navigation example Page demonstrating forward and redirect
@@ -30,10 +29,10 @@ public class NavigationA extends BorderP
private static final long serialVersionUID = 1L;
- @Bindable protected ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
- @Bindable protected ActionLink forwardParamLink = new ActionLink("forwardParamLink", this, "onForwardParamClick");
- @Bindable protected ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
- @Bindable protected ActionLink redirectParamLink = new ActionLink("redirectParamLink", this, "onRedirectParamClick");
+ private ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
+ private ActionLink forwardParamLink = new ActionLink("forwardParamLink", this, "onForwardParamClick");
+ private ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
+ private ActionLink redirectParamLink = new ActionLink("redirectParamLink", this, "onRedirectParamClick");
// Event Handlers ---------------------------------------------------------
@@ -44,6 +43,11 @@ public class NavigationA extends BorderP
public void onInit() {
super.onInit();
+ addControl(forwardLink);
+ addControl(forwardParamLink);
+ addControl(redirectLink);
+ addControl(redirectParamLink);
+
// Initialise param ActionLink values from any parameters passed through
// from other pages via forwards or redirects.
Integer number = new Integer(1);