You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2007/03/19 17:34:17 UTC
svn commit: r520005 - in
/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket:
examples/ajax/builtin/ examples/forminput/ examples/frames/
examples/hellobrowser/ examples/library/ examples/repeater/
examples/source/ exampl...
Author: jcompagner
Date: Mon Mar 19 09:34:16 2007
New Revision: 520005
URL: http://svn.apache.org/viewvc?view=rev&rev=520005
Log:
model and validators backmerge from 2.0
Please test if everything works like it should..
Modified:
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/ChoicePage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/Clock.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/EditableLabelPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/FormPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/forminput/FormInput.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/frames/BodyFrame.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hellobrowser/HelloBrowser.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/EditBook.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/DetachableContactModel.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/OIRPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/PagingPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RefreshingPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RepeatingPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SimplePage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SortingPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/source/SourcesPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stateless/SessionModel.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stockquote/StockQuoteLabel2.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/unicodeconverter/UnicodeConverter.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/upload/MultiUploadPage.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/wizard/NewUserWizard.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/spring/common/web/ContactDetachableModel.java
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/ChoicePage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/ChoicePage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/ChoicePage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/ChoicePage.java Mon Mar 19 09:34:16 2007
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.Set;
-import wicket.Component;
import wicket.ajax.AjaxRequestTarget;
import wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import wicket.markup.html.form.DropDownChoice;
@@ -75,7 +74,7 @@
IModel makeChoices = new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
Set keys = modelsMap.keySet();
List list = new ArrayList(keys);
@@ -86,7 +85,7 @@
IModel modelChoices = new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
List models = (List)modelsMap.get(selectedMake);
if (models == null)
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/Clock.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/Clock.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/Clock.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/Clock.java Mon Mar 19 09:34:16 2007
@@ -20,7 +20,6 @@
import java.util.Date;
import java.util.TimeZone;
-import wicket.Component;
import wicket.markup.html.basic.Label;
import wicket.model.AbstractReadOnlyModel;
@@ -65,9 +64,9 @@
}
/**
- * @see wicket.model.AbstractReadOnlyModel#getObject(wicket.Component)
+ * @see wicket.model.AbstractReadOnlyModel#getObject()
*/
- public Object getObject(Component component)
+ public Object getObject()
{
return df.format(new Date());
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/EditableLabelPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/EditableLabelPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/EditableLabelPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/EditableLabelPage.java Mon Mar 19 09:34:16 2007
@@ -19,7 +19,6 @@
import java.util.Arrays;
import java.util.List;
-import wicket.Component;
import wicket.extensions.ajax.markup.html.AjaxEditableChoiceLabel;
import wicket.extensions.ajax.markup.html.AjaxEditableLabel;
import wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel;
@@ -57,7 +56,7 @@
add(new Label("refresh-counter", new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return "" + refreshCounter;
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/FormPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/FormPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/FormPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/ajax/builtin/FormPage.java Mon Mar 19 09:34:16 2007
@@ -24,12 +24,12 @@
import wicket.markup.html.form.FormComponent;
import wicket.markup.html.form.RequiredTextField;
import wicket.markup.html.form.SimpleFormComponentLabel;
-import wicket.markup.html.form.validation.EmailAddressPatternValidator;
-import wicket.markup.html.form.validation.StringValidator;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.model.CompoundPropertyModel;
import wicket.model.ResourceModel;
import wicket.util.time.Duration;
+import wicket.validation.validator.EmailAddressPatternValidator;
+import wicket.validation.validator.StringValidator;
/**
* Page to demonstrate instant ajax validaion feedback. Validation is triggered
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/forminput/FormInput.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/forminput/FormInput.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/forminput/FormInput.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/forminput/FormInput.java Mon Mar 19 09:34:16 2007
@@ -37,7 +37,6 @@
import wicket.markup.html.form.RadioGroup;
import wicket.markup.html.form.RequiredTextField;
import wicket.markup.html.form.TextField;
-import wicket.markup.html.form.validation.NumberValidator;
import wicket.markup.html.link.Link;
import wicket.markup.html.list.ListItem;
import wicket.markup.html.list.ListView;
@@ -50,6 +49,7 @@
import wicket.util.convert.IConverter;
import wicket.util.convert.MaskConverter;
import wicket.util.convert.SimpleConverterAdapter;
+import wicket.validation.validator.NumberValidator;
/**
* Example for form input.
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/frames/BodyFrame.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/frames/BodyFrame.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/frames/BodyFrame.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/frames/BodyFrame.java Mon Mar 19 09:34:16 2007
@@ -19,7 +19,6 @@
import java.io.Serializable;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.PageMap;
import wicket.RequestCycle;
import wicket.markup.html.WebComponent;
@@ -40,9 +39,9 @@
private final class FrameModel extends Model
{
/**
- * @see wicket.model.Model#getObject(wicket.Component)
+ * @see wicket.model.Model#getObject()
*/
- public Object getObject(Component component)
+ public Object getObject()
{
return RequestCycle.get().urlFor(PageMap.forName(RIGHT_FRAME_NAME),
frameTarget.getFrameClass(), null);
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hellobrowser/HelloBrowser.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hellobrowser/HelloBrowser.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hellobrowser/HelloBrowser.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hellobrowser/HelloBrowser.java Mon Mar 19 09:34:16 2007
@@ -21,7 +21,6 @@
import java.util.Locale;
import java.util.TimeZone;
-import wicket.Component;
import wicket.examples.WicketExamplePage;
import wicket.markup.html.basic.Label;
import wicket.markup.html.basic.MultiLineLabel;
@@ -61,9 +60,9 @@
IModel clientTimeModel = new AbstractReadOnlyModel()
{
/**
- * @see wicket.model.AbstractReadOnlyModel#getObject(wicket.Component)
+ * @see wicket.model.AbstractReadOnlyModel#getObject()
*/
- public Object getObject(Component component)
+ public Object getObject()
{
TimeZone timeZone = properties.getTimeZone();
if (timeZone != null)
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/EditBook.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/EditBook.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/EditBook.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/EditBook.java Mon Mar 19 09:34:16 2007
@@ -30,12 +30,12 @@
import wicket.markup.html.form.RadioChoice;
import wicket.markup.html.form.TextField;
import wicket.markup.html.form.validation.FormComponentFeedbackBorder;
-import wicket.markup.html.form.validation.StringValidator;
import wicket.markup.html.link.IPageLink;
import wicket.markup.html.link.PageLink;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.model.CompoundPropertyModel;
import wicket.util.lang.EnumeratedType;
+import wicket.validation.validator.StringValidator;
/**
* A page that contains a form that allows editing of books.
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/DetachableContactModel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/DetachableContactModel.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/DetachableContactModel.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/DetachableContactModel.java Mon Mar 19 09:34:16 2007
@@ -16,9 +16,7 @@
*/
package wicket.examples.repeater;
-import wicket.Component;
-import wicket.model.AbstractReadOnlyDetachableModel;
-import wicket.model.IModel;
+import wicket.model.LoadableDetachableModel;
/**
* detachable model for an instance of contact
@@ -26,7 +24,7 @@
* @author igor
*
*/
-public class DetachableContactModel extends AbstractReadOnlyDetachableModel
+public class DetachableContactModel extends LoadableDetachableModel
{
private long id;
private transient Contact contact;
@@ -58,32 +56,6 @@
}
/**
- * @see wicket.model.AbstractDetachableModel#getNestedModel()
- */
- public IModel getNestedModel()
- {
- return null;
- }
-
- protected void onAttach()
- {
- if (contact == null)
- {
- contact = getContactsDB().get(id);
- }
- }
-
- protected void onDetach()
- {
- contact = null;
- }
-
- protected Object onGetObject(Component component)
- {
- return contact;
- }
-
- /**
* @see java.lang.Object#hashCode()
*/
public int hashCode()
@@ -94,15 +66,33 @@
/**
* used for dataview with ReuseIfModelsEqualStrategy item reuse strategy
*
+ * @see wicket.markup.repeater.ReuseIfModelsEqualStrategy
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj)
+ public boolean equals(final Object obj)
{
- if (obj instanceof DetachableContactModel)
+ if (obj == this)
+ {
+ return true;
+ }
+ else if (obj == null)
+ {
+ return false;
+ }
+ else if (obj instanceof DetachableContactModel)
{
DetachableContactModel other = (DetachableContactModel)obj;
return other.id == this.id;
}
return false;
+ }
+
+ /**
+ * @see wicket.model.LoadableDetachableModel#load()
+ */
+ protected Object load()
+ {
+ // loads contact from the database
+ return getContactsDB().get(id);
}
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/OIRPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/OIRPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/OIRPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/OIRPage.java Mon Mar 19 09:34:16 2007
@@ -97,7 +97,7 @@
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/PagingPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/PagingPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/PagingPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/PagingPage.java Mon Mar 19 09:34:16 2007
@@ -17,7 +17,6 @@
package wicket.examples.repeater;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.markup.html.basic.Label;
import wicket.markup.html.navigation.paging.PagingNavigator;
import wicket.markup.repeater.Item;
@@ -53,7 +52,7 @@
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RefreshingPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RefreshingPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RefreshingPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RefreshingPage.java Mon Mar 19 09:34:16 2007
@@ -21,7 +21,6 @@
import java.util.List;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.markup.html.basic.Label;
import wicket.markup.html.link.Link;
import wicket.markup.repeater.Item;
@@ -76,7 +75,7 @@
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RepeatingPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RepeatingPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RepeatingPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/RepeatingPage.java Mon Mar 19 09:34:16 2007
@@ -19,7 +19,6 @@
import java.util.Iterator;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.markup.html.WebMarkupContainer;
import wicket.markup.html.basic.Label;
import wicket.markup.repeater.RepeatingView;
@@ -59,7 +58,7 @@
final int idx = index;
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (idx % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SimplePage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SimplePage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SimplePage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SimplePage.java Mon Mar 19 09:34:16 2007
@@ -17,7 +17,6 @@
package wicket.examples.repeater;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.markup.html.basic.Label;
import wicket.markup.repeater.Item;
import wicket.markup.repeater.data.DataView;
@@ -49,7 +48,7 @@
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SortingPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SortingPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SortingPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/repeater/SortingPage.java Mon Mar 19 09:34:16 2007
@@ -17,7 +17,6 @@
package wicket.examples.repeater;
import wicket.AttributeModifier;
-import wicket.Component;
import wicket.extensions.markup.html.repeater.data.sort.OrderByBorder;
import wicket.markup.html.basic.Label;
import wicket.markup.html.navigation.paging.PagingNavigator;
@@ -53,7 +52,7 @@
item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel()
{
- public Object getObject(Component component)
+ public Object getObject()
{
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/source/SourcesPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/source/SourcesPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/source/SourcesPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/source/SourcesPage.java Mon Mar 19 09:34:16 2007
@@ -78,11 +78,9 @@
/**
* Returns the contents of the file loaded from the classpath.
*
- * @param component
- * ignored
* @return the contents of the file identified by name
*/
- public Object getObject(Component component)
+ public Object getObject()
{
// name contains the name of the selected file
if (Strings.isEmpty(name))
@@ -147,11 +145,9 @@
/**
* Returns the list of resources found in the package of the page.
*
- * @param component
- * ignored.
* @return the list of resources found in the package of the page.
*/
- public Object getObject(Component component)
+ public Object getObject()
{
if (resources.isEmpty())
{
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stateless/SessionModel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stateless/SessionModel.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stateless/SessionModel.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stateless/SessionModel.java Mon Mar 19 09:34:16 2007
@@ -17,7 +17,6 @@
package wicket.examples.stateless;
import wicket.Application;
-import wicket.Component;
import wicket.RequestCycle;
import wicket.model.AbstractReadOnlyModel;
@@ -30,9 +29,9 @@
public class SessionModel extends AbstractReadOnlyModel
{
/**
- * @see wicket.model.AbstractReadOnlyModel#getObject(Component)
+ * @see wicket.model.AbstractReadOnlyModel#getObject()
*/
- public Object getObject(Component object)
+ public Object getObject()
{
final String msg;
String sessionId = Application.get().getSessionStore().getSessionId(
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stockquote/StockQuoteLabel2.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stockquote/StockQuoteLabel2.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stockquote/StockQuoteLabel2.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/stockquote/StockQuoteLabel2.java Mon Mar 19 09:34:16 2007
@@ -16,7 +16,6 @@
*/
package wicket.examples.stockquote;
-import wicket.Component;
import wicket.markup.html.basic.Label;
import wicket.model.AbstractReadOnlyModel;
@@ -45,7 +44,7 @@
/**
* Gets the stockquote for the given symbol.
*/
- public Object getObject(Component component)
+ public Object getObject()
{
final StockQuote quote = new StockQuote(symbol);
return quote.getQuote();
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/unicodeconverter/UnicodeConverter.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/unicodeconverter/UnicodeConverter.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/unicodeconverter/UnicodeConverter.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/unicodeconverter/UnicodeConverter.java Mon Mar 19 09:34:16 2007
@@ -24,9 +24,8 @@
import wicket.markup.html.form.DropDownChoice;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.TextArea;
-import wicket.model.AbstractModel;
import wicket.model.CompoundPropertyModel;
-import wicket.model.IModel;
+import wicket.model.Model;
import wicket.util.string.Strings;
/**
@@ -61,12 +60,12 @@
* {@link Component#getModelObject()} on the component that holds it, and we
* would have a recent value.
*/
- private final class ConverterModel extends AbstractModel
+ private final class ConverterModel extends Model
{
/**
- * @see wicket.model.IModel#getObject(wicket.Component)
+ * @see wicket.model.IModel#getObject()
*/
- public Object getObject(Component component)
+ public Object getObject()
{
String result;
if (TO_ESCAPED_UNICODE.equals(translationType))
@@ -81,25 +80,15 @@
}
/**
- * @see wicket.model.IModel#setObject(wicket.Component,
- * java.lang.Object)
+ * @see wicket.model.IModel#setObject(java.lang.Object)
*/
- public void setObject(Component component, Object object)
+ public void setObject(Object object)
{
// Ignore. We are not interested in updating any value,
// and we don't want to throw an exception like
// AbstractReadOnlyModel either. Alternatively, we
// could have overriden updateModel of FormInputComponent
// and ignore any input there.
- }
-
- /**
- * @see wicket.model.IModel#getNestedModel()
- */
- public IModel getNestedModel()
- {
- // Return null as we never have to operate as part of a nested model
- return null;
}
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/upload/MultiUploadPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/upload/MultiUploadPage.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/upload/MultiUploadPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/upload/MultiUploadPage.java Mon Mar 19 09:34:16 2007
@@ -28,11 +28,9 @@
import wicket.Application;
import wicket.PageParameters;
import wicket.examples.WicketExamplePage;
-import wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar;
import wicket.markup.html.basic.Label;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.upload.FileUpload;
-import wicket.markup.html.form.upload.FileUploadField;
import wicket.markup.html.form.upload.MultiFileUploadField;
import wicket.markup.html.link.Link;
import wicket.markup.html.list.ListItem;
@@ -96,6 +94,10 @@
// collection that will hold uploaded FileUpload objects
private final Collection uploads = new ArrayList();
+ /**
+ * TODO
+ * @return Collection
+ */
public Collection getUploads()
{
return uploads;
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/wizard/NewUserWizard.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/wizard/NewUserWizard.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/wizard/NewUserWizard.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/wizard/NewUserWizard.java Mon Mar 19 09:34:16 2007
@@ -17,7 +17,6 @@
package wicket.examples.wizard;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import wicket.extensions.wizard.StaticContentStep;
@@ -32,12 +31,14 @@
import wicket.markup.html.form.RequiredTextField;
import wicket.markup.html.form.TextField;
import wicket.markup.html.form.validation.AbstractFormValidator;
-import wicket.markup.html.form.validation.EmailAddressPatternValidator;
import wicket.model.CompoundPropertyModel;
import wicket.model.IModel;
import wicket.model.Model;
import wicket.model.ResourceModel;
import wicket.model.StringResourceModel;
+import wicket.validation.IValidationError;
+import wicket.validation.ValidationError;
+import wicket.validation.validator.EmailAddressPatternValidator;
/**
* This wizard shows some basic form use. It uses custom panels for the form
@@ -136,8 +137,8 @@
{
if ("".equals(rolesSetNameField.getInput()))
{
- rolesSetNameField.error(Collections
- .singletonList("error.noSetNameForRoles"), null);
+ rolesSetNameField.error((IValidationError)new ValidationError()
+ .addMessageKey("error.noSetNameForRoles"));
}
}
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/spring/common/web/ContactDetachableModel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/spring/common/web/ContactDetachableModel.java?view=diff&rev=520005&r1=520004&r2=520005
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/spring/common/web/ContactDetachableModel.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/spring/common/web/ContactDetachableModel.java Mon Mar 19 09:34:16 2007
@@ -16,9 +16,7 @@
*/
package wicket.spring.common.web;
-import wicket.Component;
-import wicket.model.AbstractDetachableModel;
-import wicket.model.IModel;
+import wicket.model.LoadableDetachableModel;
import wicket.spring.common.Contact;
import wicket.spring.common.ContactDao;
@@ -30,37 +28,25 @@
* @author Igor Vaynberg (ivaynberg)
*
*/
-public abstract class ContactDetachableModel extends AbstractDetachableModel {
+public abstract class ContactDetachableModel extends LoadableDetachableModel
+{
private long id;
- private transient Contact contact;
-
- public ContactDetachableModel(Contact contact) {
+ /**
+ * @param contact
+ */
+ public ContactDetachableModel(Contact contact)
+ {
+ super(contact);
this.id = contact.getId();
- this.contact = contact;
- }
-
- public IModel getNestedModel() {
- return null;
- }
-
- protected final void onAttach() {
- contact = getContactDao().get(id);
- }
-
- protected void onDetach() {
- contact = null;
- }
-
- protected Object onGetObject(Component component) {
- return contact;
- }
-
- protected void onSetObject(Component component, Object object) {
- throw new UnsupportedOperationException();
}
protected abstract ContactDao getContactDao();
+ @Override
+ protected Contact load()
+ {
+ return getContactDao().get(id);
+ }
}