Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/Spacer.java

Diff revisions: vs.
  @@ -1,10 +1,8 @@
1 1 package com.temp.client.foundation.widget;
2 2
3 - import com.temp.shared.utils.StringUtils;
4 -
5 - import com.google.gwt.dom.client.Style.Overflow;
6 - import com.google.gwt.user.client.ui.Composite;
7 - import com.google.gwt.user.client.ui.HTML;
3 + import com.google.gwt.dom.client.Style.*;
4 + import com.google.gwt.user.client.ui.*;
5 + import com.temp.shared.utils.*;
8 6
9 7 public class Spacer extends Composite {
10 8
  @@ -12,69 +10,77 @@
12 10 private static final String BLANK_TEXT = " ";
13 11
14 12 public Spacer() {
15 - this.widget = new HTML(BLANK_TEXT);
16 - this.widget.getElement().getStyle().setOverflow(Overflow.HIDDEN);
17 - initWidget(this.widget);
13 + this.widget = new HTML( BLANK_TEXT );
14 + this.widget.getElement().getStyle().setOverflow( Overflow.HIDDEN );
15 + initWidget( this.widget );
18 16 }
19 17
20 - public Spacer(String width, String height) {
18 + public Spacer( String width, String height ) {
21 19 this();
22 - widget.setWidth(width);
23 - widget.setHeight(height);
20 + widget.setWidth( width );
21 + widget.setHeight( height );
24 22 }
25 23
26 24 /**
27 25 * add a style "classname", and allow chaining calls.
26 + *
28 27 * @param style "classname"
28 + *
29 29 * @return this
30 30 */
31 - public Spacer style(String style) {
32 - if (null != (style = StringUtils.noEmpty(style))) {
33 - addStyleName(style);
31 + public Spacer style( String style ) {
32 + if ( null != (style = StringUtils.noEmpty( style )) ) {
33 + addStyleName( style );
34 34 }
35 35 return this;
36 36 }
37 37
38 38 /**
39 39 * Set the width, and allow chaining calls.
40 + *
40 41 * @param width
42 + *
41 43 * @return this
42 44 */
43 - public Spacer width(String width) {
44 - widget.setWidth(width);
45 + public Spacer width( String width ) {
46 + widget.setWidth( width );
45 47 return this;
46 48 }
47 49
48 50 /**
49 51 * Set the height, and allow chaining calls.
52 + *
50 53 * @param height
54 + *
51 55 * @return this
52 56 */
53 - public Spacer height(String height) {
54 - widget.setHeight(height);
57 + public Spacer height( String height ) {
58 + widget.setHeight( height );
55 59 return this;
56 60 }
57 61
58 62 /**
59 63 * Set the width & height, and allow chaining calls.
64 + *
60 65 * @param size
66 + *
61 67 * @return this
62 68 */
63 - public Spacer size(String size) {
64 - widget.setHeight(size);
65 - widget.setHeight(size);
69 + public Spacer size( String size ) {
70 + widget.setHeight( size );
71 + widget.setHeight( size );
66 72 return this;
67 73 }
68 74
69 - public void setWidth(String width) {
70 - this.width(width);
75 + public void setWidth( String width ) {
76 + this.width( width );
71 77 }
72 78
73 - public void setHeight(String height) {
74 - this.height(height);
79 + public void setHeight( String height ) {
80 + this.height( height );
75 81 }
76 82
77 - public void setSize(String size) {
78 - this.size(size);
83 + public void setSize( String size ) {
84 + this.size( size );
79 85 }
80 86 }