Author: ivaynberg
Date: Fri Jul 8 23:17:11 2011
New Revision: 1144545
URL: http://svn.apache.org/viewvc?rev=1144545&view=rev
Log:
small tweak to FC#getDefaultValue()
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?rev=1144545&r1=1144544&r2=1144545&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
Fri Jul 8 23:17:11 2011
@@ -567,12 +567,24 @@ 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
+ * @return component 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 component label
+ */
+ public final String getDefaultLabel(String defaultValue)
+ {
+ return getLocalizer().getString(getId(), getParent(),
defaultValue);
}
/**