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
package com.temp.client.foundation.widget;

import com.temp.client.foundation.widget.input.support.TextLabel;
import com.temp.shared.utils.SafeHtmlizer;

/**
 * This Widget is a wrapper around a GWT HTML (Label).
 * <p/>
 * Its key features are:
 * <ul>
 * <li>Text will never wrap</li>
 * <li>Leading & Trailing white space can be preserved</li>
 * </ul>
 */
public class NonWrappingLabel extends TextLabel {
    public NonWrappingLabel() {
        initWidget(htmlWidget);
    }

    public NonWrappingLabel(String text, boolean preserveLeadingAndTrailingWhiteSpace) {
        this();
        if (preserveLeadingAndTrailingWhiteSpace)
            setTextNoTrim(text);
        else
            setText(text);
    }

    public NonWrappingLabel(String text) {
        this(text, false);
    }

    /**
     * @param text will NOT be null but MAT have leading/trailing whitespace
     */
    @Override
    protected String normalizeHTML(String text) {
        return SafeHtmlizer.getInstance().noEmpty(text);
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/NonWrappingLabel.java

Diff revisions: vs.
Revision Author Commited Message
630 Diff Diff GeorgeS picture GeorgeS Tue 17 Apr, 2012 20:22:17 +0000
626 GeorgeS picture GeorgeS Wed 11 Apr, 2012 19:39:41 +0000