diff options
author | Denis Anisimov <denis@vaadin.com> | 2014-04-20 19:14:44 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-15 10:37:14 +0000 |
commit | d67022303ae9e4d3448012a07572f1bf3c71f46c (patch) | |
tree | c7d3f545f4b497ddfe9d10594d4461994530b64b | |
parent | f993f1a6e514919cf555105403d59c6214eb6d61 (diff) | |
download | vaadin-framework-d67022303ae9e4d3448012a07572f1bf3c71f46c.tar.gz vaadin-framework-d67022303ae9e4d3448012a07572f1bf3c71f46c.zip |
Set "v-formlayout" as the first style for VFormLayout (#13509).
Change-Id: I63f0b1c8da52d426b5c370097256b08dbd44b5d7
3 files changed, 89 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VFormLayout.java b/client/src/com/vaadin/client/ui/VFormLayout.java index a6d1f0cabb..7fd07a2093 100644 --- a/client/src/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/com/vaadin/client/ui/VFormLayout.java @@ -53,8 +53,8 @@ public class VFormLayout extends SimplePanel { public VFormLayout() { super(); - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); table = new VFormLayoutTable(); setWidget(table); } diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java new file mode 100644 index 0000000000..8ca88fbcd3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.formlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.FormLayout; + +/** + * Test UI for FormLayout: custom additional styles should be prefixed with + * "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefix extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + FormLayout layout = new FormLayout(); + layout.addStyleName("mystyle"); + addComponent(layout); + } + + @Override + protected String getTestDescription() { + return "Form layout should set v-formlayout style name instead of v-layout"; + } + + @Override + protected Integer getTicketNumber() { + return 13509; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java new file mode 100644 index 0000000000..c43dc0042e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.formlayout; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for FormLayout style prefix: custom additional styles should be prefixed + * with "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefixTest extends MultiBrowserTest { + + @Test + public void testStylePrefix() { + openTestURL(); + + Assert.assertTrue("Custom style has unexpected prefix", + isElementPresent(By.className("v-formlayout-mystyle"))); + } + +} |