]> source.dussan.org Git - vaadin-framework.git/commitdiff
Relocated CSS for the CssLayoutExample to the theme.
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 1 Sep 2009 10:43:10 +0000 (10:43 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 1 Sep 2009 10:43:10 +0000 (10:43 +0000)
svn changeset:8608/svn branch:6.1

WebContent/VAADIN/themes/sampler/layouts/cssexample.css [new file with mode: 0644]
WebContent/VAADIN/themes/sampler/styles.css
src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java
src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java

diff --git a/WebContent/VAADIN/themes/sampler/layouts/cssexample.css b/WebContent/VAADIN/themes/sampler/layouts/cssexample.css
new file mode 100644 (file)
index 0000000..12a90ed
--- /dev/null
@@ -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
index 2707893d3d5d356c6e3e6a58c70db431db933975..00f897896587b35533f51b80b98d780f5e441f64 100644 (file)
@@ -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
index 04b2181b83de0c9551edf70f8fdfad1cd7539bf9..65ba2dab33c29b962c9bfec64e6bea10c17e55de 100644 (file)
@@ -44,6 +44,7 @@ public class CssLayouts extends Feature {
 \r
     @Override\r
     public NamedExternalResource[] getRelatedResources() {\r
-        return null;\r
+        return new NamedExternalResource[] { new NamedExternalResource(\r
+                "CSS for the layout", getThemeBase() + "layouts/cssexample.css") };\r
     }\r
 }\r
index 6df40efeec3d8a18d8e058cf1615e7963822e351..1e1bffbedc41b32365eb189c943a190e6edbfe4f 100644 (file)
@@ -13,20 +13,9 @@ public class CssLayoutsExample extends VerticalLayout {
         setMargin(true);\r
 \r
         /*\r
-         * Note that adding inline style like this is a very, VERY bad\r
-         * programming habit. The correct place for CSS is in the theme. We do\r
-         * it here to keep the CSS in the java code for demonstration purposes.\r
+         * Note, that this code example may not be self explanatory without\r
+         * checking out the related CSS file in the sampler theme.\r
          */\r
-        Label demostyle = new Label(\r
-                "<style>"\r
-                        + ".floatedpanel {float:right;} "\r
-                        + ".footer {width: 3in; padding: 3px;margin-left:auto;margin-right:auto;"\r
-                        + "clear:both; height:40px; background-color: grey; white-space:normal;} "\r
-                        + ".brick {text-align:center;width: 100px; height: 100px; margin: 10px;padding:10px;"\r
-                        + "background-color:#1E2123; color:white;float:left; border: 3px solid black;} "\r
-                        + "</style>", Label.CONTENT_XHTML);\r
-\r
-        addComponent(demostyle);\r
 \r
         final Panel panel = new Panel("Panel");\r
         panel.setStyleName("floatedpanel");\r