summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-04 14:20:25 +0300
committerArtur Signell <artur@vaadin.com>2014-08-04 15:20:10 +0300
commitaa25700c8aa2ae974e1c9e3ce3230335d8309814 (patch)
tree863c5aae5e8df3d1f3d91b2627490c56caed9ce6
parent49c0182999d6d4876291563e11fa64cfbd27d32f (diff)
downloadvaadin-framework-aa25700c8aa2ae974e1c9e3ce3230335d8309814.tar.gz
vaadin-framework-aa25700c8aa2ae974e1c9e3ce3230335d8309814.zip
Split test theme into separate themes and added theme selector
Change-Id: I076a05a393ae85bb68983eaa2756d36a0e92014e
-rw-r--r--WebContent/VAADIN/themes/tests-valo-blueprint/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_blueprint.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-blueprint/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo-dark/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_dark.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-dark/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo-facebook/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_facebook.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-facebook/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo-flat/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_flat.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-flat/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo-flatdark/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_flat-dark.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-flatdark/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo-metro/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_metro.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo-metro/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/tests-valo/_valotest.scss118
-rw-r--r--WebContent/VAADIN/themes/tests-valo/_variables.scss (renamed from WebContent/VAADIN/themes/tests-valo/_default.scss)0
-rw-r--r--WebContent/VAADIN/themes/tests-valo/styles.scss128
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Accordions.java6
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java32
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Forms.java16
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Tables.java36
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Tabsheets.java4
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/TestIcon.java8
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/Trees.java8
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ValoMiscTests.java8
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ValoThemeUI.java (renamed from uitest/src/com/vaadin/tests/themes/valo/ValoThemeTest.java)43
24 files changed, 253 insertions, 190 deletions
diff --git a/WebContent/VAADIN/themes/tests-valo/_blueprint.scss b/WebContent/VAADIN/themes/tests-valo-blueprint/_variables.scss
index 696da0b69e..696da0b69e 100644
--- a/WebContent/VAADIN/themes/tests-valo/_blueprint.scss
+++ b/WebContent/VAADIN/themes/tests-valo-blueprint/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-blueprint/styles.scss b/WebContent/VAADIN/themes/tests-valo-blueprint/styles.scss
new file mode 100644
index 0000000000..9433f4eba6
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-blueprint/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-blueprint {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_dark.scss b/WebContent/VAADIN/themes/tests-valo-dark/_variables.scss
index 21bcd00ae9..21bcd00ae9 100644
--- a/WebContent/VAADIN/themes/tests-valo/_dark.scss
+++ b/WebContent/VAADIN/themes/tests-valo-dark/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-dark/styles.scss b/WebContent/VAADIN/themes/tests-valo-dark/styles.scss
new file mode 100644
index 0000000000..13f98ae418
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-dark/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-dark {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_facebook.scss b/WebContent/VAADIN/themes/tests-valo-facebook/_variables.scss
index 5b83aae4ca..5b83aae4ca 100644
--- a/WebContent/VAADIN/themes/tests-valo/_facebook.scss
+++ b/WebContent/VAADIN/themes/tests-valo-facebook/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-facebook/styles.scss b/WebContent/VAADIN/themes/tests-valo-facebook/styles.scss
new file mode 100644
index 0000000000..7b784627b2
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-facebook/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-facebook {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_flat.scss b/WebContent/VAADIN/themes/tests-valo-flat/_variables.scss
index 5d2b8abbb7..5d2b8abbb7 100644
--- a/WebContent/VAADIN/themes/tests-valo/_flat.scss
+++ b/WebContent/VAADIN/themes/tests-valo-flat/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-flat/styles.scss b/WebContent/VAADIN/themes/tests-valo-flat/styles.scss
new file mode 100644
index 0000000000..7b981de04a
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-flat/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-flat {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_flat-dark.scss b/WebContent/VAADIN/themes/tests-valo-flatdark/_variables.scss
index f68f9c266d..f68f9c266d 100644
--- a/WebContent/VAADIN/themes/tests-valo/_flat-dark.scss
+++ b/WebContent/VAADIN/themes/tests-valo-flatdark/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-flatdark/styles.scss b/WebContent/VAADIN/themes/tests-valo-flatdark/styles.scss
new file mode 100644
index 0000000000..d0871fcba2
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-flatdark/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-flatdark {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_metro.scss b/WebContent/VAADIN/themes/tests-valo-metro/_variables.scss
index f11cdb8b64..f11cdb8b64 100644
--- a/WebContent/VAADIN/themes/tests-valo/_metro.scss
+++ b/WebContent/VAADIN/themes/tests-valo-metro/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo-metro/styles.scss b/WebContent/VAADIN/themes/tests-valo-metro/styles.scss
new file mode 100644
index 0000000000..51b3427a12
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-metro/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-metro {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/tests-valo/_valotest.scss b/WebContent/VAADIN/themes/tests-valo/_valotest.scss
new file mode 100644
index 0000000000..f775938e13
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo/_valotest.scss
@@ -0,0 +1,118 @@
+@mixin valotest {
+ @include valo;
+
+ .valo-menu .v-checkbox {
+ margin: round($v-unit-size/2);
+ font-weight: 400;
+ }
+
+ $color1: hsl(220, 5%, 38%);
+ $color2: #5d73c0;
+ $color3: #3dbc1a;
+ $color4: #d2f4f3;
+ $color5: #fe902a;
+ $colors: $color1, $color2, $color3, $color4, $color5;
+
+ .v-textfield-color1 {
+ @include valo-textfield-style($background-color: $color1);
+ }
+
+ .v-textfield-color2 {
+ @include valo-textfield-style($background-color: $color3);
+ }
+
+ .v-textfield-color3 {
+ @include valo-textfield-style($background-color: $color4);
+ }
+
+
+ .v-textarea-color1 {
+ @include valo-textarea-style($background-color: $color1);
+ }
+
+ .v-textarea-color2 {
+ @include valo-textarea-style($background-color: $color3);
+ }
+
+ .v-textarea-color3 {
+ @include valo-textarea-style($background-color: $color4);
+ }
+
+
+ .v-datefield-color1 {
+ @include valo-datefield-style($background-color: $color1);
+ }
+
+ .v-datefield-color2 {
+ @include valo-datefield-style($background-color: $color3);
+ }
+
+ .v-datefield-color3 {
+ @include valo-datefield-style($background-color: $color4);
+ }
+
+
+ .v-filterselect-color1 {
+ @include valo-combobox-style($background-color: $color1);
+ }
+
+ .v-filterselect-color2 {
+ @include valo-combobox-style($background-color: $color3);
+ }
+
+ .v-filterselect-color3 {
+ @include valo-combobox-style($background-color: $color4);
+ }
+
+
+ $copy: $v-selection-color;
+ $v-selection-color: white;
+ .v-checkbox-color1 {
+ @include valo-checkbox-style($background-color: $color1);
+ }
+
+ .v-checkbox-color2 {
+ @include valo-checkbox-style($background-color: $color2);
+ }
+ $v-selection-color: $copy;
+
+
+ .v-slider-color1 {
+ @include valo-slider-handle-style($background-color: $color1);
+ }
+
+ .v-slider-color2 {
+ @include valo-slider-track-style($background-color: $color3);
+ }
+
+ .v-slider-color3 {
+ @include valo-slider-indicator-style($background-color: #dcdc1e);
+ }
+
+
+ .v-panel-caption-color1 {
+ @include valo-panel-caption-style($background-color: $color1);
+ }
+
+ .v-panel-caption-color2 {
+ @include valo-panel-caption-style($background-color: $color3);
+ }
+
+ .v-panel-caption-color3 {
+ @include valo-panel-caption-style($background-color: $color5);
+ }
+
+ // Show splitpanel borders
+ .v-splitpanel-vertical,
+ .v-splitpanel-horizontal {
+ outline: 1px dotted rgba(gray, .2);
+ }
+
+ .v-slider-ticks {
+ @include valo-slider-ticks($tick-count: 5);
+ }
+
+ .v-accordion-item-color1 .v-accordion-item-caption {
+ @include valo-accordion-item-caption-style($background-color: $color2);
+ }
+} \ No newline at end of file
diff --git a/WebContent/VAADIN/themes/tests-valo/_default.scss b/WebContent/VAADIN/themes/tests-valo/_variables.scss
index c227156e2e..c227156e2e 100644
--- a/WebContent/VAADIN/themes/tests-valo/_default.scss
+++ b/WebContent/VAADIN/themes/tests-valo/_variables.scss
diff --git a/WebContent/VAADIN/themes/tests-valo/styles.scss b/WebContent/VAADIN/themes/tests-valo/styles.scss
index 89fc5755f4..1ba0b29b04 100644
--- a/WebContent/VAADIN/themes/tests-valo/styles.scss
+++ b/WebContent/VAADIN/themes/tests-valo/styles.scss
@@ -1,127 +1,5 @@
-@import "default";
-// @import "flat";
-// @import "flat-dark";
-// @import "facebook";
-// @import "metro";
-// @import "dark";
-// @import "blueprint";
-
-
+@import "variables";
+@import "valotest";
.tests-valo {
- @include valo;
-
- .valo-menu .v-checkbox {
- margin: round($v-unit-size/2);
- font-weight: 400;
- }
-
- $color1: hsl(220, 5%, 38%);
- $color2: #5d73c0;
- $color3: #3dbc1a;
- $color4: #d2f4f3;
- $color5: #fe902a;
- $colors: $color1, $color2, $color3, $color4, $color5;
-
- .v-textfield-color1 {
- @include valo-textfield-style($background-color: $color1);
- }
-
- .v-textfield-color2 {
- @include valo-textfield-style($background-color: $color3);
- }
-
- .v-textfield-color3 {
- @include valo-textfield-style($background-color: $color4);
- }
-
-
- .v-textarea-color1 {
- @include valo-textarea-style($background-color: $color1);
- }
-
- .v-textarea-color2 {
- @include valo-textarea-style($background-color: $color3);
- }
-
- .v-textarea-color3 {
- @include valo-textarea-style($background-color: $color4);
- }
-
-
- .v-datefield-color1 {
- @include valo-datefield-style($background-color: $color1);
- }
-
- .v-datefield-color2 {
- @include valo-datefield-style($background-color: $color3);
- }
-
- .v-datefield-color3 {
- @include valo-datefield-style($background-color: $color4);
- }
-
-
- .v-filterselect-color1 {
- @include valo-combobox-style($background-color: $color1);
- }
-
- .v-filterselect-color2 {
- @include valo-combobox-style($background-color: $color3);
- }
-
- .v-filterselect-color3 {
- @include valo-combobox-style($background-color: $color4);
- }
-
-
- $copy: $v-selection-color;
- $v-selection-color: white;
- .v-checkbox-color1 {
- @include valo-checkbox-style($background-color: $color1);
- }
-
- .v-checkbox-color2 {
- @include valo-checkbox-style($background-color: $color2);
- }
- $v-selection-color: $copy;
-
-
- .v-slider-color1 {
- @include valo-slider-handle-style($background-color: $color1);
- }
-
- .v-slider-color2 {
- @include valo-slider-track-style($background-color: $color3);
- }
-
- .v-slider-color3 {
- @include valo-slider-indicator-style($background-color: #dcdc1e);
- }
-
-
- .v-panel-caption-color1 {
- @include valo-panel-caption-style($background-color: $color1);
- }
-
- .v-panel-caption-color2 {
- @include valo-panel-caption-style($background-color: $color3);
- }
-
- .v-panel-caption-color3 {
- @include valo-panel-caption-style($background-color: $color5);
- }
-
- // Show splitpanel borders
- .v-splitpanel-vertical,
- .v-splitpanel-horizontal {
- outline: 1px dotted rgba(gray, .2);
- }
-
- .v-slider-ticks {
- @include valo-slider-ticks($tick-count: 5);
- }
-
- .v-accordion-item-color1 .v-accordion-item-caption {
- @include valo-accordion-item-caption-style($background-color: $color2);
- }
+ @include valotest;
}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Accordions.java b/uitest/src/com/vaadin/tests/themes/valo/Accordions.java
index b401451271..f483655bcd 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Accordions.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Accordions.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2013 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
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
index cafdfe37e0..5c1d188937 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java
@@ -40,15 +40,15 @@ public class ComboBoxes extends VerticalLayout implements View {
row.setSpacing(true);
addComponent(row);
- Container generatedContainer = ValoThemeTest.generateContainer(200,
- false);
+ Container generatedContainer = ValoThemeUI
+ .generateContainer(200, false);
ComboBox combo = new ComboBox("Normal");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
combo.setNullSelectionAllowed(false);
combo.select(generatedContainer.getItemIds().iterator().next());
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.setItemIcon(combo.getItemIds().iterator().next(),
new ThemeResource("../runo/icons/16/document.png"));
row.addComponent(combo);
@@ -63,8 +63,8 @@ public class ComboBoxes extends VerticalLayout implements View {
combo.setContainerDataSource(generatedContainer);
combo.setNullSelectionAllowed(false);
combo.select(generatedContainer.getItemIds().iterator().next());
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.setWidth("240px");
group.addComponent(combo);
Button today = new Button("Do It");
@@ -121,40 +121,40 @@ public class ComboBoxes extends VerticalLayout implements View {
combo = new ComboBox("Custom color");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.addStyleName("color1");
row.addComponent(combo);
combo = new ComboBox("Custom color");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.addStyleName("color2");
row.addComponent(combo);
combo = new ComboBox("Custom color");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.addStyleName("color3");
row.addComponent(combo);
combo = new ComboBox("Small");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.addStyleName("small");
row.addComponent(combo);
combo = new ComboBox("Large");
combo.setInputPrompt("You can type here");
combo.setContainerDataSource(generatedContainer);
- combo.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- combo.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
combo.addStyleName("large");
row.addComponent(combo);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Forms.java b/uitest/src/com/vaadin/tests/themes/valo/Forms.java
index 9451b5c5d3..2cea8e3f38 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Forms.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Forms.java
@@ -62,8 +62,8 @@ public class Forms extends VerticalLayout implements View {
form.addComponent(section);
TextField name = new TextField("Name");
- name.setValue(ValoThemeTest.nextString(true) + " "
- + ValoThemeTest.nextString(true));
+ name.setValue(ValoThemeUI.nextString(true) + " "
+ + ValoThemeUI.nextString(true));
name.setWidth("50%");
form.addComponent(name);
@@ -72,8 +72,8 @@ public class Forms extends VerticalLayout implements View {
form.addComponent(birthday);
TextField username = new TextField("Username");
- username.setValue(ValoThemeTest.nextString(false)
- + ValoThemeTest.nextString(false));
+ username.setValue(ValoThemeUI.nextString(false)
+ + ValoThemeUI.nextString(false));
username.setRequired(true);
form.addComponent(username);
@@ -89,15 +89,15 @@ public class Forms extends VerticalLayout implements View {
form.addComponent(section);
TextField email = new TextField("Email");
- email.setValue(ValoThemeTest.nextString(false) + "@"
- + ValoThemeTest.nextString(false) + ".com");
+ email.setValue(ValoThemeUI.nextString(false) + "@"
+ + ValoThemeUI.nextString(false) + ".com");
email.setWidth("50%");
email.setRequired(true);
form.addComponent(email);
TextField location = new TextField("Location");
- location.setValue(ValoThemeTest.nextString(true) + ", "
- + ValoThemeTest.nextString(true));
+ location.setValue(ValoThemeUI.nextString(true) + ", "
+ + ValoThemeUI.nextString(true));
location.setWidth("50%");
location.setComponentError(new UserError("This address doesn't exist"));
form.addComponent(location);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Tables.java b/uitest/src/com/vaadin/tests/themes/valo/Tables.java
index 6aa02a7f74..442e3e509a 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Tables.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Tables.java
@@ -1,12 +1,12 @@
/*
* 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
@@ -40,10 +40,9 @@ import com.vaadin.ui.VerticalLayout;
public class Tables extends VerticalLayout implements View {
- static final Container normalContainer = ValoThemeTest.generateContainer(
- 200, false);
- static final Container hierarchicalContainer = ValoThemeTest
- .generateContainer(200, true);
+ final Container normalContainer = ValoThemeUI.generateContainer(200, false);
+ final Container hierarchicalContainer = ValoThemeUI.generateContainer(200,
+ true);
CheckBox hierarchical = new CheckBox("Hierarchical");
CheckBox footer = new CheckBox("Footer", true);
@@ -140,7 +139,7 @@ public class Tables extends VerticalLayout implements View {
table.setColumnCollapsingAllowed(true);
table.setColumnReorderingAllowed(true);
table.setPageLength(6);
- table.addActionHandler(ValoThemeTest.getActionHandler());
+ table.addActionHandler(ValoThemeUI.getActionHandler());
table.setDragMode(TableDragMode.MULTIROW);
table.setDropHandler(new DropHandler() {
@Override
@@ -153,9 +152,8 @@ public class Tables extends VerticalLayout implements View {
Notification.show(event.getTransferable().toString());
}
});
- table.setColumnAlignment(ValoThemeTest.DESCRIPTION_PROPERTY,
- Align.RIGHT);
- table.setColumnAlignment(ValoThemeTest.INDEX_PROPERTY, Align.CENTER);
+ table.setColumnAlignment(ValoThemeUI.DESCRIPTION_PROPERTY, Align.RIGHT);
+ table.setColumnAlignment(ValoThemeUI.INDEX_PROPERTY, Align.CENTER);
table.removeContainerProperty("textfield");
table.addContainerProperty("textfield", TextField.class, null);
@@ -186,11 +184,11 @@ public class Tables extends VerticalLayout implements View {
table.setFooterVisible(footer);
if (footer) {
- table.setColumnFooter(ValoThemeTest.CAPTION_PROPERTY, "caption");
- table.setColumnFooter(ValoThemeTest.DESCRIPTION_PROPERTY,
+ table.setColumnFooter(ValoThemeUI.CAPTION_PROPERTY, "caption");
+ table.setColumnFooter(ValoThemeUI.DESCRIPTION_PROPERTY,
"description");
- table.setColumnFooter(ValoThemeTest.ICON_PROPERTY, "icon");
- table.setColumnFooter(ValoThemeTest.INDEX_PROPERTY, "index");
+ table.setColumnFooter(ValoThemeUI.ICON_PROPERTY, "icon");
+ table.setColumnFooter(ValoThemeUI.INDEX_PROPERTY, "index");
}
if (sized) {
@@ -205,9 +203,9 @@ public class Tables extends VerticalLayout implements View {
table.setWidth("100%");
}
}
- table.setColumnExpandRatio(ValoThemeTest.CAPTION_PROPERTY,
+ table.setColumnExpandRatio(ValoThemeUI.CAPTION_PROPERTY,
expandRatios ? 1.0f : 0);
- table.setColumnExpandRatio(ValoThemeTest.DESCRIPTION_PROPERTY,
+ table.setColumnExpandRatio(ValoThemeUI.DESCRIPTION_PROPERTY,
expandRatios ? 1.0f : 0);
if (!stripes) {
@@ -262,14 +260,14 @@ public class Tables extends VerticalLayout implements View {
if (rowCaption) {
table.setRowHeaderMode(RowHeaderMode.PROPERTY);
- table.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
+ table.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
} else {
table.setItemCaptionPropertyId(null);
}
if (rowIcon) {
table.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
- table.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ table.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
} else {
table.setItemIconPropertyId(null);
}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Tabsheets.java b/uitest/src/com/vaadin/tests/themes/valo/Tabsheets.java
index 24a249d90e..5ae0b04399 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Tabsheets.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Tabsheets.java
@@ -153,8 +153,8 @@ public class Tabsheets extends VerticalLayout implements View {
ts.addStyleName(style);
for (int i = 1; i <= (scrolling ? 10 : 3); i++) {
- String tabcaption = caption ? ValoThemeTest.nextString(true) + " "
- + ValoThemeTest.nextString(false) : null;
+ String tabcaption = caption ? ValoThemeUI.nextString(true) + " "
+ + ValoThemeUI.nextString(false) : null;
VerticalLayout content = new VerticalLayout();
content.setMargin(true);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/TestIcon.java b/uitest/src/com/vaadin/tests/themes/valo/TestIcon.java
index 18b834f1bf..f067df830a 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/TestIcon.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/TestIcon.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2013 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
@@ -24,7 +24,7 @@ import com.vaadin.server.Resource;
import com.vaadin.server.ThemeResource;
/**
- *
+ *
* @since
* @author Vaadin Ltd
*/
diff --git a/uitest/src/com/vaadin/tests/themes/valo/Trees.java b/uitest/src/com/vaadin/tests/themes/valo/Trees.java
index bb406e4f39..cb5657660a 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/Trees.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/Trees.java
@@ -45,12 +45,12 @@ public class Trees extends VerticalLayout implements View {
Tree tree = new Tree();
tree.setSelectable(true);
tree.setMultiSelect(true);
- Container generateContainer = ValoThemeTest.generateContainer(10, true);
+ Container generateContainer = ValoThemeUI.generateContainer(10, true);
tree.setContainerDataSource(generateContainer);
tree.setDragMode(TreeDragMode.NODE);
row.addComponent(tree);
- tree.setItemCaptionPropertyId(ValoThemeTest.CAPTION_PROPERTY);
- tree.setItemIconPropertyId(ValoThemeTest.ICON_PROPERTY);
+ tree.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
+ tree.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
tree.expandItem(generateContainer.getItemIds().iterator().next());
tree.setDropHandler(new DropHandler() {
@@ -66,7 +66,7 @@ public class Trees extends VerticalLayout implements View {
});
// Add actions (context menu)
- tree.addActionHandler(ValoThemeTest.getActionHandler());
+ tree.addActionHandler(ValoThemeUI.getActionHandler());
}
@Override
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoMiscTests.java b/uitest/src/com/vaadin/tests/themes/valo/ValoMiscTests.java
index 222dd90e49..1676d121af 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ValoMiscTests.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ValoMiscTests.java
@@ -1,12 +1,12 @@
/*
* 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
@@ -70,7 +70,7 @@ public class ValoMiscTests extends UI {
TreeTable table = new TreeTable();
table.setWidth("100%");
- table.setContainerDataSource(Tables.hierarchicalContainer);
+ table.setContainerDataSource(ValoThemeUI.generateContainer(200, true));
Tables.configure(table, true, false, false, true, true, true, false,
true, false, false, false, false, false);
layout.addComponent(table);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeTest.java b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUI.java
index 014b1acac8..8a0bf75b51 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeTest.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUI.java
@@ -1,12 +1,12 @@
/*
* 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
@@ -50,14 +50,25 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
+import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Notification;
import com.vaadin.ui.UI;
@Theme("tests-valo")
@Title("Valo Theme Test")
@PreserveOnRefresh
-public class ValoThemeTest extends UI {
-
+public class ValoThemeUI extends UI {
+
+ private static LinkedHashMap<String, String> themeVariants = new LinkedHashMap<String, String>();
+ static {
+ themeVariants.put("tests-valo", "Default");
+ themeVariants.put("tests-valo-blueprint", "Blueprint");
+ themeVariants.put("tests-valo-dark", "Dark");
+ themeVariants.put("tests-valo-facebook", "Facebook");
+ themeVariants.put("tests-valo-flatdark", "Flat dark");
+ themeVariants.put("tests-valo-flat", "Flat");
+ themeVariants.put("tests-valo-metro", "Metro");
+ }
ValoMenuLayout root = new ValoMenuLayout();
ComponentContainer viewDisplay = root.getContentContainer();
CssLayout menu = new CssLayout();
@@ -201,6 +212,7 @@ public class ValoThemeTest extends UI {
top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
top.addStyleName("valo-menu-title");
menu.addComponent(top);
+ menu.addComponent(createThemeSelect());
Label title = new Label("Vaadin<br><strong>Valo Theme Styles</strong>",
ContentMode.HTML);
@@ -281,6 +293,27 @@ public class ValoThemeTest extends UI {
return menu;
}
+ private Component createThemeSelect() {
+ final NativeSelect ns = new NativeSelect();
+ ns.setNullSelectionAllowed(false);
+ ns.setId("themeSelect");
+ ns.addContainerProperty("caption", String.class, "");
+ ns.setItemCaptionPropertyId("caption");
+ for (String identifier : themeVariants.keySet()) {
+ ns.addItem(identifier).getItemProperty("caption")
+ .setValue(themeVariants.get(identifier));
+ }
+
+ ns.setValue("tests-valo");
+ ns.addValueChangeListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ setTheme((String) ns.getValue());
+ }
+ });
+ return ns;
+ }
+
static String[] strings = new String[] { "lorem", "ipsum", "dolor", "sit",
"amet", "consectetur", "quid", "securi", "etiam", "tamquam", "eu",
"fugiat", "nulla", "pariatur" };