summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-03-27 09:57:40 +0200
committerVaadin Code Review <review@vaadin.com>2013-04-03 07:55:39 +0000
commitbde44c29bdec4647dbec94b1ed2482baaf00cddf (patch)
treea8c2e855bbda0ad1180bf2ba72fe2cae28b7d83b /uitest
parentd7bfb3a99cf2dee5a7622645357bfd606585b283 (diff)
downloadvaadin-framework-bde44c29bdec4647dbec94b1ed2482baaf00cddf.tar.gz
vaadin-framework-bde44c29bdec4647dbec94b1ed2482baaf00cddf.zip
Implemented changes to CSS injection based on API review #5500
Change-Id: I2bed5f5a5c3cfc6b97e94cbd218bb06f446c7325
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java18
-rw-r--r--uitest/src/com/vaadin/tests/themes/CSSInjectTest.java10
2 files changed, 14 insertions, 14 deletions
diff --git a/uitest/src/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java b/uitest/src/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
index 09c5f91293..e3b8f997e0 100644
--- a/uitest/src/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
+++ b/uitest/src/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
@@ -5,7 +5,7 @@ import java.util.Arrays;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.StyleSheet;
+import com.vaadin.server.Page.Styles;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.colorpicker.Color;
@@ -125,10 +125,10 @@ public class CSSInjectWithColorpicker extends UI {
Color color = event.getColor();
// Get the stylesheet of the page
- StyleSheet styles = Page.getCurrent().getStyleSheet();
+ Styles styles = Page.getCurrent().getStyles();
// inject the new background color
- styles.inject(".v-app .v-textarea.text-label { background-color:"
+ styles.add(".v-app .v-textarea.text-label { background-color:"
+ color.getCSS() + "; }");
}
});
@@ -153,10 +153,10 @@ public class CSSInjectWithColorpicker extends UI {
Color color = event.getColor();
// Get the stylesheet of the page
- StyleSheet styles = Page.getCurrent().getStyleSheet();
+ Styles styles = Page.getCurrent().getStyles();
// inject the new color as a style
- styles.inject(".v-app .v-textarea.text-label { color:"
+ styles.add(".v-app .v-textarea.text-label { color:"
+ color.getCSS() + "; }");
}
});
@@ -186,11 +186,11 @@ public class CSSInjectWithColorpicker extends UI {
String fontFamily = select.getValue().toString();
// Get the stylesheet of the page
- StyleSheet styles = Page.getCurrent().getStyleSheet();
+ Styles styles = Page.getCurrent().getStyles();
// inject the new font size as a style. We need .v-app to
// override Vaadin's default styles here
- styles.inject(".v-app .v-textarea.text-label { font-family:"
+ styles.add(".v-app .v-textarea.text-label { font-family:"
+ fontFamily + "; }");
}
});
@@ -220,11 +220,11 @@ public class CSSInjectWithColorpicker extends UI {
Integer fontSize = (Integer) select.getValue();
// Get the stylesheet of the page
- StyleSheet styles = Page.getCurrent().getStyleSheet();
+ Styles styles = Page.getCurrent().getStyles();
// inject the new font size as a style. We need .v-app to
// override Vaadin's default styles here
- styles.inject(".v-app .v-textarea.text-label { font-size:"
+ styles.add(".v-app .v-textarea.text-label { font-size:"
+ String.valueOf(fontSize) + "px; }");
}
});
diff --git a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java
index bedbf47fe2..f4448bf326 100644
--- a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java
+++ b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java
@@ -5,7 +5,7 @@ import java.io.InputStream;
import java.util.UUID;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.StyleSheet;
+import com.vaadin.server.Page.Styles;
import com.vaadin.server.StreamResource;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
@@ -19,10 +19,10 @@ public class CSSInjectTest extends TestBase {
@Override
protected void setup() {
- final StyleSheet stylesheet = Page.getCurrent().getStyleSheet();
+ final Styles stylesheet = Page.getCurrent().getStyles();
// Inject some resources initially
- stylesheet.inject(new StreamResource(new StreamResource.StreamSource() {
+ stylesheet.add(new StreamResource(new StreamResource.StreamSource() {
@Override
public InputStream getStream() {
@@ -44,7 +44,7 @@ public class CSSInjectTest extends TestBase {
@Override
public void buttonClick(ClickEvent event) {
- stylesheet.inject(cssToInject.getValue());
+ stylesheet.add(cssToInject.getValue());
cssToInject.setValue("");
}
});
@@ -58,7 +58,7 @@ public class CSSInjectTest extends TestBase {
final String css = cssToInject.getValue();
- stylesheet.inject(new StreamResource(
+ stylesheet.add(new StreamResource(
new StreamResource.StreamSource() {
@Override