diff options
Diffstat (limited to 'src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java')
-rw-r--r-- | src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java | 125 |
1 files changed, 65 insertions, 60 deletions
diff --git a/src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java b/src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java index 5d18cd8870..4792baaed9 100644 --- a/src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java +++ b/src/com/itmill/toolkit/tests/featurebrowser/FeatureOrderedLayout.java @@ -28,68 +28,73 @@ package com.itmill.toolkit.tests.featurebrowser; -import com.itmill.toolkit.ui.*; +import com.itmill.toolkit.ui.Component; +import com.itmill.toolkit.ui.Form; +import com.itmill.toolkit.ui.OrderedLayout; +import com.itmill.toolkit.ui.Select; +import com.itmill.toolkit.ui.TextField; public class FeatureOrderedLayout extends Feature { - public FeatureOrderedLayout() { - super(); - } - - protected Component getDemoComponent() { - - OrderedLayout l = new OrderedLayout(); - - OrderedLayout ol = new OrderedLayout(); - for (int i = 1; i < 5; i++) - ol.addComponent(new TextField("Test component " + i)); - l.addComponent(ol); - - // Properties - propertyPanel = new PropertyPanel(ol); - Form ap = propertyPanel - .createBeanPropertySet(new String[] { "orientation" }); - ap.replaceWithSelect("orientation", new Object[] { - new Integer(OrderedLayout.ORIENTATION_HORIZONTAL), - new Integer(OrderedLayout.ORIENTATION_VERTICAL) }, - new Object[] { "Horizontal", "Vertical" }); - Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("form").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("form"); - propertyPanel.addProperties("OrderedLayout Properties", ap); - - setJavadocURL("ui/OrderedLayout.html"); - - return l; - } - - protected String getExampleSrc() { - return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n" - + "ol.addComponent(new TextField(\"Textfield caption\"));\n" - + "ol.addComponent(new Label(\"Label\"));\n"; - - } - - /** - * @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - protected String getDescriptionXHTML() { - return "This feature provides a container for laying out components either " - + "vertically, horizontally or flowingly. The orientation may be changed " - + "during runtime. It also defines a special style for themes to implement called \"form\"" - + "that is used for input forms where the components are laid-out side-by-side " - + "with their captions." - + "<br /><br />" - + "On the demo tab you can try out how the different properties " - + "affect the presentation of the component."; - } - - protected String getImage() { - return "icon_demo.png"; - } - - protected String getTitle() { - return "OrderedLayout"; - } + public FeatureOrderedLayout() { + super(); + } + + protected Component getDemoComponent() { + + OrderedLayout l = new OrderedLayout(); + + OrderedLayout ol = new OrderedLayout(); + for (int i = 1; i < 5; i++) { + ol.addComponent(new TextField("Test component " + i)); + } + l.addComponent(ol); + + // Properties + propertyPanel = new PropertyPanel(ol); + Form ap = propertyPanel + .createBeanPropertySet(new String[] { "orientation" }); + ap.replaceWithSelect("orientation", new Object[] { + new Integer(OrderedLayout.ORIENTATION_HORIZONTAL), + new Integer(OrderedLayout.ORIENTATION_VERTICAL) }, + new Object[] { "Horizontal", "Vertical" }); + Select themes = (Select) propertyPanel.getField("style"); + themes.addItem("form").getItemProperty( + themes.getItemCaptionPropertyId()).setValue("form"); + propertyPanel.addProperties("OrderedLayout Properties", ap); + + setJavadocURL("ui/OrderedLayout.html"); + + return l; + } + + protected String getExampleSrc() { + return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n" + + "ol.addComponent(new TextField(\"Textfield caption\"));\n" + + "ol.addComponent(new Label(\"Label\"));\n"; + + } + + /** + * @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML() + */ + protected String getDescriptionXHTML() { + return "This feature provides a container for laying out components either " + + "vertically, horizontally or flowingly. The orientation may be changed " + + "during runtime. It also defines a special style for themes to implement called \"form\"" + + "that is used for input forms where the components are laid-out side-by-side " + + "with their captions." + + "<br /><br />" + + "On the demo tab you can try out how the different properties " + + "affect the presentation of the component."; + } + + protected String getImage() { + return "icon_demo.png"; + } + + protected String getTitle() { + return "OrderedLayout"; + } } |