From: Joonas Lehtinen Date: Mon, 18 Jun 2007 11:10:59 +0000 (+0000) Subject: CustomLayout for featurebrowser X-Git-Tag: 6.7.0.beta1~6229 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ffa51f6c680cd0ab4049762d75ddf9b98c3bd23;p=vaadin-framework.git CustomLayout for featurebrowser svn changeset:1759/svn branch:trunk --- diff --git a/WebContent/theme/demo/layout/featurebrowser-mainlayout.html b/WebContent/theme/demo/layout/featurebrowser-mainlayout.html index 69e9072bb8..d39d9cd3e6 100644 --- a/WebContent/theme/demo/layout/featurebrowser-mainlayout.html +++ b/WebContent/theme/demo/layout/featurebrowser-mainlayout.html @@ -4,15 +4,14 @@ -
-
-
+
+ +
+
puu
+
+ style="overflow: auto; position: absolute; top: 62px; left: 215px; "> @@ -22,192 +21,231 @@ - - -
-
- - - - - - -
-
-
-
Welcome to the IT Mill - Toolkit feature tour!
-
-
- - - - - - -
-
-
-
This - application lets you view and play with some features of IT - Mill Toolkit. Use menu on the left to select component.
-
- Note the Properties selection on the top right - corner. Click it open to access component properties and - feel free to edit properties at any time.
-
- The area that you are now reading is the component demo - area. Lower area from here contains component description, - API documentation and optional code sample. Note that not - all selections contain demo, only description and API - documentation is shown.
-
- You may also change application's theme from below the menu. - This example application is designed to work best with Demo - theme, other themes are for demonstration purposes only.
-
- IT Mill Toolkit enables you to construct complex Web - applications using plain Java, no knowledge of other Web - technologies such as XML, HTML, DOM, JavaScript or browser - differences is required.
-
- For more information, point your browser to www.itmill.com.
-
-
-
-
-
-
-
-
-
-
- - - - -
-
-
-
- - - - - - - - - - - - - - -
DescriptionPropertiesJavadocCode - Sample
-
-
-
- - - - - - -
-
- - - - -
-
-
-
-
-
-

Welcome

