Updated Branches:
  refs/heads/wicket-6.x a73209bea -> 92a5bdbdb

WICKET-5411 auto label - realign css property names to 7.0 and fix tests


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/92a5bdbd
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/92a5bdbd
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/92a5bdbd

Branch: refs/heads/wicket-6.x
Commit: 92a5bdbdb7aaa7e6e0c0bd8aab42a33d174a3e81
Parents: a73209b
Author: Igor Vaynberg <igor.vaynb...@gmail.com>
Authored: Fri Nov 8 23:04:35 2013 -0800
Committer: Igor Vaynberg <igor.vaynb...@gmail.com>
Committed: Fri Nov 8 23:04:35 2013 -0800

----------------------------------------------------------------------
 .../wicket/markup/html/form/AutoLabelResolver.java      | 12 ++++++------
 .../markup/html/form/AutoFormLabelPickupTest.java       |  4 ++--
 .../markup/html/form/AutoLabelWithContentTest.java      |  4 ++--
 .../markup/html/form/AutoLabelWithinEnclosureTest.java  |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/92a5bdbd/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java
 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java
index 7892fa7..5811d2e 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java
@@ -42,13 +42,13 @@ import org.slf4j.LoggerFactory;
  * referenced form component</li>
  * <li>Appends {@code required} css class to the {@code <label>} tag if the 
referenced form
  * component is required. Name of the css class can be overwritten by having a 
i18n property defined
- * for key AutoLabelResolver.CSS.required</li>
+ * for key AutoLabel.CSS.required</li>
  * <li>Appends {@code error} css class to the {@code <label>} tag if the 
referenced form component
  * has failed validation. Name of the css class can be overwritten by having a 
i18n property defined
- * for key AutoLabelResolver.CSS.error</li>
+ * for key AutoLabel.CSS.error</li>
  * <li>Appends {@code disabled} css class to the {@code <label>} tag if the 
referenced form
  * component has is not enabled in hierarchy. Name of the css class can be 
overwritten by having a i18n property defined
- * for key AutoLabelResolver.CSS.disabled</li>
+ * for key AutoLabel.CSS.disabled</li>
  * </ul>
  * 
  * <p>
@@ -72,9 +72,9 @@ public class AutoLabelResolver implements IComponentResolver
 
        static final String WICKET_FOR = ":for";
 
-       public static final String CSS_REQUIRED_KEY = 
CssUtils.key(AutoLabelResolver.class, "requried");
-       public static final String CSS_DISABLED_KEY = 
CssUtils.key(AutoLabelResolver.class, "requried");
-       public static final String CSS_ERROR_KEY = 
CssUtils.key(AutoLabelResolver.class, "requried");
+       public static final String CSS_REQUIRED_KEY = 
CssUtils.key(AutoLabel.class, "requried");
+       public static final String CSS_DISABLED_KEY = 
CssUtils.key(AutoLabel.class, "requried");
+       public static final String CSS_ERROR_KEY = 
CssUtils.key(AutoLabel.class, "requried");
        private static final String CSS_DISABLED_DEFAULT = "disabled";
        private static final String CSS_REQUIRED_DEFAULT = "required";
        private static final String CSS_ERROR_DEFAULT = "error";

http://git-wip-us.apache.org/repos/asf/wicket/blob/92a5bdbd/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoFormLabelPickupTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoFormLabelPickupTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoFormLabelPickupTest.java
index beb3b32..b47f570 100644
--- 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoFormLabelPickupTest.java
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoFormLabelPickupTest.java
@@ -65,14 +65,14 @@ public class AutoFormLabelPickupTest extends WicketTestCase
        public void labelIsPrintedFromModel() throws Exception
        {
                tester.startPage(new PrintLabelPage(Model.of("label from 
model")));
-               tester.assertContains("<label wicket:for=\"input\" 
for=\"input2\">\\|label from model\\|</label>");
+               tester.assertContains("<label wicket:for=\"input\" 
for=\"input2\" id=\"input2-w-lbl\">\\|label from model\\|</label>");
        }
 
        @Test
        public void labelIsPrintedFromProperties() throws Exception
        {
                tester.startPage(new PrintLabelPage(Model.of((String)null)));
-               tester.assertContains("<label wicket:for=\"input\" 
for=\"input2\">\\|label from properties\\|</label>");
+               tester.assertContains("<label wicket:for=\"input\" 
for=\"input2\" id=\"input2-w-lbl\">\\|label from properties\\|</label>");
        }
 
        @Test

http://git-wip-us.apache.org/repos/asf/wicket/blob/92a5bdbd/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java
index 46d4cc1..303fa83 100644
--- 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java
@@ -45,7 +45,7 @@ public class AutoLabelWithContentTest extends WicketTestCase
        public void labelWithMessage() throws Exception
        {
                tester.startPage(LabelWithMessagePage.class);
-               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\"><wicket:message key=\"foo\">my test 
text</wicket:message></label>");
+               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\" id=\"textfield2-w-lbl\"><wicket:message key=\"foo\">my test 
text</wicket:message></label>");
        }
 
        public static class LabelWithNestedComponentsPage extends WebPage
@@ -62,6 +62,6 @@ public class AutoLabelWithContentTest extends WicketTestCase
        public void labelWithNestedComponent()
        {
                tester.startPage(LabelWithNestedComponentsPage.class);
-               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\"><input type=\"text\" wicket:id=\"textfield\" value=\"\" 
name=\"textfield\" id=\"textfield2\"/></label>");
+               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\" id=\"textfield2-w-lbl\"><input type=\"text\" 
wicket:id=\"textfield\" value=\"\" name=\"textfield\" 
id=\"textfield2\"/></label>");
        }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/92a5bdbd/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithinEnclosureTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithinEnclosureTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithinEnclosureTest.java
index 4c00b2f..5429900 100644
--- 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithinEnclosureTest.java
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithinEnclosureTest.java
@@ -46,7 +46,7 @@ public class AutoLabelWithinEnclosureTest extends 
WicketTestCase
        {
                tester.startPage(new LabelWithinEnclosurePage(true));
                tester.dumpPage();
-               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\">blabla</label>");
+               tester.assertContains("<label wicket:for=\"textfield\" 
for=\"textfield2\" id=\"textfield2-w-lbl\">blabla</label>");
        }
 
        @Test

Reply via email to