From ede903d48329523a07dff5b820dfba410ae18e05 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 7 Dec 2010 15:48:38 +0000 Subject: [PATCH] #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 --- .../VAADIN/themes/base/select/select.css | 4 +- WebContent/VAADIN/themes/base/styles.css | 4 +- WebContent/VAADIN/themes/liferay/styles.css | 4 +- WebContent/VAADIN/themes/reindeer/styles.css | 4 +- WebContent/VAADIN/themes/runo/styles.css | 4 +- .../VAADIN/themes/tests-tickets/styles.css | 11 ++++- WebContent/release-notes.html | 2 +- .../gwt/client/ui/VTwinColSelect.java | 4 +- .../select/TwinColSelectCaptionStyles.html | 37 ++++++++++++++++ .../select/TwinColSelectCaptionStyles.java | 42 +++++++++++++++++++ 10 files changed, 102 insertions(+), 14 deletions(-) create mode 100644 tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.html create mode 100644 tests/src/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java 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.

.v-table-caption-container
DIV.
  • TwinColSelect DOM structure has changed slightly to support captions for the left and right column.
  • -
  • TwinColSelect now supports .v-select-twincol-options-caption and .v-select-twincol-selections-caption for the left and right captions.
  • +
  • TwinColSelect now supports .v-select-twincol-caption-left and .v-select-twincol-caption-right for the left and right captions.
  • New themeing possibilities:

    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 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    New Test
    open/run/com.vaadin.tests.components.select.TwinColSelectCaptionStyles?restartApplication
    screenCaptureauto-auto
    clickvaadin=runcomvaadintestscomponentsselectTwinColSelectCaptionStyles::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
    screenCapture500px-500px
    + + 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; + } + +} -- 2.39.5