]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2942 - Dual captions for TwinColSelect
authorArtur Signell <artur.signell@itmill.com>
Tue, 7 Dec 2010 15:48:38 +0000 (15:48 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 7 Dec 2010 15:48:38 +0000 (15:48 +0000)
Changed style names to be consistent with server side API
Added test for caption style names

svn changeset:16375/svn branch:6.5

WebContent/VAADIN/themes/base/select/select.css
WebContent/VAADIN/themes/base/styles.css
WebContent/VAADIN/themes/liferay/styles.css
WebContent/VAADIN/themes/reindeer/styles.css
WebContent/VAADIN/themes/runo/styles.css
WebContent/VAADIN/themes/tests-tickets/styles.css
WebContent/release-notes.html
src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java
tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java [new file with mode: 0644]

index 646c91c7e00efd703f71281ee2de7a2000b4602d..c4247cc0d63f742638f72e5a18988c066085ade1 100644 (file)
@@ -17,7 +17,7 @@
 .v-select-twincol-options {
        float: left;
 }
-.v-select-twincol-options-caption {
+.v-select-twincol-caption-left {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
@@ -25,7 +25,7 @@
 .v-select-twincol-selections {
        font-weight: bold;
 }
-.v-select-twincol-selections-caption {
+.v-select-twincol-caption-right {
        float: right;
        overflow: hidden;
        text-overflow: ellipsis;
index a28199b791cbf9f02ffc32548d78d7e800881a86..f56728fcc5f1a12bf50b5deb7302487c1df70078 100644 (file)
@@ -1107,7 +1107,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-options {
        float: left;
 }
-.v-select-twincol-options-caption {
+.v-select-twincol-caption-left {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
@@ -1115,7 +1115,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-selections {
        font-weight: bold;
 }
-.v-select-twincol-selections-caption {
+.v-select-twincol-caption-right {
        float: right;
        overflow: hidden;
        text-overflow: ellipsis;
index 32310d6a18ac0ab436999949cd58c92420183b61..0f5eed7a0be1d5db1b422dd5818f04bf9bfd0e3c 100644 (file)
@@ -1107,7 +1107,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-options {
        float: left;
 }
-.v-select-twincol-options-caption {
+.v-select-twincol-caption-left {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
@@ -1115,7 +1115,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-selections {
        font-weight: bold;
 }
-.v-select-twincol-selections-caption {
+.v-select-twincol-caption-right {
        float: right;
        overflow: hidden;
        text-overflow: ellipsis;
index 532bac85e2fdeed4e844a31dc82988b7964b67be..0d7c5a77348535076827665b9cf0fa17701148e1 100644 (file)
@@ -1107,7 +1107,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-options {
        float: left;
 }
-.v-select-twincol-options-caption {
+.v-select-twincol-caption-left {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
@@ -1115,7 +1115,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-selections {
        font-weight: bold;
 }
-.v-select-twincol-selections-caption {
+.v-select-twincol-caption-right {
        float: right;
        overflow: hidden;
        text-overflow: ellipsis;
index 13e86faf1a7f2d32f93e7d286d724f166b50af8e..cb2473c5cdbfe8d915695a74b447c056c74bf51b 100644 (file)
@@ -1107,7 +1107,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-options {
        float: left;
 }
-.v-select-twincol-options-caption {
+.v-select-twincol-caption-left {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
@@ -1115,7 +1115,7 @@ div.v-progressindicator-indeterminate-disabled {
 .v-select-twincol-selections {
        font-weight: bold;
 }
-.v-select-twincol-selections-caption {
+.v-select-twincol-caption-right {
        float: right;
        overflow: hidden;
        text-overflow: ellipsis;
index fba6a9b18b0dd6e04c1f48002d5bcdf187f1b3da..7654f4663f27ce1f7140d4fbdf4cdd46ba0b2f02 100644 (file)
 /*****************************************************************************/
 .v-view { 
        background: #fff;
-}
\ No newline at end of file
+}
+
+.styled-twincol-captions .v-select-twincol-caption-left {
+       color: red; 
+}
+.styled-twincol-captions .v-select-twincol-caption-right {
+       font-size: 30px;
+       color: blue;
+}
+
index 480c69be9fb4abc5976e961f14eedc854aa8b1df..e0bd240f24cbb2a4c6c5905f4489ca3df1a662fe 100644 (file)
@@ -95,7 +95,7 @@ contains a number of significant enhancements.</p>
                        <pre>.v-table-caption-container</pre> DIV.</li>
        </ul>
        <li>TwinColSelect DOM structure has changed slightly to support captions for the left and right column.</li>
-       <li>TwinColSelect now supports .v-select-twincol-options-caption and .v-select-twincol-selections-caption for the left and right captions.</li>
+       <li>TwinColSelect now supports .v-select-twincol-caption-left and .v-select-twincol-caption-right for the left and right captions.</li>
 </ul>
 
 <p>New themeing possibilities:</p>
index eecb2aae859549637bc11c503d1a8c3c6f3c683c..ce3fd24e4ca1067534c8a8785f95b6d9ab37c34c 100644 (file)
@@ -134,7 +134,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
     public HTML getOptionsCaption() {\r
         if (optionsCaption == null) {\r
             optionsCaption = new HTML();\r
-            optionsCaption.setStyleName(CLASSNAME + "-options-caption");\r
+            optionsCaption.setStyleName(CLASSNAME + "-caption-left");\r
             optionsCaption.getElement().getStyle()\r
                     .setFloat(com.google.gwt.dom.client.Style.Float.LEFT);\r
             captionWrapper.add(optionsCaption);\r
@@ -146,7 +146,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
     public HTML getSelectionsCaption() {\r
         if (selectionsCaption == null) {\r
             selectionsCaption = new HTML();\r
-            selectionsCaption.setStyleName(CLASSNAME + "-selections-caption");\r
+            selectionsCaption.setStyleName(CLASSNAME + "-caption-right");\r
             selectionsCaption.getElement().getStyle()\r
                     .setFloat(com.google.gwt.dom.client.Style.Float.RIGHT);\r
             captionWrapper.add(selectionsCaption);\r
diff --git a/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.html b/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.html
new file mode 100644 (file)
index 0000000..7fd4908
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<link rel="selenium.base" href="" />\r
+<title>New Test</title>\r
+</head>\r
+<body>\r
+<table cellpadding="1" cellspacing="1" border="1">\r
+<thead>\r
+<tr><td rowspan="1" colspan="3">New Test</td></tr>\r
+</thead><tbody>\r
+<tr>\r
+       <td>open</td>\r
+       <td>/run/com.vaadin.tests.components.select.TwinColSelectCaptionStyles?restartApplication</td>\r
+       <td></td>\r
+</tr>\r
+<tr>\r
+       <td>screenCapture</td>\r
+       <td></td>\r
+       <td>auto-auto</td>\r
+</tr>\r
+<tr>\r
+       <td>click</td>\r
+       <td>vaadin=runcomvaadintestscomponentsselectTwinColSelectCaptionStyles::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>\r
+       <td></td>\r
+</tr>\r
+<tr>\r
+       <td>screenCapture</td>\r
+       <td></td>\r
+       <td>500px-500px</td>\r
+</tr>\r
+\r
+</tbody></table>\r
+</body>\r
+</html>\r
diff --git a/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java b/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java
new file mode 100644 (file)
index 0000000..f3d147e
--- /dev/null
@@ -0,0 +1,42 @@
+package com.vaadin.tests.components.select;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+import com.vaadin.ui.TwinColSelect;\r
+\r
+public class TwinColSelectCaptionStyles extends TestBase {\r
+\r
+    @Override\r
+    protected void setup() {\r
+        setTheme("tests-tickets");\r
+        final TwinColSelect sel = new TwinColSelect("Component caption");\r
+        sel.setLeftColumnCaption("Left caption");\r
+        sel.setRightColumnCaption("Right caption");\r
+        sel.setStyleName("styled-twincol-captions");\r
+        sel.setWidth("300px");\r
+        addComponent(sel);\r
+\r
+        Button b = new Button("Set height and width to 500px",\r
+                new Button.ClickListener() {\r
+\r
+                    public void buttonClick(ClickEvent event) {\r
+                        sel.setHeight("500px");\r
+                        sel.setWidth("500px");\r
+\r
+                    }\r
+                });\r
+        addComponent(b);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Tests that caption styling for TwinColSelect captions work properly. The left caption should be red and the right caption blue and larger than the left one.";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return null;\r
+    }\r
+\r
+}\r