From: Marc Englund Date: Thu, 8 Jan 2009 11:30:58 +0000 (+0000) Subject: Could not make customlayout scroll as wanted, implemented w/o customlayout, fixes... X-Git-Tag: 6.7.0.beta1~3390 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e3a5ac3529ced108c4db0192b29246f65e9d5650;p=vaadin-framework.git Could not make customlayout scroll as wanted, implemented w/o customlayout, fixes #2362 svn changeset:6451/svn branch:trunk --- diff --git a/WebContent/ITMILL/themes/sampler/layouts/featureview.html b/WebContent/ITMILL/themes/sampler/layouts/featureview.html deleted file mode 100644 index 31937e0e67..0000000000 --- a/WebContent/ITMILL/themes/sampler/layouts/featureview.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -
-
-
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/WebContent/ITMILL/themes/sampler/sampler/styles.css b/WebContent/ITMILL/themes/sampler/sampler/styles.css index 0ca6ec6055..40b985d1f5 100644 --- a/WebContent/ITMILL/themes/sampler/sampler/styles.css +++ b/WebContent/ITMILL/themes/sampler/sampler/styles.css @@ -74,29 +74,22 @@ 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; @@ -106,11 +99,6 @@ 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 { diff --git a/src/com/itmill/toolkit/demo/sampler/FeatureView.java b/src/com/itmill/toolkit/demo/sampler/FeatureView.java index 4404db08e3..43ecf372f4 100644 --- a/src/com/itmill/toolkit/demo/sampler/FeatureView.java +++ b/src/com/itmill/toolkit/demo/sampler/FeatureView.java @@ -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); } }