From: Matti Tahvonen Date: Tue, 1 Sep 2009 10:43:10 +0000 (+0000) Subject: Relocated CSS for the CssLayoutExample to the theme. X-Git-Tag: 6.7.0.beta1~2554 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3e134ee16a664d70335b17a36dd7ff905090dbab;p=vaadin-framework.git Relocated CSS for the CssLayoutExample to the theme. svn changeset:8608/svn branch:6.1 --- diff --git a/WebContent/VAADIN/themes/sampler/layouts/cssexample.css b/WebContent/VAADIN/themes/sampler/layouts/cssexample.css new file mode 100644 index 0000000000..12a90edf0f --- /dev/null +++ b/WebContent/VAADIN/themes/sampler/layouts/cssexample.css @@ -0,0 +1,26 @@ +.floatedpanel { + float:right; +} + +.footer { + width: 3in; + padding: 3px; + margin-left:auto; + margin-right:auto; + clear:both; + height:40px; + background-color: grey; + white-space:normal; +} + +.brick { + text-align:center; + width: 100px; + height: 100px; + margin: 10px; + padding:10px; + background-color:#1E2123; + color:white; + float:left; + border: 3px solid black; +} \ No newline at end of file diff --git a/WebContent/VAADIN/themes/sampler/styles.css b/WebContent/VAADIN/themes/sampler/styles.css index 2707893d3d..00f8978965 100644 --- a/WebContent/VAADIN/themes/sampler/styles.css +++ b/WebContent/VAADIN/themes/sampler/styles.css @@ -12,4 +12,6 @@ @import url(layouts/gridexample.css); +@import url(layouts/cssexample.css); + @import url(table/styles.css); \ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java b/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java index 04b2181b83..65ba2dab33 100644 --- a/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java +++ b/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java @@ -44,6 +44,7 @@ public class CssLayouts extends Feature { @Override public NamedExternalResource[] getRelatedResources() { - return null; + return new NamedExternalResource[] { new NamedExternalResource( + "CSS for the layout", getThemeBase() + "layouts/cssexample.css") }; } } diff --git a/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java b/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java index 6df40efeec..1e1bffbedc 100644 --- a/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java +++ b/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java @@ -13,20 +13,9 @@ public class CssLayoutsExample extends VerticalLayout { setMargin(true); /* - * Note that adding inline style like this is a very, VERY bad - * programming habit. The correct place for CSS is in the theme. We do - * it here to keep the CSS in the java code for demonstration purposes. + * Note, that this code example may not be self explanatory without + * checking out the related CSS file in the sampler theme. */ - Label demostyle = new Label( - "", Label.CONTENT_XHTML); - - addComponent(demostyle); final Panel panel = new Panel("Panel"); panel.setStyleName("floatedpanel");