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.Style;
11: import net.mygwt.ui.client.widget.ContentPanel;
12: import net.mygwt.ui.client.widget.WidgetContainer;
13: import net.mygwt.ui.client.widget.layout.BorderLayout;
14: import net.mygwt.ui.client.widget.layout.BorderLayoutData;
15: import net.mygwt.ui.client.widget.layout.FillLayout;
16:
17: import com.google.gwt.user.client.ui.Label;
18:
19: public class BorderLayoutPage extends Page {
20:
21: protected void createWidget(WidgetContainer container) {
22: WidgetContainer c = new WidgetContainer();
23:
24: c.setStyleName("my-border-layout");
25: c.setLayout(new BorderLayout());
26:
27: BorderLayoutData northData = new BorderLayoutData(Style.NORTH,
28: 20);
29: northData.setBorders(false);
30: c.add(new Label("North"), northData);
31:
32: BorderLayoutData southData = new BorderLayoutData(Style.SOUTH,
33: 20);
34: southData.setBorders(false);
35: c.add(new Label("South"), southData);
36:
37: BorderLayoutData westData = new BorderLayoutData(Style.WEST,
38: 100, 75, 150);
39:
40: ContentPanel west = new ContentPanel(Style.HEADER);
41: west.setText("West");
42: c.add(west, westData);
43:
44: BorderLayoutData eastData = new BorderLayoutData(Style.EAST,
45: 100, 75, 150);
46:
47: ContentPanel east = new ContentPanel(Style.HEADER);
48: east.setText("East");
49: c.add(east, eastData);
50:
51: ContentPanel center = new ContentPanel(Style.HEADER);
52: center.setText("Center Region");
53: c.add(center, new BorderLayoutData(Style.CENTER));
54:
55: container.add(c);
56: container.setLayout(new FillLayout(8));
57:
58: }
59:
60: }
|