You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2010/12/28 11:50:53 UTC

svn commit: r1053301 - in /wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form: AbstractChoice.java AbstractSingleSelectChoice.java DropDownChoice.java

Author: jdonnerstag
Date: Tue Dec 28 10:50:53 2010
New Revision: 1053301

URL: http://svn.apache.org/viewvc?rev=1053301&view=rev
Log:
fixed (mostly javadoc): DropDownChoice: "data" or "choices?"
Issue: WICKET-3286

Modified:
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java

Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java?rev=1053301&r1=1053300&r2=1053301&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java (original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractChoice.java Tue Dec 28 10:50:53 2010
@@ -43,7 +43,6 @@ import org.apache.wicket.util.string.Str
  */
 public abstract class AbstractChoice<T, E> extends FormComponent<T>
 {
-	/** */
 	private static final long serialVersionUID = 1L;
 
 	/** The list of objects. */
@@ -57,7 +56,6 @@ public abstract class AbstractChoice<T, 
 	 * 
 	 * @param id
 	 *            See Component
-	 * @see org.apache.wicket.Component#Component(String)
 	 */
 	public AbstractChoice(final String id)
 	{
@@ -71,7 +69,6 @@ public abstract class AbstractChoice<T, 
 	 *            See Component
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String)
 	 */
 	public AbstractChoice(final String id, final List<? extends E> choices)
 	{
@@ -87,7 +84,6 @@ public abstract class AbstractChoice<T, 
 	 *            The rendering engine
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String)
 	 */
 	public AbstractChoice(final String id, final List<? extends E> choices,
 		final IChoiceRenderer<? super E> renderer)
@@ -104,7 +100,6 @@ public abstract class AbstractChoice<T, 
 	 *            See Component
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String, IModel)
 	 */
 	public AbstractChoice(final String id, IModel<T> model, final List<? extends E> choices)
 	{
@@ -122,7 +117,6 @@ public abstract class AbstractChoice<T, 
 	 *            The drop down choices
 	 * @param renderer
 	 *            The rendering engine
-	 * @see org.apache.wicket.Component#Component(String, IModel)
 	 */
 	public AbstractChoice(final String id, IModel<T> model, final List<? extends E> choices,
 		final IChoiceRenderer<? super E> renderer)
@@ -137,7 +131,6 @@ public abstract class AbstractChoice<T, 
 	 *            See Component
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String)
 	 */
 	public AbstractChoice(final String id, final IModel<? extends List<? extends E>> choices)
 	{
@@ -153,7 +146,6 @@ public abstract class AbstractChoice<T, 
 	 *            The rendering engine
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String)
 	 */
 	public AbstractChoice(final String id, final IModel<? extends List<? extends E>> choices,
 		final IChoiceRenderer<? super E> renderer)
@@ -172,7 +164,6 @@ public abstract class AbstractChoice<T, 
 	 *            See Component
 	 * @param choices
 	 *            The collection of choices in the dropdown
-	 * @see org.apache.wicket.Component#Component(String, IModel)
 	 */
 	public AbstractChoice(final String id, IModel<T> model,
 		final IModel<? extends List<? extends E>> choices)
@@ -191,7 +182,6 @@ public abstract class AbstractChoice<T, 
 	 *            The rendering engine
 	 * @param choices
 	 *            The drop down choices
-	 * @see org.apache.wicket.Component#Component(String, IModel)
 	 */
 	public AbstractChoice(final String id, IModel<T> model,
 		final IModel<? extends List<? extends E>> choices, final IChoiceRenderer<? super E> renderer)
@@ -201,7 +191,6 @@ public abstract class AbstractChoice<T, 
 		setChoiceRenderer(renderer);
 	}
 
-
 	/**
 	 * @return The collection of object that this choice has
 	 */
@@ -216,7 +205,6 @@ public abstract class AbstractChoice<T, 
 		return choices;
 	}
 
