diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2008-04-07 15:38:15 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2008-04-07 15:38:15 +0000 |
commit | f51577b7567821f8bb13ecaa60eb101f708e6147 (patch) | |
tree | 10cef62ed79d94aba6e83d76f0b753f1f3cc1410 /src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java | |
parent | 638fe9899be27b8f4f92dc4750f813c1210ecb1f (diff) | |
download | vaadin-framework-f51577b7567821f8bb13ecaa60eb101f708e6147.tar.gz vaadin-framework-f51577b7567821f8bb13ecaa60eb101f708e6147.zip |
Created com.itmill.toolkit.automatedtests package which contains "official" automated tests
* do not touch them unless you change automated test client's testcase scripts too.
* copy your testing application to package com.itmill.toolkit.automatedtests
* do not point to "development / testing / production" packages which are edited in the future without relation to testing
* use setDebugId's for all components that are used in testing
Moved few classes from "experimental" com.itmill.toolkit.tests package into "official" side.
Copied featurebrowser to automatedtests package and added setDebugId's for most components that are used in the testing.
svn changeset:4138/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java')
-rw-r--r-- | src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java b/src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java new file mode 100644 index 0000000000..184e3f1812 --- /dev/null +++ b/src/com/itmill/toolkit/automatedtests/featurebrowser/LayoutExample.java @@ -0,0 +1,91 @@ +/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
+package com.itmill.toolkit.automatedtests.featurebrowser;
+
+import com.itmill.toolkit.ui.CustomComponent;
+import com.itmill.toolkit.ui.GridLayout;
+import com.itmill.toolkit.ui.Label;
+import com.itmill.toolkit.ui.OrderedLayout;
+import com.itmill.toolkit.ui.Panel;
+import com.itmill.toolkit.ui.TabSheet;
+
+/**
+ * A few examples of layout possibilities.
+ *
+ * @author IT Mill Ltd.
+ */
+public class LayoutExample extends CustomComponent {
+
+ public LayoutExample() {
+
+ final OrderedLayout main = new OrderedLayout();
+ main.setMargin(true);
+ setCompositionRoot(main);
+
+ final GridLayout g = new GridLayout(2, 5);
+ main.addComponent(g);
+
+ // panel
+ Panel p = new Panel("This is a normal panel");
+ p.setDebugId("NormalPanel");
+ Label l = new Label("A normal panel.");
+ p.addComponent(l);
+ g.addComponent(p);
+ // lightpanel
+ p = new Panel("This is a light panel");
+ p.setDebugId("LightPanel");
+ p.setStyleName(Panel.STYLE_LIGHT);
+ l = new Label("A light-style panel.");
+ p.addComponent(l);
+ g.addComponent(p);
+
+ TabSheet ts = new TabSheet();
+ g.addComponent(ts, 0, 1, 1, 1);
+
+ OrderedLayout ol = new OrderedLayout();
+ ol.setDebugId("VerticalOrderedLayout");
+ ol.setMargin(true);
+ ol.addComponent(new Label("Component 1"));
+ ol.addComponent(new Label("Component 2"));
+ ol.addComponent(new Label("Component 3"));
+ ts.addTab(ol, "Vertical OrderedLayout", null);
+
+ ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL);
+ ol.setDebugId("HorizontalOrderedLayout");
+ ol.setMargin(true);
+ ol.addComponent(new Label("Component 1"));
+ ol.addComponent(new Label("Component 2"));
+ ol.addComponent(new Label("Component 3"));
+ ts.addTab(ol, "Horizontal OrderedLayout", null);
+
+ final GridLayout gl = new GridLayout(3, 3);
+ gl.setDebugId("GridLayout");
+ gl.setMargin(true);
+ gl.addComponent(new Label("Component 1.1"));
+ gl.addComponent(new Label("Component 1.2"));
+ gl.addComponent(new Label("Component 1.3"));
+ gl.addComponent(new Label("Component 2.2"), 1, 1);
+ gl.addComponent(new Label("Component 3.1"), 0, 2);
+ gl.addComponent(new Label("Component 3.3"), 2, 2);
+ ts.addTab(gl, "GridLayout", null);
+
+ /*- TODO spitpanel removed for now - do we need it here?
+ ts = new TabSheet();
+ ts.setHeight(150);
+ g.addComponent(ts, 0, 2, 1, 2);
+
+ SplitPanel sp = new SplitPanel();
+ sp.addComponent(new Label("Component 1"));
+ sp.addComponent(new Label("Component 2"));
+ ts.addTab(sp, "Vertical SplitPanel", null);
+
+ sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
+ sp.addComponent(new Label("Component 1"));
+ sp.addComponent(new Label("Component 2"));
+ ts.addTab(sp, "Horizontal SplitPanel", null);
+ -*/
+
+ }
+}
|