diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2017-12-28 13:49:39 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-12-28 13:49:39 +0200 |
commit | edc3b08defa815d9f65a9589c7a252ad99ea40fa (patch) | |
tree | 3306cc2c06cf492aabc874531820a3ce3204f1de /uitest/src/main/java | |
parent | aa1371c84a5642c8b01603764291b746ff85f79d (diff) | |
download | vaadin-framework-edc3b08defa815d9f65a9589c7a252ad99ea40fa.tar.gz vaadin-framework-edc3b08defa815d9f65a9589c7a252ad99ea40fa.zip |
Allow setting custom styles to DateField calendar date cells (#10305)
Fixes #10304
Diffstat (limited to 'uitest/src/main/java')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldElementUI.java | 13 | ||||
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/datefield/DateTimeFieldElementUI.java | 15 |
2 files changed, 28 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldElementUI.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldElementUI.java index 4a578de91f..ecca4a22cb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldElementUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldElementUI.java @@ -6,6 +6,7 @@ import java.util.Locale; import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUIWithLog; +import com.vaadin.ui.Button; import com.vaadin.ui.DateField; import com.vaadin.ui.InlineDateField; @@ -18,6 +19,11 @@ public class DateFieldElementUI extends AbstractReindeerTestUIWithLog { @Override protected void setup(VaadinRequest request) { + getPage().getStyles() + .add(".v-inline-datefield .teststyle { background: yellow; }"); + getPage().getStyles() + .add(".v-datefield-popup .teststyle { background: yellow; }"); + log.setNumberLogRows(false); DateField df = new DateField(); df.addValueChangeListener(event -> log( @@ -42,6 +48,13 @@ public class DateFieldElementUI extends AbstractReindeerTestUIWithLog { usDatefield.addValueChangeListener( event -> log("US date field value set to " + event.getValue())); addComponent(usDatefield); + + addComponent(new Button("Add date styles", e -> { + inlineDateField.setDateStyle(LocalDate.now(), "teststyle"); + finnishDatefield.setDateStyle(LocalDate.of(2017, 12, 1), + "teststyle"); + usDatefield.setDateStyle(LocalDate.of(2017, 12, 1), "teststyle"); + })); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTimeFieldElementUI.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTimeFieldElementUI.java index f7f8e44736..1a16e94019 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTimeFieldElementUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateTimeFieldElementUI.java @@ -1,11 +1,13 @@ package com.vaadin.tests.components.datefield; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Locale; import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUIWithLog; +import com.vaadin.ui.Button; import com.vaadin.ui.DateTimeField; import com.vaadin.ui.InlineDateTimeField; @@ -18,6 +20,11 @@ public class DateTimeFieldElementUI extends AbstractReindeerTestUIWithLog { @Override protected void setup(VaadinRequest request) { + getPage().getStyles() + .add(".v-inline-datefield .teststyle { background: yellow; }"); + getPage().getStyles() + .add(".v-datefield-popup .teststyle { background: yellow; }"); + log.setNumberLogRows(false); DateTimeField df = new DateTimeField(); df.addValueChangeListener(event -> log( @@ -42,6 +49,14 @@ public class DateTimeFieldElementUI extends AbstractReindeerTestUIWithLog { usDateTimeField.addValueChangeListener( event -> log("US date field value set to " + event.getValue())); addComponent(usDateTimeField); + + addComponent(new Button("Add date styles", e -> { + inlineDateTimeField.setDateStyle(LocalDate.now(), "teststyle"); + finnishDateTimeField.setDateStyle(LocalDate.of(2017, 12, 1), + "teststyle"); + usDateTimeField.setDateStyle(LocalDate.of(2017, 12, 1), + "teststyle"); + })); } @Override |