01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.samples.explorer.client;
09:
10: import net.mygwt.ui.client.MyDOM;
11: import net.mygwt.ui.client.Style;
12: import net.mygwt.ui.client.widget.WidgetContainer;
13: import net.mygwt.ui.client.widget.layout.FillLayout;
14: import net.mygwt.ui.client.widget.layout.RowData;
15: import net.mygwt.ui.client.widget.layout.RowLayout;
16:
17: import com.google.gwt.user.client.ui.Label;
18:
19: public class RowLayoutPage extends Page {
20:
21: protected void createWidget(WidgetContainer container) {
22: RowLayout layout = new RowLayout(Style.VERTICAL);
23: layout.setMargin(4);
24: layout.setSpacing(4);
25:
26: WidgetContainer wc = new WidgetContainer();
27: wc.setLayout(layout);
28:
29: Label label1 = new Label("Test Label 1");
30: Label label2 = new Label("Test Label 2");
31: Label label3 = new Label("Test Label 3");
32:
33: wc.add(label1, new RowData(RowData.FILL_HORIZONTAL));
34: wc.add(label2, new RowData(RowData.FILL_BOTH));
35: wc.add(label3, new RowData(RowData.FILL_BOTH));
36:
37: wc.setBorders(true);
38: MyDOM.setBorders(label1.getElement(), true);
39: MyDOM.setBorders(label2.getElement(), true);
40: MyDOM.setBorders(label3.getElement(), true);
41:
42: container.setLayout(new FillLayout(15));
43: container.add(wc);
44: }
45:
46: }
|