-
 	/**
 	 * Sets the list of choices
 	 * 
@@ -281,9 +269,6 @@ public abstract class AbstractChoice<T, 
 		return this;
 	}
 
-	/**
-	 * @see org.apache.wicket.Component#detachModel()
-	 */
 	@Override
 	protected void detachModel()
 	{
@@ -342,7 +327,6 @@ public abstract class AbstractChoice<T, 
 	 *            The markup stream
 	 * @param openTag
 	 *            The open tag for the body
-	 * @see org.apache.wicket.Component#onComponentTagBody(MarkupStream, ComponentTag)
 	 */
 	@Override
 	protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
@@ -386,23 +370,25 @@ public abstract class AbstractChoice<T, 
 		String displayValue = "";
 		if (objectClass != null && objectClass != String.class)
 		{
-			final IConverter converter = getConverter(objectClass);
-
+			IConverter<T> converter = getConverter(objectClass);
 			displayValue = converter.convertToString(objectValue, getLocale());
 		}
 		else if (objectValue != null)
 		{
 			displayValue = objectValue.toString();
 		}
+
 		buffer.append("\n<option ");
 		if (isSelected(choice, index, selected))
 		{
 			buffer.append("selected=\"selected\" ");
 		}
+
 		if (isDisabled(choice, index, selected))
 		{
 			buffer.append("disabled=\"disabled\" ");
 		}
+
 		buffer.append("value=\"");
 		buffer.append(Strings.escapeMarkup(renderer.getIdValue(choice, index)));
 		buffer.append("\">");
@@ -412,11 +398,13 @@ public abstract class AbstractChoice<T, 
 		{
 			display = getLocalizer().getString(displayValue, this, displayValue);
 		}
+
 		CharSequence escaped = display;
 		if (getEscapeModelStrings())
 		{
 			escaped = escapeOptionHtml(display);
 		}
+
 		buffer.append(escaped);
 		buffer.append("</option>");
 	}

Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java?rev=1053301&r1=1053300&r2=1053301&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java (original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java Tue Dec 28 10:50:53 2010
@@ -44,13 +44,14 @@ public abstract class AbstractSingleSele
 
 	private static final String EMPTY_STRING = "";
 
-	/**
-	 * whether or not null will be offered as a choice once a nonnull value is saved
-	 */
+	/** whether or not null will be offered as a choice once a nonnull value is saved */
 	private boolean nullValid = false;
 
 	/**
-	 * @see AbstractChoice#AbstractChoice(String)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
 	 */
 	public AbstractSingleSelectChoice(final String id)
 	{
@@ -58,7 +59,12 @@ public abstract class AbstractSingleSele
 	}
 
 	/**
-	 * @see AbstractChoice#AbstractChoice(String, List)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
 	public AbstractSingleSelectChoice(final String id, final List<? extends T> choices)
 	{
@@ -66,40 +72,62 @@ public abstract class AbstractSingleSele
 	}
 
 	/**
+	 * Constructor.
+	 * 
 	 * @param id
-	 * @param data
+	 *            See Component
 	 * @param renderer
-	 * @see AbstractChoice#AbstractChoice(String, List ,IChoiceRenderer)
+	 *            The rendering engine
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
-	public AbstractSingleSelectChoice(final String id, final List<? extends T> data,
+	public AbstractSingleSelectChoice(final String id, final List<? extends T> choices,
 		final IChoiceRenderer<? super T> renderer)
 	{
-		super(id, data, renderer);
+		super(id, choices, renderer);
 	}
 
 	/**
-	 * @see AbstractChoice#AbstractChoice(String, IModel, List)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
-	public AbstractSingleSelectChoice(final String id, IModel<T> model, final List<? extends T> data)
+	public AbstractSingleSelectChoice(final String id, IModel<T> model,
+		final List<? extends T> choices)
 	{
-		super(id, model, data);
+		super(id, model, choices);
 	}
 
 	/**
+	 * Constructor.
+	 * 
 	 * @param id
+	 *            See Component
 	 * @param model
-	 * @param data
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
 	 * @param renderer
-	 * @see AbstractChoice#AbstractChoice(String, IModel, List, IChoiceRenderer)
+	 *            The rendering engine
 	 */
 	public AbstractSingleSelectChoice(final String id, IModel<T> model,
-		final List<? extends T> data, final IChoiceRenderer<? super T> renderer)
+		final List<? extends T> choices, final IChoiceRenderer<? super T> renderer)
 	{
-		super(id, model, data, renderer);
+		super(id, model, choices, renderer);
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
 	public AbstractSingleSelectChoice(String id, IModel<? extends List<? extends T>> choices)
 	{
@@ -107,7 +135,14 @@ public abstract class AbstractSingleSele
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,IModel)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
 	 */
 	public AbstractSingleSelectChoice(String id, IModel<T> model,
 		IModel<? extends List<? extends T>> choices)
@@ -116,8 +151,14 @@ public abstract class AbstractSingleSele
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
-	 *      IModel,IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
+	 * @param renderer
+	 *            The rendering engine
 	 */
 	public AbstractSingleSelectChoice(String id, IModel<? extends List<? extends T>> choices,
 		IChoiceRenderer<? super T> renderer)
@@ -126,8 +167,16 @@ public abstract class AbstractSingleSele
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
-	 *      IModel,IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
+	 * @param renderer
+	 *            The rendering engine
 	 */
 	public AbstractSingleSelectChoice(String id, IModel<T> model,
 		IModel<? extends List<? extends T>> choices, IChoiceRenderer<? super T> renderer)

Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java?rev=1053301&r1=1053300&r2=1053301&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java (original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/DropDownChoice.java Tue Dec 28 10:50:53 2010
@@ -69,7 +69,10 @@ public class DropDownChoice<T> extends A
 	private static final long serialVersionUID = 1L;
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
 	 */
 	public DropDownChoice(final String id)
 	{
@@ -77,7 +80,12 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, List)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
 	public DropDownChoice(final String id, final List<? extends T> choices)
 	{
@@ -85,17 +93,30 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
-	 *      List,IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param renderer
+	 *            The rendering engine
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
-	public DropDownChoice(final String id, final List<? extends T> data,
+	public DropDownChoice(final String id, final List<? extends T> choices,
 		final IChoiceRenderer<? super T> renderer)
 	{
-		super(id, data, renderer);
+		super(id, choices, renderer);
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel, List)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
 	public DropDownChoice(final String id, IModel<T> model, final List<? extends T> choices)
 	{
@@ -103,17 +124,30 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel, List,
-	 *      IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
+	 * @param renderer
+	 *            The rendering engine
 	 */
-	public DropDownChoice(final String id, IModel<T> model, final List<? extends T> data,
+	public DropDownChoice(final String id, IModel<T> model, final List<? extends T> choices,
 		final IChoiceRenderer<? super T> renderer)
 	{
-		super(id, model, data, renderer);
+		super(id, model, choices, renderer);
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The collection of choices in the dropdown
 	 */
 	public DropDownChoice(String id, IModel<? extends List<? extends T>> choices)
 	{
@@ -121,7 +155,14 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,IModel)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
 	 */
 	public DropDownChoice(String id, IModel<T> model, IModel<? extends List<? extends T>> choices)
 	{
@@ -129,8 +170,14 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String,
-	 *      IModel,IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
+	 * @param renderer
+	 *            The rendering engine
 	 */
 	public DropDownChoice(String id, IModel<? extends List<? extends T>> choices,
 		IChoiceRenderer<? super T> renderer)
@@ -138,10 +185,17 @@ public class DropDownChoice<T> extends A
 		super(id, choices, renderer);
 	}
 
-
 	/**
-	 * @see org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, IModel,
-	 *      IModel,IChoiceRenderer)
+	 * Constructor.
+	 * 
+	 * @param id
+	 *            See Component
+	 * @param model
+	 *            See Component
+	 * @param choices
+	 *            The drop down choices
+	 * @param renderer
+	 *            The rendering engine
 	 */
 	public DropDownChoice(String id, IModel<T> model, IModel<? extends List<? extends T>> choices,
 		IChoiceRenderer<? super T> renderer)
@@ -228,7 +282,7 @@ public class DropDownChoice<T> extends A
 	}
 
 	/**
-	 * @see org.apache.wicket.MarkupContainer#getStatelessHint()
+	 * {@inheritDoc}
 	 */
 	@Override
 	protected boolean getStatelessHint()