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.ColumnLayout;
12: import com.gwtext.client.widgets.layout.ColumnLayoutData;
13: import com.gwtext.client.widgets.layout.FitLayout;
14: import com.gwtext.sample.showcase2.client.ShowcasePanel;
15: import com.gwtext.sample.showcase2.client.SampleData;
16:
17: public class ColumnMixedSample extends ShowcasePanel {
18:
19: public String getSourceUrl() {
20: return "source/layout/ColumnMixedSample.java.html";
21: }
22:
23: public Panel getViewPanel() {
24: if (panel == null) {
25:
26: panel = new Panel();
27: panel.setLayout(new FitLayout());
28:
29: //add wrapper panel just to dispaly the borders
30: Panel wrapperPanel = new Panel();
31: wrapperPanel.setBorder(true);
32: wrapperPanel
33: .setBodyStyle("border-style:dotted;border-color:blue;");
34: wrapperPanel.setLayout(new ColumnLayout());
35:
36: wrapperPanel.setTitle("Column Layout - Mixed");
37: Panel p1 = new Panel("Column 1", "120px width");
38: p1.setWidth(120);
39: wrapperPanel.add(p1);
40:
41: wrapperPanel.add(new Panel("Column 2", "80% width"),
42: new ColumnLayoutData(.8));
43: wrapperPanel.add(new Panel("Column 3", "20% width"),
44: new ColumnLayoutData(.2));
45:
46: panel.add(wrapperPanel);
47: }
48: return panel;
49: }
50:
51: public String getIntro() {
52: return "<p>This exampel show the use of ColumnLayout where the first panel has a fixed width while the other two have thier "
53: + "widths specified in percentage values</p>";
54: }
55: }
|