diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-12-07 15:48:38 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-12-07 15:48:38 +0000 |
commit | ede903d48329523a07dff5b820dfba410ae18e05 (patch) | |
tree | 69421df9188b8be3942973110f04390b550ceed9 | |
parent | 5257b56515beff2ef450aa4aaea3a3894bf00937 (diff) | |
download | vaadin-framework-ede903d48329523a07dff5b820dfba410ae18e05.tar.gz vaadin-framework-ede903d48329523a07dff5b820dfba410ae18e05.zip |
#2942 - Dual captions for TwinColSelect
Changed style names to be consistent with server side API
Added test for caption style names
svn changeset:16375/svn branch:6.5
10 files changed, 102 insertions, 14 deletions
diff --git a/WebContent/VAADIN/themes/base/select/select.css b/WebContent/VAADIN/themes/base/select/select.css index 646c91c7e0..c4247cc0d6 100644 --- a/WebContent/VAADIN/themes/base/select/select.css +++ b/WebContent/VAADIN/themes/base/select/select.css @@ -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; diff --git a/WebContent/VAADIN/themes/base/styles.css b/WebContent/VAADIN/themes/base/styles.css index a28199b791..f56728fcc5 100644 --- a/WebContent/VAADIN/themes/base/styles.css +++ b/WebContent/VAADIN/themes/base/styles.css @@ -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; diff --git a/WebContent/VAADIN/themes/liferay/styles.css b/WebContent/VAADIN/themes/liferay/styles.css index 32310d6a18..0f5eed7a0b 100644 --- a/WebContent/VAADIN/themes/liferay/styles.css +++ b/WebContent/VAADIN/themes/liferay/styles.css @@ -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; diff --git a/WebContent/VAADIN/themes/reindeer/styles.css b/WebContent/VAADIN/themes/reindeer/styles.css index 532bac85e2..0d7c5a7734 100644 --- a/WebContent/VAADIN/themes/reindeer/styles.css +++ b/WebContent/VAADIN/themes/reindeer/styles.css @@ -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; diff --git a/WebContent/VAADIN/themes/runo/styles.css b/WebContent/VAADIN/themes/runo/styles.css index 13e86faf1a..cb2473c5cd 100644 --- a/WebContent/VAADIN/themes/runo/styles.css +++ b/WebContent/VAADIN/themes/runo/styles.css @@ -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; diff --git a/WebContent/VAADIN/themes/tests-tickets/styles.css b/WebContent/VAADIN/themes/tests-tickets/styles.css index fba6a9b18b..7654f4663f 100644 --- a/WebContent/VAADIN/themes/tests-tickets/styles.css +++ b/WebContent/VAADIN/themes/tests-tickets/styles.css @@ -322,4 +322,13 @@ /*****************************************************************************/ .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; +} + diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html index 480c69be9f..e0bd240f24 100644 --- a/WebContent/release-notes.html +++ b/WebContent/release-notes.html @@ -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> diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java index eecb2aae85..ce3fd24e4c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java @@ -134,7 +134,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, public HTML getOptionsCaption() {
if (optionsCaption == null) {
optionsCaption = new HTML();
- optionsCaption.setStyleName(CLASSNAME + "-options-caption");
+ optionsCaption.setStyleName(CLASSNAME + "-caption-left");
optionsCaption.getElement().getStyle()
.setFloat(com.google.gwt.dom.client.Style.Float.LEFT);
captionWrapper.add(optionsCaption);
@@ -146,7 +146,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, public HTML getSelectionsCaption() {
if (selectionsCaption == null) {
selectionsCaption = new HTML();
- selectionsCaption.setStyleName(CLASSNAME + "-selections-caption");
+ selectionsCaption.setStyleName(CLASSNAME + "-caption-right");
selectionsCaption.getElement().getStyle()
.setFloat(com.google.gwt.dom.client.Style.Float.RIGHT);
captionWrapper.add(selectionsCaption);
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 index 0000000000..7fd4908673 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.select.TwinColSelectCaptionStyles?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>auto-auto</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsselectTwinColSelectCaptionStyles::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>500px-500px</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
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 index 0000000000..f3d147e32a --- /dev/null +++ b/tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java @@ -0,0 +1,42 @@ +package com.vaadin.tests.components.select;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.TwinColSelect;
+
+public class TwinColSelectCaptionStyles extends TestBase {
+
+ @Override
+ protected void setup() {
+ setTheme("tests-tickets");
+ final TwinColSelect sel = new TwinColSelect("Component caption");
+ sel.setLeftColumnCaption("Left caption");
+ sel.setRightColumnCaption("Right caption");
+ sel.setStyleName("styled-twincol-captions");
+ sel.setWidth("300px");
+ addComponent(sel);
+
+ Button b = new Button("Set height and width to 500px",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ sel.setHeight("500px");
+ sel.setWidth("500px");
+
+ }
+ });
+ addComponent(b);
+ }
+
+ @Override
+ protected String getDescription() {
+ 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.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
|