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:
16: public class ColumnPctSample extends ShowcasePanel {
17:
18: public String getSourceUrl() {
19: return "source/layout/ColumnPctSample.java.html";
20: }
21:
22: public Panel getViewPanel() {
23: if (panel == null) {
24:
25: panel = new Panel();
26: panel.setLayout(new FitLayout());
27:
28: //add wrapper panel just to dispaly the borders
29: Panel wrapperPanel = new Panel();
30: wrapperPanel.setBorder(true);
31: wrapperPanel
32: .setBodyStyle("border-style:dotted;border-color:blue;");
33:
34: wrapperPanel.setLayout(new ColumnLayout());
35: wrapperPanel.setTitle("Column Layout - Percentage Only");
36: wrapperPanel.add(new Panel("Column 1", "25% width"),
37: new ColumnLayoutData(.25));
38: wrapperPanel.add(new Panel("Column 2", "60% width"),
39: new ColumnLayoutData(.6));
40: wrapperPanel.add(new Panel("Column 3", "15% width"),
41: new ColumnLayoutData(.15));
42:
43: panel.add(wrapperPanel);
44:
45: }
46: return panel;
47: }
48:
49: public String getIntro() {
50: return "This example illustrates a ColumnLayout where all the Panel's have thier width's specified as percentages";
51: }
52: }
|