Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.temp.foundation.widgets;

import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.temp.shared.utils.*;

public class Spacer extends Composite {

    private HTML widget;
    private static final String BLANK_TEXT = " ";

    public Spacer() {
        this.widget = new HTML(BLANK_TEXT);
        this.widget.getElement().getStyle().setOverflow(Overflow.HIDDEN);
        initWidget(this.widget);
    }

    public Spacer(String width, String height) {
        this();
        widget.setWidth(width);
        widget.setHeight(height);
    }

    /**
     * add a style "classname", and allow chaining calls.
     * @param style "classname"
     * @return this
     */
    public Spacer style(String style) {
        if (null != (style = StringUtils.noEmpty(style))) {
            addStyleName(style);
        }
        return this;
    }

    /**
     * Set the width, and allow chaining calls.
     * @param width
     * @return this
     */
    public Spacer width(String width) {
        widget.setWidth(width);
        return this;
    }

    /**
     * Set the height, and allow chaining calls.
     * @param height
     * @return this
     */
    public Spacer height(String height) {
        widget.setHeight(height);
        return this;
    }

    /**
     * Set the width & height, and allow chaining calls.
     * @param size
     * @return this
     */
    public Spacer size(String size) {
        widget.setHeight(size);
        widget.setHeight(size);
        return this;
    }

    public void setWidth(String width) {
        this.width(width);
    }

    public void setHeight(String height) {
        this.height(height);
    }

    public void setSize(String size) {
        this.size(size);
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/foundation/widgets/Spacer.java

Diff revisions: vs.
Revision Author Commited Message
601 GeorgeS picture GeorgeS Wed 08 Feb, 2012 01:52:17 +0000