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.client.widgets;
09:
10: /**
11: * Helper class that wraps a Panel with shell panel adding the specified padding.
12: * Useful when laying out panels using ColumnLayouts or the other layouts which
13: * place the panels right beside each otehr without spacing.
14: */
15: public class PaddedPanel extends Panel {
16:
17: /**
18: * Create a Padded Panel.
19: *
20: * @param panel the panel to wrap
21: * @param paddings the paddings
22: */
23: public PaddedPanel(Panel panel, int paddings) {
24: setBaseCls("x-plain");
25: setPaddings(paddings);
26: add(panel);
27: }
28:
29: /**
30: * Wraps the passed Panel with a shell Panel having the specified padding values.
31: *
32: * @param panel the panel the wrap
33: * @param top the top padding
34: * @param left the left padding
35: * @param right the right padding
36: * @param bottom the bottom padding
37: */
38: public PaddedPanel(Panel panel, int top, int left, int right,
39: int bottom) {
40: setBaseCls("x-plain");
41: setPaddings(top, left, right, bottom);
42: add(panel);
43: }
44: }
|