-
-
-
+ +
demo
+
-
-
-
-
-
This - area contains the selected component's description, list of - properties, javadoc and optional code sample. Start your tour now by - selecting features from the list on the left and remember to - experiment with the Properties panel located at the top right - corner area.
-
- IT Mill Toolkit version: 4.0.2
- Browser: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; - rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
-
-
+ +
+
tabs
-
-
-
-
- - + + + +
+
properties
+
+
+ style="overflow: hidden; position: absolute; bottom: 10px; left: 0pt; width: 200px; height: 50px;">
-
+ id="featurebrowser-control-left"> +
themes
- +
restart
+ +
+
+ style="overflow: hidden; position: absolute; width: 137px; height: 17px;" />
+ + + \ No newline at end of file diff --git a/WebContent/theme/demo/layout/img/header.png b/WebContent/theme/demo/layout/img/header.png index fa2582205c..bf64ac4e17 100644 Binary files a/WebContent/theme/demo/layout/img/header.png and b/WebContent/theme/demo/layout/img/header.png differ diff --git a/WebContent/theme/demo/layout/img/m_bg.png b/WebContent/theme/demo/layout/img/m_bg.png index 35b0f3e3c8..2d37f7ffae 100644 Binary files a/WebContent/theme/demo/layout/img/m_bg.png and b/WebContent/theme/demo/layout/img/m_bg.png differ diff --git a/WebContent/theme/demo/style.css b/WebContent/theme/demo/style.css index 460eb4caad..5a6d60f81b 100644 --- a/WebContent/theme/demo/style.css +++ b/WebContent/theme/demo/style.css @@ -6,31 +6,16 @@ border: 0; } -#featurebrowser-properties { - width: 0px; - background: #f5f5f5; -} - #featurebrowser-divider { background-image: url(layout/img/tab_handle.png); } #featurebrowser-mainlayout { - background-color: white; background-image: url(layout/img/m_bg.png); background-repeat: no-repeat; } -#featurebrowser-tabs { - background: white; -} - -#featurebrowser-properties-toggler { - position: absolute; - top: 15px; -} - #featurebrowser-features { position: absolute; overflow: auto; diff --git a/src/com/itmill/toolkit/demo/features/Feature.java b/src/com/itmill/toolkit/demo/features/Feature.java index 1a8caeeabf..482ad724a8 100644 --- a/src/com/itmill/toolkit/demo/features/Feature.java +++ b/src/com/itmill/toolkit/demo/features/Feature.java @@ -139,8 +139,6 @@ public abstract class Feature extends CustomComponent { ts.addTab(l, "Code Sample", null); } - layout.addComponent(ts); - } /** Get the desctiption of the feature as XHTML fragment */ @@ -153,6 +151,10 @@ public abstract class Feature extends CustomComponent { return this.getClass().getName(); } + public TabSheet getTabSheet() { + return ts; + } + /** Get the name of the image file that will be put on description page */ protected String getImage() { return null; diff --git a/src/com/itmill/toolkit/demo/features/FeatureBrowser.java b/src/com/itmill/toolkit/demo/features/FeatureBrowser.java index de29dc9522..4c279d681a 100644 --- a/src/com/itmill/toolkit/demo/features/FeatureBrowser.java +++ b/src/com/itmill/toolkit/demo/features/FeatureBrowser.java @@ -43,11 +43,7 @@ public class FeatureBrowser extends CustomComponent implements private Feature currentFeature = null; - private OrderedLayout layout; - - private Button propertiesSelect; - - private OrderedLayout right; + private CustomLayout mainlayout; private PropertyPanel properties; @@ -71,16 +67,12 @@ public class FeatureBrowser extends CustomComponent implements features.setStyle("menu"); // Configure component layout - layout = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - layout.setStyle("featurebrowser-mainlayout"); - setCompositionRoot(layout); - OrderedLayout left = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - left.addComponent(features); - layout.addComponent(left); + mainlayout = new CustomLayout("featurebrowser-mainlayout"); + setCompositionRoot(mainlayout); + mainlayout.addComponent(features, "tree"); // Theme selector - left.addComponent(themeSelector); + mainlayout.addComponent(themeSelector, "themes"); themeSelector.addItem("demo"); themeSelector.addItem("corporate"); themeSelector.addItem("base"); @@ -91,7 +83,7 @@ public class FeatureBrowser extends CustomComponent implements // Restart button Button close = new Button("restart", getApplication(), "close"); close.setStyle("link"); - left.addComponent(close); + mainlayout.addComponent(close,"restart"); // Test component registerFeature("/Welcome", new IntroWelcome()); @@ -148,18 +140,12 @@ public class FeatureBrowser extends CustomComponent implements // Add demo component and tabs currentFeature = new IntroWelcome(); - layout.addComponent(currentFeature); + mainlayout.addComponent(currentFeature, "demo"); + mainlayout.addComponent(currentFeature.getTabSheet(), "tabsheet"); // Add properties - right = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); - layout.addComponent(right); - - propertiesSelect = new Button("Show properties", this); - propertiesSelect.setSwitchMode(true); - right.addComponent(propertiesSelect); properties = currentFeature.getPropertyPanel(); - properties.setVisible(false); - right.addComponent(properties); + mainlayout.addComponent(properties, "properties"); } public void registerFeature(String path, Feature feature) { @@ -211,19 +197,14 @@ public class FeatureBrowser extends CustomComponent implements Property p = features.getContainerProperty(id, "feature"); Feature feature = p != null ? ((Feature) p.getValue()) : null; if (feature != null) { - layout.replaceComponent(currentFeature, feature); + mainlayout.removeComponent(currentFeature); + mainlayout.removeComponent(currentFeature.getTabSheet()); + mainlayout.addComponent(feature,"demo"); + mainlayout.addComponent(feature.getTabSheet(),"tabsheet"); currentFeature = feature; properties = feature.getPropertyPanel(); if (properties != null) { - Iterator i = right.getComponentIterator(); - i.next(); - PropertyPanel oldProps = (PropertyPanel) i.next(); - if (oldProps != null) - right.replaceComponent(oldProps, properties); - else - right.addComponent(properties); - properties.setVisible(((Boolean) propertiesSelect - .getValue()).booleanValue()); + mainlayout.addComponent(properties,"properties"); } getWindow() .setCaption( @@ -248,9 +229,6 @@ public class FeatureBrowser extends CustomComponent implements // ignored, should never happen } - if (properties != null) - properties.setVisible(((Boolean) propertiesSelect.getValue()) - .booleanValue()); } public void addComponent(Component c) { diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java index b2063972db..10279afd91 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java @@ -33,7 +33,7 @@ public class ICustomLayout extends SimplePanel implements Paintable, Layout { updateHTML(uidl, client); componentToWrapper.clear(); - + html.clear(); for (Iterator i = uidl.getChildIterator(); i.hasNext();) { UIDL uidlForChild = (UIDL) i.next(); if (uidlForChild.getTag().equals("location")) {