01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.sample.showcase2.client.layout;
09:
10: import com.gwtext.client.widgets.Panel;
11: import com.gwtext.client.widgets.layout.HorizontalLayout;
12: import com.gwtext.client.widgets.layout.VerticalLayout;
13: import com.gwtext.sample.showcase2.client.ShowcasePanel;
14:
15: public class HorizontalVerticalLayoutSample extends ShowcasePanel {
16:
17: public String getSourceUrl() {
18: return "source/layout/HorizontalVerticalLayoutSample.java.html";
19: }
20:
21: public Panel getViewPanel() {
22: if (panel == null) {
23:
24: panel = new Panel();
25:
26: panel.setLayout(new VerticalLayout(15));
27: panel.setBorder(true);
28:
29: Panel horizontalPanel = new Panel();
30: horizontalPanel.setLayout(new HorizontalLayout(15));
31:
32: horizontalPanel.add(new Panel("Item 1a", 100, 150));
33: horizontalPanel.add(new Panel("Item 1b", 75, 150));
34: horizontalPanel.add(new Panel("Item 1c", 100, 150));
35:
36: panel.add(horizontalPanel);
37: panel.add(new Panel("Item 2", 250, 75));
38: panel.add(new Panel("Item 3", 150, 100));
39: panel.add(new Panel("Item 4", 150, 150));
40:
41: }
42: return panel;
43: }
44:
45: public String getIntro() {
46: return "An example of combining VerticalLayout and HorizontalLayout. The top row is created using a HorizontalLayout and is added"
47: + "to a VerticalLayout along with three other panels.";
48: }
49: }
|