]> source.dussan.org Git - vaadin-framework.git/commitdiff
Could not make customlayout scroll as wanted, implemented w/o customlayout, fixes...
authorMarc Englund <marc.englund@itmill.com>
Thu, 8 Jan 2009 11:30:58 +0000 (11:30 +0000)
committerMarc Englund <marc.englund@itmill.com>
Thu, 8 Jan 2009 11:30:58 +0000 (11:30 +0000)
svn changeset:6451/svn branch:trunk

WebContent/ITMILL/themes/sampler/layouts/featureview.html [deleted file]
WebContent/ITMILL/themes/sampler/sampler/styles.css
src/com/itmill/toolkit/demo/sampler/FeatureView.java

diff --git a/WebContent/ITMILL/themes/sampler/layouts/featureview.html b/WebContent/ITMILL/themes/sampler/layouts/featureview.html
deleted file mode 100644 (file)
index 31937e0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<table width="100%" height="100%" cellpadding="0" cellspacing="0">
-       <tbody>
-               <tr valign="top">
-                       <td class="feature-main">
-                               <div class="feature-controls" location="feature-controls"></div>
-                               <div class="feature-example" location="feature-example"></div>
-                       </td>
-                       <td width="350px" class="feature-info">
-                               <div class="feature-name" location="feature-name"></div>
-                               <div class="feature-desc" location="feature-desc"></div>
-                               <div class="feature-res" location="feature-res"></div>
-                               <div class="feature-api" location="feature-api"></div>
-                               <div class="feature-rel" location="feature-rel"></div>
-                       </td>
-       </tbody>
-</table>
\ No newline at end of file
index 0ca6ec605573901bc961cc1ca7b4c603a7ecb5b4..40b985d1f5a84a15a9d610b901dbea90303cbca4 100644 (file)
        border-top: 0px;
 }
 
-.i-app-SamplerApplication .feature-main {
-       padding: 0px 5px 0px 5px;
-}
-.i-app-SamplerApplication .feature-controls {
-       padding-top: 10px;
-}
-.i-app-SamplerApplication .feature-controls .i-caption {
+.i-app-SamplerApplication .i-caption-feature-controls {
        font-weight: bold;
        font-size: 16px;
        text-indent: 10px;
 }
-
 .i-app-SamplerApplication .feature-info {
        background-color: #999;
        color: white;
-       padding: 20px;
        line-height: 20px;
 }
 .i-app-SamplerApplication .feature-info div.i-link a {
        color: white;
        line-height: 20px;
 }
-.i-app-SamplerApplication .feature-name {
+.i-app-SamplerApplication .feature-info .i-panel-caption {
+       color: #fff;
        font-size: 22px;
        font-weight: bold;
        line-height: 35px;
        font-weight: bold;
        font-size: 16px;
        line-height: 30px;
-       padding-top: 10px;
-}
-.i-app-SamplerApplication .feature-example {
-       padding: 10px;
-       padding-top: 20px;
 }
 
 .i-app-SamplerApplication .i-button-showcode {
index 4404db08e3b49864e5dc30bb784c4efdc7649c17..43ecf372f41235bc3e333c2bb8b3e9a2d522b512 100644 (file)
@@ -8,19 +8,23 @@ import com.itmill.toolkit.demo.sampler.SamplerApplication.SamplerWindow;
 import com.itmill.toolkit.terminal.ExternalResource;
 import com.itmill.toolkit.ui.Button;
 import com.itmill.toolkit.ui.Component;
-import com.itmill.toolkit.ui.CustomLayout;
+import com.itmill.toolkit.ui.HorizontalLayout;
 import com.itmill.toolkit.ui.Label;
 import com.itmill.toolkit.ui.Link;
 import com.itmill.toolkit.ui.OrderedLayout;
 import com.itmill.toolkit.ui.Panel;
+import com.itmill.toolkit.ui.VerticalLayout;
 import com.itmill.toolkit.ui.Button.ClickEvent;
 
-public class FeatureView extends CustomLayout {
+public class FeatureView extends HorizontalLayout {
 
     private static final String MSG_SHOW_SRC = "⊞ Show Java™ source";
     private static final String MSG_HIDE_SRC = "⊟ Hide Java™ source";
 
-    private OrderedLayout controls;
+    private Panel right;
+    private Panel left;
+
+    private VerticalLayout controls;
 
     private Panel sourcePanel;
     private Label sourceCode;
@@ -31,9 +35,26 @@ public class FeatureView extends CustomLayout {
     private Feature currentFeature;
 
     public FeatureView() {
-        super("featureview");
 
-        controls = new OrderedLayout();
+        setSizeFull();
+
+        left = new Panel();
+        left.setStyleName(Panel.STYLE_LIGHT);
+        left.addStyleName("feature-main");
+        left.setSizeFull();
+        ((VerticalLayout) left.getLayout()).setSpacing(true);
+        addComponent(left);
+        setExpandRatio(left, 1);
+
+        right = new Panel();
+        right.setStyleName(Panel.STYLE_LIGHT);
+        right.addStyleName("feature-info");
+        right.setWidth("350px");
+        right.setHeight("100%");
+        addComponent(right);
+
+        controls = new VerticalLayout();
+        controls.setStyleName("feature-controls");
         controls.setCaption("Live example");
         showCode = new Button(MSG_SHOW_SRC, new Button.ClickListener() {
             public void buttonClick(ClickEvent event) {
@@ -46,7 +67,6 @@ public class FeatureView extends CustomLayout {
         controls.addComponent(showCode);
 
         sourceCode = new CodeLabel();
-        sourceCode.setContentMode(Label.CONTENT_PREFORMATTED);
 
         sourcePanel = new Panel();
         sourcePanel.getLayout().setSizeUndefined();
@@ -71,19 +91,19 @@ public class FeatureView extends CustomLayout {
 
     public void setFeature(Feature feature) {
         if (feature != currentFeature) {
-            removeAllComponents();
+            right.removeAllComponents();
+            left.removeAllComponents();
             showSource(false);
 
-            addComponent(controls, "feature-controls");
+            left.addComponent(controls);
 
-            addComponent(getExampleFor(feature), "feature-example");
+            left.addComponent(getExampleFor(feature));
 
-            Label l = new Label(feature.getName());
-            addComponent(l, "feature-name");
+            right.setCaption(feature.getName());
 
-            l = new Label(feature.getDescription());
+            Label l = new Label(feature.getDescription());
             l.setContentMode(Label.CONTENT_XHTML);
-            addComponent(l, "feature-desc");
+            right.addComponent(l);
 
             sourceCode.setValue(feature.getSource());
 
@@ -94,17 +114,17 @@ public class FeatureView extends CustomLayout {
                 for (NamedExternalResource r : resources) {
                     res.addComponent(new Link(r.getName(), r));
                 }
-                addComponent(res, "feature-res");
+                right.addComponent(res);
             }
 
             APIResource[] apis = feature.getRelatedAPI();
             if (apis != null) {
                 OrderedLayout api = new OrderedLayout();
                 api.setCaption("API documentation");
-                addComponent(api, "feature-api");
                 for (APIResource r : apis) {
                     api.addComponent(new Link(r.getName(), r));
                 }
+                right.addComponent(api);
             }
 
             Class[] features = feature.getRelatedFeatures();
@@ -134,7 +154,7 @@ public class FeatureView extends CustomLayout {
                         rel.addComponent(al);
                     }
                 }
-                addComponent(rel, "feature-rel");
+                right.addComponent(rel);
             }
         }