You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2011/07/09 01:18:57 UTC
svn commit: r1144547 -
/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
Author: ivaynberg
Date: Fri Jul 8 23:18:56 2011
New Revision: 1144547
URL: http://svn.apache.org/viewvc?rev=1144547&view=rev
Log:
FC#getDefaultLabel() tweak
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?rev=1144547&r1=1144546&r2=1144547&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java Fri Jul 8 23:18:56 2011
@@ -448,15 +448,29 @@ public abstract class FormComponent<T> e
* was set via {@link #getLabel()}. The value of this string is usually set in a property file;
* if the value is not set the default value equivalent to component id will be returned.
*
- * @param fc
- * @return Localized label string
+ * @return localized label
*/
public final String getDefaultLabel()
{
- return getLocalizer().getString(getId(), getParent(), getId());
+ return getDefaultLabel(getId());
}
/**
+ * Gets the string the component would use as a label when one was requested but no label model
+ * was set via {@link #getLabel()}. The value of this string is usually set in a property file;
+ * if the value is not set the {@code defaultValue} will be returned.
+ *
+ * @param defaultValue
+ *
+ * @return localized label
+ */
+ public final String getDefaultLabel(String defaultValue)
+ {
+ return getLocalizer().getString(getId(), getParent(), defaultValue);
+ }
+
+
+ /**
* Adds a validator to this form component
*
* @param validator
@@ -468,7 +482,7 @@ public abstract class FormComponent<T> e
* @see IValidatorAddListener
*
*/
- @SuppressWarnings( { "rawtypes", "unchecked" })
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public final FormComponent<T> add(final IValidator<? super T> validator)
{
if (validator == null)