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 2008/04/08 20:10:43 UTC
svn commit: r646020 [3/5] - in /wicket/trunk/jdk-1.4:
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/
wicket-extensions/src/main/...
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebComponent.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebComponent.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebComponent.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebComponent.java Tue Apr 8 11:10:20 2008
@@ -30,8 +30,11 @@
* @author Jonathan Locke
* @author Juergen Donnerstag
* @author Eelco Hillenius
+ *
+ * @param <T>
+ * The model object type
*/
-public class WebComponent extends Component
+public class WebComponent<T> extends Component<T>
{
private static final long serialVersionUID = 1L;
@@ -46,7 +49,7 @@
/**
* @see Component#Component(String, IModel)
*/
- public WebComponent(final String id, final IModel model)
+ public WebComponent(final String id, final IModel<T> model)
{
super(id, model);
}
@@ -55,6 +58,7 @@
*
* @see org.apache.wicket.Component#onRender(org.apache.wicket.markup.MarkupStream)
*/
+ @Override
protected void onRender(final MarkupStream markupStream)
{
renderComponent(markupStream);
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainer.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainer.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainer.java Tue Apr 8 11:10:20 2008
@@ -26,8 +26,11 @@
*
* @author Jonathan Locke
* @author Juergen Donnerstag
+ *
+ * @param <T>
+ * The model object type
*/
-public class WebMarkupContainer extends MarkupContainer
+public class WebMarkupContainer<T> extends MarkupContainer<T>
{
private static final long serialVersionUID = 1L;
@@ -52,9 +55,10 @@
*
* @return Markup type of HTML
*/
+ @Override
public String getMarkupType()
{
- return getPage().getMarkupType();
+ return getPage().getMarkupType();
}
/**
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainerWithAssociatedMarkup.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainerWithAssociatedMarkup.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainerWithAssociatedMarkup.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/WebMarkupContainerWithAssociatedMarkup.java Tue Apr 8 11:10:20 2008
@@ -24,10 +24,13 @@
* WebMarkupContainer with it's own markup and possibly <wicket:head> tag.
*
* @author Juergen Donnerstag
+ *
+ * @param <T>
+ * The model object type
*/
-public class WebMarkupContainerWithAssociatedMarkup extends WebMarkupContainer
- implements
- IHeaderPartContainerProvider
+public class WebMarkupContainerWithAssociatedMarkup<T> extends WebMarkupContainer<T>
+ implements
+ IHeaderPartContainerProvider
{
private static final long serialVersionUID = 1L;
@@ -45,7 +48,7 @@
/**
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public WebMarkupContainerWithAssociatedMarkup(final String id, IModel model)
+ public WebMarkupContainerWithAssociatedMarkup(final String id, IModel<T> model)
{
super(id, model);
}
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/Label.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/Label.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/Label.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/Label.java Tue Apr 8 11:10:20 2008
@@ -64,7 +64,7 @@
*
* @author Jonathan Locke
*/
-public class Label extends WebComponent
+public class Label<T> extends WebComponent<T>
{
private static final long serialVersionUID = 1L;
@@ -97,7 +97,7 @@
/**
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public Label(final String id, IModel model)
+ public Label(final String id, IModel<T> model)
{
super(id, model);
}
@@ -106,6 +106,7 @@
* @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
* org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
replaceComponentTagBody(markupStream, openTag, getModelObjectAsString());
@@ -114,6 +115,7 @@
/**
* @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/MultiLineLabel.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/MultiLineLabel.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/MultiLineLabel.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/basic/MultiLineLabel.java Tue Apr 8 11:10:20 2008
@@ -31,8 +31,11 @@
* for sequences of more than one newline.
*
* @author Jonathan Locke
+ *
+ * @param <T>
+ * Model object type
*/
-public class MultiLineLabel extends WebComponent
+public class MultiLineLabel<T> extends WebComponent<T>
{
private static final long serialVersionUID = 1L;
@@ -66,7 +69,7 @@
/**
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public MultiLineLabel(final String id, IModel model)
+ public MultiLineLabel(final String id, IModel<T> model)
{
super(id, model);
}
@@ -74,6 +77,7 @@
/**
* @see org.apache.wicket.Component#onComponentTagBody(MarkupStream, ComponentTag)
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
final CharSequence body = Strings.toMultilineMarkup(getModelObjectAsString());
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/border/Border.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/border/Border.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/border/Border.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/border/Border.java Tue Apr 8 11:10:20 2008
@@ -103,8 +103,11 @@
*
* @author Jonathan Locke
* @author Juergen Donnerstag
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class Border extends WebMarkupContainerWithAssociatedMarkup
+public abstract class Border<T> extends WebMarkupContainerWithAssociatedMarkup<T>
implements
IComponentResolver
{
@@ -155,7 +158,7 @@
/**
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public Border(final String id, final IModel model)
+ public Border(final String id, final IModel<T> model)
{
super(id, model);
@@ -185,7 +188,8 @@
* @return this for chaining
* @deprecated 1.3 please use #getBodyContainer().setVisible(false) instead
*/
- public Border setBorderBodyVisible(boolean bodyVisible)
+ @Deprecated
+ public Border<T> setBorderBodyVisible(boolean bodyVisible)
{
body.setVisible(false);
return this;
@@ -200,7 +204,7 @@
* true, to enable transparent resolving
* @return this for chaining
*/
- public final Border setTransparentResolver(final boolean enable)
+ public final Border<T> setTransparentResolver(final boolean enable)
{
transparentResolver = enable;
return this;
@@ -210,6 +214,7 @@
* @see #setTransparentResolver(boolean)
* @see org.apache.wicket.MarkupContainer#isTransparentResolver()
*/
+ @Override
public boolean isTransparentResolver()
{
return transparentResolver;
@@ -265,6 +270,7 @@
/**
* @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
if (tag.isOpen() == false)
@@ -280,6 +286,7 @@
* @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
* org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected final void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
@@ -304,6 +311,7 @@
/**
* @see org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
*/
+ @Override
public void renderHead(HtmlHeaderContainer container)
{
renderHeadFromAssociatedMarkupFile(container);
@@ -333,6 +341,7 @@
/**
* @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
// Convert open-close to open-body-close
@@ -350,6 +359,7 @@
* @see org.apache.wicket.MarkupContainer#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
* org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java Tue Apr 8 11:10:20 2008
@@ -35,8 +35,14 @@
* @author Jonathan Locke
* @author Eelco Hillenius
* @author Johan Compagner
+ *
+ * @param <T>
+ * The model object type
+ *
+ * @param <E>
+ * class of a single element in the choices list
*/
-abstract class AbstractChoice extends FormComponent
+abstract class AbstractChoice<T, E> extends FormComponent<T>
{
/**
*
@@ -44,10 +50,10 @@
private static final long serialVersionUID = 1L;
/** The list of objects. */
- private IModel choices;
+ private IModel<List<E>> choices;
/** The renderer used to generate display/id values for the objects. */
- private IChoiceRenderer renderer;
+ private IChoiceRenderer<E> renderer;
/**
* Constructor.
@@ -70,7 +76,7 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String)
*/
- public AbstractChoice(final String id, final List choices)
+ public AbstractChoice(final String id, final List<E> choices)
{
this(id, new Model((Serializable)choices), new ChoiceRenderer());
}
@@ -86,7 +92,7 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String)
*/
- public AbstractChoice(final String id, final List choices, final IChoiceRenderer renderer)
+ public AbstractChoice(final String id, final List<E> choices, final IChoiceRenderer<E> renderer)
{
this(id, new Model((Serializable)choices), renderer);
}
@@ -102,7 +108,7 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public AbstractChoice(final String id, IModel model, final List choices)
+ public AbstractChoice(final String id, IModel<T> model, final List<E> choices)
{
this(id, model, new Model((Serializable)choices), new ChoiceRenderer());
}
@@ -120,8 +126,8 @@
* The rendering engine
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public AbstractChoice(final String id, IModel model, final List choices,
- final IChoiceRenderer renderer)
+ public AbstractChoice(final String id, IModel<T> model, final List<E> choices,
+ final IChoiceRenderer<E> renderer)
{
this(id, model, new Model((Serializable)choices), renderer);
}
@@ -135,7 +141,7 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String)
*/
- public AbstractChoice(final String id, final IModel choices)
+ public AbstractChoice(final String id, final IModel<List<E>> choices)
{
this(id, choices, new ChoiceRenderer());
}
@@ -151,7 +157,8 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String)
*/
- public AbstractChoice(final String id, final IModel choices, final IChoiceRenderer renderer)
+ public AbstractChoice(final String id, final IModel<List<E>> choices,
+ final IChoiceRenderer<E> renderer)
{
super(id);
this.choices = wrap(choices);
@@ -169,7 +176,7 @@
* The collection of choices in the dropdown
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public AbstractChoice(final String id, IModel model, final IModel choices)
+ public AbstractChoice(final String id, IModel<T> model, final IModel<List<E>> choices)
{
this(id, model, choices, new ChoiceRenderer());
}
@@ -187,8 +194,8 @@
* The drop down choices
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public AbstractChoice(final String id, IModel model, final IModel choices,
- final IChoiceRenderer renderer)
+ public AbstractChoice(final String id, IModel<T> model, final IModel<List<E>> choices,
+ final IChoiceRenderer<E> renderer)
{
super(id, model);
this.choices = wrap(choices);
@@ -199,9 +206,9 @@
/**
* @return The collection of object that this choice has
*/
- public List getChoices()
+ public List<E> getChoices()
{
- List choices = (this.choices != null) ? (List)this.choices.getObject() : null;
+ List<E> choices = (this.choices != null) ? (List<E>)this.choices.getObject() : null;
if (choices == null)
{
throw new NullPointerException(
@@ -218,7 +225,7 @@
* model representing the list of choices
* @return this for chaining
*/
- public final AbstractChoice setChoices(IModel choices)
+ public final AbstractChoice<T, E> setChoices(IModel<List<E>> choices)
{
if (this.choices != null && this.choices != choices)
{
@@ -238,7 +245,7 @@
* the list of choices
* @return this for chaining
*/
- public final AbstractChoice setChoices(List choices)
+ public final AbstractChoice<T, E> setChoices(List<T> choices)
{
if ((this.choices != null))
{
@@ -254,7 +261,7 @@
/**
* @return The IChoiceRenderer used for rendering the data objects
*/
- public final IChoiceRenderer getChoiceRenderer()
+ public final IChoiceRenderer<E> getChoiceRenderer()
{
return renderer;
}
@@ -265,7 +272,7 @@
* @param renderer
* @return this for chaining
*/
- public final AbstractChoice setChoiceRenderer(IChoiceRenderer renderer)
+ public final AbstractChoice<T, E> setChoiceRenderer(IChoiceRenderer<E> renderer)
{
if (renderer == null)
{
@@ -278,6 +285,7 @@
/**
* @see org.apache.wicket.Component#detachModel()
*/
+ @Override
protected void detachModel()
{
super.detachModel();
@@ -310,7 +318,7 @@
* The currently selected string value
* @return Whether the given value represents the current selection
*/
- protected abstract boolean isSelected(final Object object, int index, String selected);
+ protected abstract boolean isSelected(final E object, int index, String selected);
/**
* Gets whether the given value is disabled. This default implementation always returns false.
@@ -323,7 +331,7 @@
* The currently selected string value
* @return Whether the given value represents the current selection
*/
- protected boolean isDisabled(final Object object, int index, String selected)
+ protected boolean isDisabled(final E object, int index, String selected)
{
return false;
}
@@ -337,9 +345,10 @@
* The open tag for the body
* @see org.apache.wicket.Component#onComponentTagBody(MarkupStream, ComponentTag)
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
- List choices = getChoices();
+ List<E> choices = getChoices();
final AppendingStringBuffer buffer = new AppendingStringBuffer((choices.size() * 50) + 16);
final String selected = getValue();
@@ -348,7 +357,7 @@
for (int index = 0; index < choices.size(); index++)
{
- final Object choice = choices.get(index);
+ final E choice = choices.get(index);
appendOptionHtml(buffer, choice, index, selected);
}
@@ -368,7 +377,7 @@
* @param selected
* The currently selected string value
*/
- protected void appendOptionHtml(AppendingStringBuffer buffer, Object choice, int index,
+ protected void appendOptionHtml(AppendingStringBuffer buffer, E choice, int index,
String selected)
{
Object objectValue = renderer.getDisplayValue(choice);
@@ -423,6 +432,7 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#supportsPersistence()
*/
+ @Override
protected boolean supportsPersistence()
{
return true;
@@ -462,6 +472,7 @@
/**
* @see org.apache.wicket.version.undo.Change#undo()
*/
+ @Override
public void undo()
{
choices = oldChoices;
@@ -472,6 +483,7 @@
*
* @see java.lang.Object#toString()
*/
+ @Override
public String toString()
{
return "ChoiceListChange[component: " + getPath() + ", old choices: " + oldChoices +
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java Tue Apr 8 11:10:20 2008
@@ -29,8 +29,11 @@
* @author Jonathan Locke
* @author Eelco Hillenius
* @author Johan Compagner
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class AbstractSingleSelectChoice extends AbstractChoice
+public abstract class AbstractSingleSelectChoice<T> extends AbstractChoice<T, T>
{
/**
*
@@ -58,7 +61,7 @@
/**
* @see AbstractChoice#AbstractChoice(String, List)
*/
- public AbstractSingleSelectChoice(final String id, final List choices)
+ public AbstractSingleSelectChoice(final String id, final List<T> choices)
{
super(id, choices);
}
@@ -69,8 +72,8 @@
* @param renderer
* @see AbstractChoice#AbstractChoice(String, List ,IChoiceRenderer)
*/
- public AbstractSingleSelectChoice(final String id, final List data,
- final IChoiceRenderer renderer)
+ public AbstractSingleSelectChoice(final String id, final List<T> data,
+ final IChoiceRenderer<T> renderer)
{
super(id, data, renderer);
}
@@ -78,7 +81,7 @@
/**
* @see AbstractChoice#AbstractChoice(String, IModel, List)
*/
- public AbstractSingleSelectChoice(final String id, IModel model, final List data)
+ public AbstractSingleSelectChoice(final String id, IModel<T> model, final List<T> data)
{
super(id, model, data);
}
@@ -90,8 +93,8 @@
* @param renderer
* @see AbstractChoice#AbstractChoice(String, IModel, List, IChoiceRenderer)
*/
- public AbstractSingleSelectChoice(final String id, IModel model, final List data,
- final IChoiceRenderer renderer)
+ public AbstractSingleSelectChoice(final String id, IModel<T> model, final List<T> data,
+ final IChoiceRenderer<T> renderer)
{
super(id, model, data, renderer);
}
@@ -99,7 +102,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel)
*/
- public AbstractSingleSelectChoice(String id, IModel choices)
+ public AbstractSingleSelectChoice(String id, IModel<List<T>> choices)
{
super(id, choices);
}
@@ -107,7 +110,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,IModel)
*/
- public AbstractSingleSelectChoice(String id, IModel model, IModel choices)
+ public AbstractSingleSelectChoice(String id, IModel<T> model, IModel<List<T>> choices)
{
super(id, model, choices);
}
@@ -116,7 +119,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
* IModel,IChoiceRenderer)
*/
- public AbstractSingleSelectChoice(String id, IModel choices, IChoiceRenderer renderer)
+ public AbstractSingleSelectChoice(String id, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer)
{
super(id, choices, renderer);
}
@@ -126,8 +130,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
* IModel,IChoiceRenderer)
*/
- public AbstractSingleSelectChoice(String id, IModel model, IModel choices,
- IChoiceRenderer renderer)
+ public AbstractSingleSelectChoice(String id, IModel<T> model, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer)
{
super(id, model, choices, renderer);
}
@@ -135,9 +139,10 @@
/**
* @see FormComponent#getModelValue()
*/
+ @Override
public String getModelValue()
{
- final Object object = getModelObject();
+ final T object = getModelObject();
if (object != null)
{
int index = getChoices().indexOf(object);
@@ -169,7 +174,7 @@
* whether null is a valid value
* @return this for chaining
*/
- public AbstractSingleSelectChoice setNullValid(boolean nullValid)
+ public AbstractSingleSelectChoice<T> setNullValid(boolean nullValid)
{
this.nullValid = nullValid;
return this;
@@ -178,7 +183,8 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#convertValue(String[])
*/
- protected final Object convertValue(final String[] value)
+ @Override
+ protected final T convertValue(final String[] value)
{
String tmp = value != null && value.length > 0 ? value[0] : null;
return convertChoiceIdToChoice(tmp);
@@ -191,14 +197,14 @@
* string id of one of the choice objects in the choices list. can be null.
* @return choice object. null if none match the specified id.
*/
- protected Object convertChoiceIdToChoice(String id)
+ protected T convertChoiceIdToChoice(String id)
{
- final List choices = getChoices();
- final IChoiceRenderer renderer = getChoiceRenderer();
+ final List<T> choices = getChoices();
+ final IChoiceRenderer<T> renderer = getChoiceRenderer();
for (int index = 0; index < choices.size(); index++)
{
// Get next choice
- final Object choice = choices.get(index);
+ final T choice = choices.get(index);
if (renderer.getIdValue(choice, index).equals(id))
{
return choice;
@@ -221,6 +227,7 @@
*
* @see org.apache.wicket.markup.html.form.AbstractChoice#getDefaultChoice(Object)
*/
+ @Override
protected CharSequence getDefaultChoice(final Object selected)
{
// Is null a valid selection value?
@@ -283,7 +290,8 @@
* The current selected id value
* @return Whether the given value represents the current selection
*/
- protected boolean isSelected(final Object object, int index, String selected)
+ @Override
+ protected boolean isSelected(final T object, int index, String selected)
{
return selected != null && selected.equals(getChoiceRenderer().getIdValue(object, index));
}
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java Tue Apr 8 11:10:20 2008
@@ -27,8 +27,13 @@
* Abstract class for links that are capable of submitting a form.
*
* @author Matej Knopp
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class AbstractSubmitLink extends AbstractLink implements IFormSubmittingComponent
+public abstract class AbstractSubmitLink<T> extends AbstractLink<T>
+ implements
+ IFormSubmittingComponent
{
/**
*
@@ -51,7 +56,7 @@
* @param id
* @param model
*/
- public AbstractSubmitLink(String id, IModel model)
+ public AbstractSubmitLink(String id, IModel<T> model)
{
super(id, model);
}
@@ -74,7 +79,7 @@
* @param model
* @param form
*/
- public AbstractSubmitLink(String id, IModel model, Form form)
+ public AbstractSubmitLink(String id, IModel<T> model, Form form)
{
super(id, model);
this.form = form;
@@ -104,7 +109,7 @@
* defaultFormProcessing
* @return This
*/
- public final AbstractSubmitLink setDefaultFormProcessing(boolean defaultFormProcessing)
+ public final AbstractSubmitLink<T> setDefaultFormProcessing(boolean defaultFormProcessing)
{
if (this.defaultFormProcessing != defaultFormProcessing)
{
@@ -114,11 +119,13 @@
boolean formerValue = AbstractSubmitLink.this.defaultFormProcessing;
+ @Override
public void undo()
{
AbstractSubmitLink.this.defaultFormProcessing = formerValue;
}
+ @Override
public String toString()
{
return "DefaultFormProcessingChange[component: " + getPath() +
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java Tue Apr 8 11:10:20 2008
@@ -31,8 +31,11 @@
* Abstract base class for TextArea and TextField.
*
* @author Jonathan Locke
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class AbstractTextComponent extends FormComponent
+public abstract class AbstractTextComponent<T> extends FormComponent<T>
{
// Flag for the type resolving. FLAG_RESERVED1-3 is taken by form component
private static final int TYPE_RESOLVED = Component.FLAG_RESERVED4;
@@ -99,11 +102,13 @@
*
* @see org.apache.wicket.markup.html.form.FormComponent#isInputNullable()
*/
+ @Override
public boolean isInputNullable()
{
return false;
}
+ @Override
protected void convertInput()
{
// Stateless forms don't have to be rendered first, convertInput could be called before
@@ -117,6 +122,7 @@
*
* @see org.apache.wicket.Component#onBeforeRender()
*/
+ @Override
protected void onBeforeRender()
{
super.onBeforeRender();
@@ -172,7 +178,8 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#convertValue(String[])
*/
- protected Object convertValue(String[] value) throws ConversionException
+ @Override
+ protected T convertValue(String[] value) throws ConversionException
{
String tmp = value != null && value.length > 0 ? value[0] : null;
if (getConvertEmptyInputStringToNull() && Strings.isEmpty(tmp))
@@ -185,6 +192,7 @@
/**
* @see FormComponent#supportsPersistence()
*/
+ @Override
protected boolean supportsPersistence()
{
return true;
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java Tue Apr 8 11:10:20 2008
@@ -48,8 +48,11 @@
*
* @author Jonathan Locke
* @author Eelco Hillenius
+ *
+ * @param <T>
+ * The model object type
*/
-public class Button extends FormComponent implements IFormSubmittingComponent
+public class Button<T> extends FormComponent<T> implements IFormSubmittingComponent
{
private static final long serialVersionUID = 1L;
@@ -84,7 +87,7 @@
* keep it's markup attribute value, don't provide a model, or let it return an empty
* string.
*/
- public Button(final String id, final IModel model)
+ public Button(final String id, final IModel<T> model)
{
super(id, model);
setVersioned(true);
@@ -97,6 +100,7 @@
*
* @see org.apache.wicket.Component#initModel()
*/
+ @Override
protected IModel initModel()
{
return null;
@@ -148,11 +152,13 @@
boolean formerValue = Button.this.defaultFormProcessing;
+ @Override
public void undo()
{
Button.this.defaultFormProcessing = formerValue;
}
+ @Override
public String toString()
{
return "DefaultFormProcessingChange[component: " + getPath() +
@@ -171,6 +177,7 @@
*
* @see org.apache.wicket.markup.html.form.FormComponent#updateModel()
*/
+ @Override
public void updateModel()
{
}
@@ -200,6 +207,7 @@
* Tag to modify
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
// Default handling for component tag
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Check.java Tue Apr 8 11:10:20 2008
@@ -37,8 +37,10 @@
*
* @author Igor Vaynberg
*
+ * @param <T>
+ * The model object type
*/
-public class Check extends LabeledWebMarkupContainer
+public class Check<T> extends LabeledWebMarkupContainer<T>
{
private static final long serialVersionUID = 1L;
@@ -61,7 +63,7 @@
/**
* @see WebMarkupContainer#WebMarkupContainer(String, IModel)
*/
- public Check(String id, IModel model)
+ public Check(String id, IModel<T> model)
{
super(id, model);
}
@@ -88,6 +90,7 @@
* @param tag
* the abstraction representing html tag of this component
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
// Default handling for component tag
@@ -97,11 +100,11 @@
checkComponentTag(tag, "input");
checkComponentTagAttribute(tag, "type", "checkbox");
- CheckGroup group = (CheckGroup)findParent(CheckGroup.class);
+ CheckGroup<T> group = (CheckGroup)findParent(CheckGroup.class);
if (group == null)
{
throw new WicketRuntimeException("Check component [" + getPath() +
- "] cannot find its parent CheckGroup");
+ "] cannot find its parent CheckGroup");
}
final String uuid = getValue();
@@ -112,13 +115,13 @@
// check if the model collection of the group contains the model object.
// if it does check the check box.
- Collection collection = (Collection)group.getModelObject();
+ Collection<T> collection = group.getModelObject();
// check for npe in group's model object
if (collection == null)
{
throw new WicketRuntimeException("CheckGroup [" + group.getPath() +
- "] contains a null model object, must be an object of type java.util.Collection");
+ "] contains a null model object, must be an object of type java.util.Collection");
}
if (group.hasRawInput())
@@ -166,8 +169,8 @@
// NOTE: do not encode the url as that would give invalid
// JavaScript
tag.put("onclick", "window.location.href='" + url +
- (url.toString().indexOf('?') > -1 ? "&" : "?") + group.getInputName() +
- "=' + this.value;");
+ (url.toString().indexOf('?') > -1 ? "&" : "?") + group.getInputName() +
+ "=' + this.value;");
}
}
@@ -186,7 +189,7 @@
* @param labelModel
* @return this for chaining
*/
- public Check setLabel(IModel labelModel)
+ public Check<T> setLabel(IModel labelModel)
{
setLabelInternal(labelModel);
return this;
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java Tue Apr 8 11:10:20 2008
@@ -49,8 +49,11 @@
* </p>
*
* @author Jonathan Locke
+ *
+ * @param <T>
+ * The model object type
*/
-public class CheckBox extends FormComponent implements IOnChangeListener
+public class CheckBox extends FormComponent<Boolean> implements IOnChangeListener
{
private static final long serialVersionUID = 1L;
@@ -65,7 +68,7 @@
/**
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public CheckBox(final String id, IModel model)
+ public CheckBox(final String id, IModel<Boolean> model)
{
super(id, model);
}
@@ -112,6 +115,7 @@
/**
* @see org.apache.wicket.MarkupContainer#getStatelessHint()
*/
+ @Override
protected boolean getStatelessHint()
{
if (wantOnSelectionChangedNotifications())
@@ -127,6 +131,7 @@
*
* @see org.apache.wicket.Component#getConverter(java.lang.Class)
*/
+ @Override
public IConverter getConverter(Class type)
{
return BooleanConverter.INSTANCE;
@@ -139,6 +144,7 @@
* Tag to modify
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
checkComponentTag(tag, "input");
@@ -203,6 +209,7 @@
/**
* @see FormComponent#supportsPersistence()
*/
+ @Override
protected final boolean supportsPersistence()
{
return true;
@@ -212,7 +219,8 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#convertValue(String[])
*/
- protected Object convertValue(String[] value)
+ @Override
+ protected Boolean convertValue(String[] value)
{
String tmp = value != null && value.length > 0 ? value[0] : null;
try
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java Tue Apr 8 11:10:20 2008
@@ -16,6 +16,7 @@
*/
package org.apache.wicket.markup.html.form;
+import java.util.Collection;
import java.util.List;
import org.apache.wicket.Page;
@@ -55,8 +56,11 @@
* @author Martijn Dashorst
* @author Gwyn Evans
* @author Igor Vaynberg (ivaynberg)
+ *
+ * @param <T>
+ * The model object type
*/
-public class CheckBoxMultipleChoice extends ListMultipleChoice
+public class CheckBoxMultipleChoice<T> extends ListMultipleChoice<T>
{
private static final long serialVersionUID = 1L;
@@ -75,6 +79,7 @@
/**
* @see org.apache.wicket.version.undo.Change#undo()
*/
+ @Override
public void undo()
{
setSuffix(prevSuffix);
@@ -83,6 +88,7 @@
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString()
{
return "SuffixChange[component: " + getPath() + ", suffix: " + prevSuffix + "]";
@@ -111,6 +117,7 @@
/**
* @see org.apache.wicket.version.undo.Change#undo()
*/
+ @Override
public void undo()
{
setPrefix(prevPrefix);
@@ -119,6 +126,7 @@
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString()
{
return "PrefixChange[component: " + getPath() + ", prefix: " + prevPrefix + "]";
@@ -151,7 +159,7 @@
* @see org.apache.wicket.Component#Component(String)
* @see AbstractChoice#AbstractChoice(String, java.util.List)
*/
- public CheckBoxMultipleChoice(final String id, final List choices)
+ public CheckBoxMultipleChoice(final String id, final List<T> choices)
{
super(id, choices);
}
@@ -169,8 +177,8 @@
* @see AbstractChoice#AbstractChoice(String,
* java.util.List,org.apache.wicket.markup.html.form.IChoiceRenderer)
*/
- public CheckBoxMultipleChoice(final String id, final List choices,
- final IChoiceRenderer renderer)
+ public CheckBoxMultipleChoice(final String id, final List<T> choices,
+ final IChoiceRenderer<T> renderer)
{
super(id, choices, renderer);
}
@@ -187,7 +195,8 @@
* @see org.apache.wicket.Component#Component(String, org.apache.wicket.model.IModel)
* @see AbstractChoice#AbstractChoice(String, org.apache.wicket.model.IModel, java.util.List)
*/
- public CheckBoxMultipleChoice(final String id, IModel model, final List choices)
+ public CheckBoxMultipleChoice(final String id, IModel<Collection<T>> model,
+ final List<T> choices)
{
super(id, model, choices);
}
@@ -207,8 +216,8 @@
* @see AbstractChoice#AbstractChoice(String, org.apache.wicket.model.IModel,
* java.util.List,org.apache.wicket.markup.html.form.IChoiceRenderer)
*/
- public CheckBoxMultipleChoice(final String id, IModel model, final List choices,
- final IChoiceRenderer renderer)
+ public CheckBoxMultipleChoice(final String id, IModel<Collection<T>> model,
+ final List<T> choices, final IChoiceRenderer<T> renderer)
{
super(id, model, choices, renderer);
}
@@ -223,7 +232,7 @@
* @see org.apache.wicket.Component#Component(String)
* @see AbstractChoice#AbstractChoice(String, org.apache.wicket.model.IModel)
*/
- public CheckBoxMultipleChoice(String id, IModel choices)
+ public CheckBoxMultipleChoice(String id, IModel<List<T>> choices)
{
super(id, choices);
}
@@ -241,7 +250,7 @@
* org.apache.wicket.model.IModel,org.apache.wicket.model.IModel)
* @see org.apache.wicket.Component#Component(String, org.apache.wicket.model.IModel)
*/
- public CheckBoxMultipleChoice(String id, IModel model, IModel choices)
+ public CheckBoxMultipleChoice(String id, IModel<Collection<T>> model, IModel<List<T>> choices)
{
super(id, model, choices);
}
@@ -259,7 +268,7 @@
* org.apache.wicket.model.IModel,org.apache.wicket.markup.html.form.IChoiceRenderer)
* @see org.apache.wicket.Component#Component(String)
*/
- public CheckBoxMultipleChoice(String id, IModel choices, IChoiceRenderer renderer)
+ public CheckBoxMultipleChoice(String id, IModel<List<T>> choices, IChoiceRenderer<T> renderer)
{
super(id, choices, renderer);
}
@@ -280,7 +289,8 @@
* @see AbstractChoice#AbstractChoice(String, org.apache.wicket.model.IModel,
* org.apache.wicket.model.IModel,org.apache.wicket.markup.html.form.IChoiceRenderer)
*/
- public CheckBoxMultipleChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer)
+ public CheckBoxMultipleChoice(String id, IModel<Collection<T>> model, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer)
{
super(id, model, choices, renderer);
}
@@ -298,7 +308,7 @@
* Prefix to use before choice
* @return this
*/
- public final CheckBoxMultipleChoice setPrefix(final String prefix)
+ public final CheckBoxMultipleChoice<T> setPrefix(final String prefix)
{
// Tell the page that this component's prefix was changed
final Page page = findPage();
@@ -324,7 +334,7 @@
* Separator to use between radio options
* @return this
*/
- public final CheckBoxMultipleChoice setSuffix(final String suffix)
+ public final CheckBoxMultipleChoice<T> setSuffix(final String suffix)
{
// Tell the page that this component's suffix was changed
final Page page = findPage();
@@ -340,6 +350,7 @@
/**
* @see org.apache.wicket.markup.html.form.ListMultipleChoice#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
@@ -354,11 +365,12 @@
* @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
* org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected final void onComponentTagBody(final MarkupStream markupStream,
- final ComponentTag openTag)
+ final ComponentTag openTag)
{
// Iterate through choices
- final List choices = getChoices();
+ final List<T> choices = getChoices();
// Buffer to hold generated body
final AppendingStringBuffer buffer = new AppendingStringBuffer(70 * (choices.size() + 1));
@@ -370,7 +382,7 @@
for (int index = 0; index < choices.size(); index++)
{
// Get next choice
- final Object choice = choices.get(index);
+ final T choice = choices.get(index);
Object displayValue = getChoiceRenderer().getDisplayValue(choice);
Class objectClass = displayValue == null ? null : displayValue.getClass();
@@ -398,11 +410,17 @@
final String idAttr = getInputName() + "_" + id;
// Add checkbox element
- buffer.append("<input name=\"").append(getInputName()).append("\"").append(
- " type=\"checkbox\"").append(
- (isSelected(choice, index, selected) ? " checked=\"checked\"" : ""))
- .append((isEnabled() ? "" : " disabled=\"disabled\"")).append(" value=\"")
- .append(id).append("\" id=\"").append(idAttr).append("\"/>");
+ buffer.append("<input name=\"")
+ .append(getInputName())
+ .append("\"")
+ .append(" type=\"checkbox\"")
+ .append((isSelected(choice, index, selected) ? " checked=\"checked\"" : ""))
+ .append((isEnabled() ? "" : " disabled=\"disabled\""))
+ .append(" value=\"")
+ .append(id)
+ .append("\" id=\"")
+ .append(idAttr)
+ .append("\"/>");
// Add label for checkbox
String display = label;
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java Tue Apr 8 11:10:20 2008
@@ -57,8 +57,10 @@
*
* @author Igor Vaynberg
*
+ * @param <T>
+ * The model object type
*/
-public class CheckGroup extends FormComponent implements IOnChangeListener
+public class CheckGroup<T> extends FormComponent<Collection<T>> implements IOnChangeListener
{
private static final long serialVersionUID = 1L;
@@ -83,7 +85,7 @@
* collection to be used as the model
*
*/
- public CheckGroup(String id, Collection collection)
+ public CheckGroup(String id, Collection<T> collection)
{
this(id, new Model((Serializable)collection));
}
@@ -91,7 +93,7 @@
/**
* @see WebMarkupContainer#WebMarkupContainer(String, IModel)
*/
- public CheckGroup(String id, IModel model)
+ public CheckGroup(String id, IModel<Collection<T>> model)
{
super(id, model);
setRenderBodyOnly(true);
@@ -100,9 +102,10 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#convertValue(String[])
*/
- protected Object convertValue(String[] values) throws ConversionException
+ @Override
+ protected Collection<T> convertValue(String[] values) throws ConversionException
{
- List collection = new ArrayList();
+ List<T> collection = new ArrayList<T>();
/*
* if the input is null we do not need to do anything since the model collection has already
@@ -117,35 +120,32 @@
if (value != null)
{
- Check checkbox = (Check)visitChildren(new Component.IVisitor()
- {
-
- public Object component(Component component)
+ Check<T> checkbox = (Check<T>)visitChildren(Check.class,
+ new Component.IVisitor<Check>()
{
- if (component instanceof Check)
+
+ public Object component(Check check)
{
- final Check check = (Check)component;
if (String.valueOf(check.getValue()).equals(value))
{
return check;
}
+ return CONTINUE_TRAVERSAL;
}
- return CONTINUE_TRAVERSAL;
- }
- });
+ });
if (checkbox == null)
{
throw new WicketRuntimeException(
- "submitted http post value [" +
- Strings.join(",", values) +
- "] for CheckGroup component [" +
- getPath() +
- "] contains an illegal relative path " +
- "element [" +
- value +
- "] which does not point to a Check component. Due to this the CheckGroup component cannot resolve the selected Check component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission.");
+ "submitted http post value [" +
+ Strings.join(",", values) +
+ "] for CheckGroup component [" +
+ getPath() +
+ "] contains an illegal relative path " +
+ "element [" +
+ value +
+ "] which does not point to a Check component. Due to this the CheckGroup component cannot resolve the selected Check component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission.");
}
// assign the value of the group's model
@@ -159,19 +159,20 @@
/**
* @see FormComponent#updateModel()
*/
+ @Override
public void updateModel()
{
- Collection collection = (Collection)getModelObject();
+ Collection collection = getModelObject();
if (collection == null)
{
- collection = (Collection)getConvertedInput();
+ collection = getConvertedInput();
setModelObject(collection);
}
else
{
modelChanging();
collection.clear();
- collection.addAll((Collection)getConvertedInput());
+ collection.addAll(getConvertedInput());
modelChanged();
}
}
@@ -181,6 +182,7 @@
*
* @see org.apache.wicket.markup.html.form.FormComponent#supportsPersistence()
*/
+ @Override
protected final boolean supportsPersistence()
{
return false;
@@ -189,6 +191,7 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
@@ -204,7 +207,7 @@
{
convertInput();
updateModel();
- onSelectionChanged((Collection)getModelObject());
+ onSelectionChanged(getModelObject());
}
/**
@@ -237,6 +240,7 @@
/**
* @see org.apache.wicket.MarkupContainer#getStatelessHint()
*/
+ @Override
protected boolean getStatelessHint()
{
if (wantOnSelectionChangedNotifications())
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroupSelector.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroupSelector.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroupSelector.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/CheckGroupSelector.java Tue Apr 8 11:10:20 2008
@@ -46,6 +46,7 @@
super(id);
}
+ @Override
protected void onComponentTag(ComponentTag tag)
{
// must be attached to <input type="checkbox" .../> tag
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java Tue Apr 8 11:10:20 2008
@@ -49,8 +49,11 @@
* </p>
*
* @author jcompagner
+ *
+ * @param <T>
+ * The model object type
*/
-public class ChoiceRenderer implements IChoiceRenderer
+public class ChoiceRenderer<T> implements IChoiceRenderer<T>
{
private static final long serialVersionUID = 1L;
@@ -106,7 +109,7 @@
/**
* @see org.apache.wicket.markup.html.form.IChoiceRenderer#getDisplayValue(java.lang.Object)
*/
- public Object getDisplayValue(Object object)
+ public Object getDisplayValue(T object)
{
Object returnValue = object;
if ((displayExpression != null) && (object != null))
@@ -125,7 +128,7 @@
/**
* @see org.apache.wicket.markup.html.form.IChoiceRenderer#getIdValue(java.lang.Object, int)
*/
- public String getIdValue(Object object, int index)
+ public String getIdValue(T object, int index)
{
if (idExpression == null)
{
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java Tue Apr 8 11:10:20 2008
@@ -60,8 +60,11 @@
* @author Jonathan Locke
* @author Eelco Hillenius
* @author Johan Compagner
+ *
+ * @param <T>
+ * The model object type
*/
-public class DropDownChoice extends AbstractSingleSelectChoice implements IOnChangeListener
+public class DropDownChoice<T> extends AbstractSingleSelectChoice<T> implements IOnChangeListener
{
private static final long serialVersionUID = 1L;
@@ -76,7 +79,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, List)
*/
- public DropDownChoice(final String id, final List choices)
+ public DropDownChoice(final String id, final List<T> choices)
{
super(id, choices);
}
@@ -85,7 +88,7 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
* List,IChoiceRenderer)
*/
- public DropDownChoice(final String id, final List data, final IChoiceRenderer renderer)
+ public DropDownChoice(final String id, final List<T> data, final IChoiceRenderer<T> renderer)
{
super(id, data, renderer);
}
@@ -93,7 +96,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel, List)
*/
- public DropDownChoice(final String id, IModel model, final List choices)
+ public DropDownChoice(final String id, IModel<T> model, final List<T> choices)
{
super(id, model, choices);
}
@@ -102,8 +105,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel, List,
* IChoiceRenderer)
*/
- public DropDownChoice(final String id, IModel model, final List data,
- final IChoiceRenderer renderer)
+ public DropDownChoice(final String id, IModel<T> model, final List<T> data,
+ final IChoiceRenderer<T> renderer)
{
super(id, model, data, renderer);
}
@@ -111,7 +114,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel)
*/
- public DropDownChoice(String id, IModel choices)
+ public DropDownChoice(String id, IModel<List<T>> choices)
{
super(id, choices);
}
@@ -119,7 +122,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,IModel)
*/
- public DropDownChoice(String id, IModel model, IModel choices)
+ public DropDownChoice(String id, IModel<T> model, IModel<List<T>> choices)
{
super(id, model, choices);
}
@@ -128,7 +131,7 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
* IModel,IChoiceRenderer)
*/
- public DropDownChoice(String id, IModel choices, IChoiceRenderer renderer)
+ public DropDownChoice(String id, IModel<List<T>> choices, IChoiceRenderer<T> renderer)
{
super(id, choices, renderer);
}
@@ -138,7 +141,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
* IModel,IChoiceRenderer)
*/
- public DropDownChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer)
+ public DropDownChoice(String id, IModel<T> model, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer)
{
super(id, model, choices, renderer);
}
@@ -160,6 +164,7 @@
* Tag to modify
* @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
checkComponentTag(tag, "select");
@@ -189,8 +194,8 @@
// form
// with an ActionURL or something
tag.put("onchange", "window.location.href='" + url +
- (url.toString().indexOf('?') > -1 ? "&" : "?") + getInputName() +
- "=' + this.options[this.selectedIndex].value;");
+ (url.toString().indexOf('?') > -1 ? "&" : "?") + getInputName() +
+ "=' + this.options[this.selectedIndex].value;");
}
}
@@ -232,6 +237,7 @@
/**
* @see org.apache.wicket.MarkupContainer#getStatelessHint()
*/
+ @Override
protected boolean getStatelessHint()
{
if (wantOnSelectionChangedNotifications())
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java Tue Apr 8 11:10:20 2008
@@ -128,8 +128,11 @@
* @author Johan Compagner
* @author Igor Vaynberg (ivaynberg)
* @author David Leangen
+ *
+ * @param <T>
+ * The model object type
*/
-public class Form extends WebMarkupContainer implements IFormSubmitListener
+public class Form<T> extends WebMarkupContainer<T> implements IFormSubmitListener
{
/**
* Visitor used for validation
@@ -207,6 +210,7 @@
/**
* @see org.apache.wicket.Request#getLocale()
*/
+ @Override
public Locale getLocale()
{
return realRequest.getLocale();
@@ -215,6 +219,7 @@
/**
* @see org.apache.wicket.Request#getParameter(java.lang.String)
*/
+ @Override
public String getParameter(String key)
{
return (String)params.get(key);
@@ -223,6 +228,7 @@
/**
* @see org.apache.wicket.Request#getParameterMap()
*/
+ @Override
public Map getParameterMap()
{
return params;
@@ -231,6 +237,7 @@
/**
* @see org.apache.wicket.Request#getParameters(java.lang.String)
*/
+ @Override
public String[] getParameters(String key)
{
String param = (String)params.get(key);
@@ -244,16 +251,19 @@
/**
* @see org.apache.wicket.Request#getPath()
*/
+ @Override
public String getPath()
{
return realRequest.getPath();
}
+ @Override
public String getRelativePathPrefixToContextRoot()
{
return realRequest.getRelativePathPrefixToContextRoot();
}
+ @Override
public String getRelativePathPrefixToWicketHandler()
{
return realRequest.getRelativePathPrefixToWicketHandler();
@@ -262,6 +272,7 @@
/**
* @see org.apache.wicket.Request#getURL()
*/
+ @Override
public String getURL()
{
return url;
@@ -336,7 +347,7 @@
* See Component
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public Form(final String id, IModel model)
+ public Form(final String id, IModel<T> model)
{
super(id, model);
setOutputMarkupId(true);
@@ -484,6 +495,7 @@
// Visit all the (visible) form components and clear the input on each.
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.isVisibleInHierarchy())
@@ -517,7 +529,7 @@
public final IFormSubmittingComponent findSubmittingButton()
{
IFormSubmittingComponent submittingComponent = (IFormSubmittingComponent)getPage().visitChildren(
- IFormSubmittingComponent.class, new IVisitor()
+ IFormSubmittingComponent.class, new IVisitor<Component>()
{
public Object component(final Component component)
{
@@ -691,6 +703,7 @@
*
* @see org.apache.wicket.Component#isVersioned()
*/
+ @Override
public boolean isVersioned()
{
return super.isVersioned();
@@ -706,6 +719,7 @@
{
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
// Component must implement persister interface and
@@ -906,6 +920,7 @@
// Search for FormComponents like TextField etc.
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.isVisibleInHierarchy())
@@ -979,6 +994,7 @@
/**
* @see org.apache.wicket.Component#setVersioned(boolean)
*/
+ @Override
public final Component setVersioned(final boolean isVersioned)
{
super.setVersioned(isVersioned);
@@ -986,6 +1002,7 @@
// Search for FormComponents like TextField etc.
visitFormComponents(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
formComponent.setVersioned(isVersioned);
@@ -1187,6 +1204,7 @@
{
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.isVisibleInHierarchy())
@@ -1216,6 +1234,7 @@
// Search for FormComponent children. Ignore all other
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.isVisibleInHierarchy())
@@ -1354,6 +1373,7 @@
* @return The javascript/css id of this form.
* @deprecated use {@link #getMarkupId()}
*/
+ @Deprecated
protected final String getJavascriptId()
{
return getMarkupId();
@@ -1376,6 +1396,7 @@
return (method != null) ? method : METHOD_POST;
}
+ @Override
protected boolean getStatelessHint()
{
return false;
@@ -1455,11 +1476,13 @@
/**
* @see org.apache.wicket.Component#internalOnModelChanged()
*/
+ @Override
protected void internalOnModelChanged()
{
// Visit all the form components and validate each
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
// If form component is using form model
@@ -1479,6 +1502,7 @@
// call invalidate methods of all nested form components
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.isVisibleInHierarchy())
@@ -1527,6 +1551,7 @@
// call valid methods of all nested form components
visitFormComponentsPostOrder(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(final FormComponent formComponent)
{
if (formComponent.getForm() == Form.this && formComponent.isVisibleInHierarchy())
@@ -1540,6 +1565,7 @@
/**
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
super.onComponentTag(tag);
@@ -1599,6 +1625,7 @@
* @param openTag
* The open tag for the body
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
if (isRootForm())
@@ -1648,6 +1675,7 @@
/**
* @see org.apache.wicket.Component#onDetach()
*/
+ @Override
protected void onDetach()
{
super.internalOnDetach();
@@ -1667,11 +1695,13 @@
/**
* @see org.apache.wicket.Component#onRender(MarkupStream)
*/
+ @Override
protected void onRender(final MarkupStream markupStream)
{
// Force multi-part on if any child form component is multi-part
visitFormComponents(new FormComponent.AbstractVisitor()
{
+ @Override
public void onFormComponent(FormComponent formComponent)
{
if (formComponent.isVisible() && formComponent.isMultiPart())
@@ -1738,6 +1768,7 @@
{
visitFormComponentsPostOrder(new ValidationVisitor()
{
+ @Override
public void validate(FormComponent formComponent)
{
Form form = formComponent.getForm();
@@ -1777,6 +1808,7 @@
{
visitFormComponentsPostOrder(new ValidationVisitor()
{
+ @Override
public void validate(final FormComponent formComponent)
{
final Form form = formComponent.getForm();
@@ -1877,11 +1909,10 @@
*/
private void validateNestedForms()
{
- visitChildren(Form.class, new IVisitor()
+ visitChildren(Form.class, new IVisitor<Form>()
{
- public Object component(Component component)
+ public Object component(Form form)
{
- final Form form = (Form)component;
if (form.isEnabled() && form.isEnableAllowed() && form.isVisibleInHierarchy())
{
form.validateComponents();
@@ -1916,6 +1947,7 @@
}
+ @Override
public void undo()
{
add(removed);
@@ -1928,7 +1960,8 @@
*
* @return String that well be used as prefix to form component input names
*/
- protected String getInputNamePrefix() {
+ protected String getInputNamePrefix()
+ {
return "";
}
}
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java Tue Apr 8 11:10:20 2008
@@ -85,8 +85,12 @@
* @author Eelco Hillenius
* @author Johan Compagner
* @author Igor Vaynberg (ivaynberg)
+ *
+ * @param <T>
+ * The model object type
+ *
*/
-public abstract class FormComponent extends LabeledWebMarkupContainer
+public abstract class FormComponent<T> extends LabeledWebMarkupContainer<T>
implements
IFormVisitorParticipant
{
@@ -301,6 +305,7 @@
/**
* @see org.apache.wicket.version.undo.Change#undo()
*/
+ @Override
public void undo()
{
setRequired(required);
@@ -424,7 +429,7 @@
return null;
}
- private transient Object convertedInput;
+ private transient T convertedInput;
/**
* Raw Input entered by the user or NO_RAW_INPUT if nothing is filled in.
@@ -590,7 +595,7 @@
*
* @return value of input possibly converted into an appropriate type
*/
- public final Object getConvertedInput()
+ public final T getConvertedInput()
{
return convertedInput;
}
@@ -603,7 +608,7 @@
* @param convertedInput
* the converted input
*/
- public final void setConvertedInput(Object convertedInput)
+ public final void setConvertedInput(T convertedInput)
{
this.convertedInput = convertedInput;
}
@@ -974,6 +979,7 @@
*
* @deprecated call or override setModelValue(String[])
*/
+ @Deprecated
public void setModelValue(final String value)
{
setModelValue(value.split(VALUE_SEPARATOR));
@@ -1208,7 +1214,7 @@
final IConverter converter = getConverter(getType());
try
{
- convertedInput = converter.convertToObject(getInput(), getLocale());
+ convertedInput = (T)converter.convertToObject(getInput(), getLocale());
}
catch (ConversionException e)
{
@@ -1262,14 +1268,15 @@
* @throws ConversionException
* If input can't be converted
*/
- protected Object convertValue(String[] value) throws ConversionException
+ protected T convertValue(String[] value) throws ConversionException
{
- return value != null && value.length > 0 && value[0] != null ? trim(value[0]) : null;
+ return (T)(value != null && value.length > 0 && value[0] != null ? trim(value[0]) : null);
}
/**
* @see org.apache.wicket.Component#getBehaviors(java.lang.Class)
*/
+ @Override
protected List getBehaviors(Class type)
{
// List
@@ -1356,6 +1363,7 @@
/**
* @see org.apache.wicket.Component#internalOnModelChanged()
*/
+ @Override
protected void internalOnModelChanged()
{
// If the model for this form component changed, we should make it
@@ -1370,6 +1378,7 @@
* Tag to modify
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
tag.put("name", getInputName());
@@ -1387,6 +1396,7 @@
*
* @see org.apache.wicket.Component#onDetach()
*/
+ @Override
protected void onDetach()
{
super.onDetach();
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java Tue Apr 8 11:10:20 2008
@@ -109,8 +109,11 @@
* </p>
*
* @author eelcohillenius
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class FormComponentPanel extends FormComponent
+public abstract class FormComponentPanel<T> extends FormComponent<T>
implements
IHeaderPartContainerProvider
{
@@ -144,7 +147,7 @@
* @param id
* @param model
*/
- public FormComponentPanel(String id, IModel model)
+ public FormComponentPanel(String id, IModel<T> model)
{
super(id, model);
}
@@ -152,6 +155,7 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#checkRequired()
*/
+ @Override
public boolean checkRequired()
{
return true;
@@ -171,6 +175,7 @@
*
* @see org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
*/
+ @Override
public void renderHead(HtmlHeaderContainer container)
{
if (markupHelper == null)
@@ -187,6 +192,7 @@
*
* @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
if (tag.isOpenClose())
@@ -205,6 +211,7 @@
* @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
* org.apache.wicket.markup.ComponentTag)
*/
+ @Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
// Render the associated markup
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/HiddenField.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/HiddenField.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/HiddenField.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/HiddenField.java Tue Apr 8 11:10:20 2008
@@ -32,7 +32,7 @@
*
* @author Cameron Braid
*/
-public class HiddenField extends TextField
+public class HiddenField<T> extends TextField<T>
{
private static final long serialVersionUID = 1L;
@@ -55,7 +55,7 @@
* @param type
* the type to use when updating the model for this text field
*/
- public HiddenField(String id, Class type)
+ public HiddenField(String id, Class<T> type)
{
super(id, type);
}
@@ -68,7 +68,7 @@
* @param model
* the model
*/
- public HiddenField(String id, IModel model)
+ public HiddenField(String id, IModel<T> model)
{
super(id, model);
}
@@ -82,7 +82,7 @@
* the type to use when updating the model for this text field
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public HiddenField(String id, IModel model, Class type)
+ public HiddenField(String id, IModel<T> model, Class<T> type)
{
super(id, model, type);
}
@@ -90,6 +90,7 @@
/**
* @see org.apache.wicket.markup.html.form.TextField#getInputType()
*/
+ @Override
protected String getInputType()
{
return "hidden";
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java Tue Apr 8 11:10:20 2008
@@ -23,8 +23,11 @@
* values' which are the values shown to the user of components that use this renderer.
*
* @author jcompagner
+ *
+ * @param <T>
+ * The model object type
*/
-public interface IChoiceRenderer extends IClusterable
+public interface IChoiceRenderer<T> extends IClusterable
{
/**
* Get the value for displaying to an end user.
@@ -33,7 +36,7 @@
* the actual object
* @return the value meant for displaying to an end user
*/
- Object getDisplayValue(Object object);
+ Object getDisplayValue(T object);
/**
* This method is called to get the id value of an object (used as the value attribute of a
@@ -46,5 +49,5 @@
* The index of the object in the choices list.
* @return String
*/
- String getIdValue(Object object, int index);
+ String getIdValue(T object, int index);
}
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java Tue Apr 8 11:10:20 2008
@@ -16,7 +16,6 @@
*/
package org.apache.wicket.markup.html.form;
-import org.apache.wicket.Component;
import org.apache.wicket.IResourceListener;
import org.apache.wicket.Resource;
import org.apache.wicket.ResourceReference;
@@ -93,7 +92,7 @@
* The resource parameters
*/
public ImageButton(final String id, final ResourceReference resourceReference,
- ValueMap resourceParameters)
+ ValueMap resourceParameters)
{
super(id);
setImageResourceReference(resourceReference, resourceParameters);
@@ -172,7 +171,7 @@
* Set the resource parameters for the resource.
*/
public void setImageResourceReference(final ResourceReference resourceReference,
- final ValueMap parameters)
+ final ValueMap parameters)
{
localizedImageResource.setResourceReference(resourceReference, parameters);
}
@@ -180,13 +179,14 @@
/**
* @see org.apache.wicket.Component#setModel(org.apache.wicket.model.IModel)
*/
- public Component setModel(IModel model)
+ @Override
+ public ImageButton setModel(IModel model)
{
// Null out the image resource, so we reload it (otherwise we'll be
// stuck with the old model.
localizedImageResource.setResourceReference(null);
localizedImageResource.setResource(null);
- return super.setModel(model);
+ return (ImageButton)super.setModel(model);
}
/**
@@ -212,6 +212,7 @@
* Tag to modify
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected final void onComponentTag(final ComponentTag tag)
{
checkComponentTag(tag, "input");
@@ -234,6 +235,7 @@
/**
* @see org.apache.wicket.markup.html.form.Button#getStatelessHint()
*/
+ @Override
protected boolean getStatelessHint()
{
return getImageResource() == null && localizedImageResource.isStateless();
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/LabeledWebMarkupContainer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/LabeledWebMarkupContainer.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/LabeledWebMarkupContainer.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/LabeledWebMarkupContainer.java Tue Apr 8 11:10:20 2008
@@ -24,8 +24,11 @@
* Default implementation of {@link ILabelProvider}.
*
* @author almaw
+ *
+ * @param <T>
+ * The model object type
*/
-public abstract class LabeledWebMarkupContainer extends WebMarkupContainer
+public abstract class LabeledWebMarkupContainer<T> extends WebMarkupContainer<T>
implements
ILabelProvider
{
@@ -39,6 +42,7 @@
*/
private IModel labelModel = null;
+ @Override
protected void onDetach()
{
super.onDetach();
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ListChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ListChoice.java?rev=646020&r1=646019&r2=646020&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ListChoice.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/ListChoice.java Tue Apr 8 11:10:20 2008
@@ -29,8 +29,11 @@
* @author Jonathan Locke
* @author Johan Compagner
* @author Eelco Hillenius
+ *
+ * @param <T>
+ * The model object type
*/
-public class ListChoice extends DropDownChoice
+public class ListChoice<T> extends DropDownChoice<T>
{
private static final long serialVersionUID = 1L;
@@ -72,7 +75,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, List)
*/
- public ListChoice(final String id, final List choices)
+ public ListChoice(final String id, final List<T> choices)
{
this(id, null, choices, null, defaultMaxRows);
}
@@ -87,7 +90,7 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
* List,IChoiceRenderer)
*/
- public ListChoice(final String id, final List choices, final IChoiceRenderer renderer)
+ public ListChoice(final String id, final List<T> choices, final IChoiceRenderer<T> renderer)
{
this(id, null, choices, renderer, defaultMaxRows);
}
@@ -102,7 +105,7 @@
* The collection of values in the list
* @see DropDownChoice#DropDownChoice(String, IModel, List)
*/
- public ListChoice(final String id, final IModel model, final List choices)
+ public ListChoice(final String id, final IModel<T> model, final List<T> choices)
{
this(id, model, choices, null, defaultMaxRows);
}
@@ -118,7 +121,8 @@
* Maximum number of rows to show
* @see DropDownChoice#DropDownChoice(String, IModel, List)
*/
- public ListChoice(final String id, final IModel model, final List choices, final int maxRows)
+ public ListChoice(final String id, final IModel<T> model, final List<T> choices,
+ final int maxRows)
{
this(id, model, choices, null, maxRows);
}
@@ -134,8 +138,8 @@
* See AbstractChoice
* @see DropDownChoice#DropDownChoice(String, IModel, List)
*/
- public ListChoice(final String id, final IModel model, final List choices,
- final IChoiceRenderer renderer)
+ public ListChoice(final String id, final IModel<T> model, final List<T> choices,
+ final IChoiceRenderer<T> renderer)
{
this(id, model, choices, renderer, defaultMaxRows);
}
@@ -153,8 +157,8 @@
* Maximum number of rows to show
* @see DropDownChoice#DropDownChoice(String, IModel, List)
*/
- public ListChoice(final String id, final IModel model, final List choices,
- final IChoiceRenderer renderer, final int maxRows)
+ public ListChoice(final String id, final IModel<T> model, final List<T> choices,
+ final IChoiceRenderer<T> renderer, final int maxRows)
{
super(id, model, choices, renderer);
this.maxRows = maxRows;
@@ -163,7 +167,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel)
*/
- public ListChoice(String id, IModel choices)
+ public ListChoice(String id, IModel<List<T>> choices)
{
this(id, null, choices, null, defaultMaxRows);
}
@@ -171,7 +175,7 @@
/**
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,IModel)
*/
- public ListChoice(String id, IModel model, IModel choices)
+ public ListChoice(String id, IModel<T> model, IModel<List<T>> choices)
{
this(id, model, choices, null, defaultMaxRows);
}
@@ -180,7 +184,7 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
* IModel,IChoiceRenderer)
*/
- public ListChoice(String id, IModel choices, IChoiceRenderer renderer)
+ public ListChoice(String id, IModel<List<T>> choices, IChoiceRenderer<T> renderer)
{
this(id, null, choices, renderer, defaultMaxRows);
}
@@ -190,7 +194,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
* IModel,IChoiceRenderer)
*/
- public ListChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer)
+ public ListChoice(String id, IModel<T> model, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer)
{
this(id, model, choices, renderer, defaultMaxRows);
}
@@ -199,7 +204,8 @@
* @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
* IModel,IChoiceRenderer)
*/
- public ListChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer, int maxRows)
+ public ListChoice(String id, IModel<T> model, IModel<List<T>> choices,
+ IChoiceRenderer<T> renderer, int maxRows)
{
super(id, model, choices, renderer);
this.maxRows = maxRows;
@@ -222,7 +228,7 @@
* the maximum number of rows to display
* @return This
*/
- public final ListChoice setMaxRows(int maxRows)
+ public final ListChoice<T> setMaxRows(int maxRows)
{
this.maxRows = maxRows;
return this;
@@ -231,6 +237,7 @@
/**
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
+ @Override
protected void onComponentTag(final ComponentTag tag)
{
super.onComponentTag(tag);
@@ -243,6 +250,7 @@
/**
* @see org.apache.wicket.markup.html.form.FormComponent#supportsPersistence()
*/
+ @Override
protected final boolean supportsPersistence()
{
return true;