|
@@ -1,62 +1,62 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.widgets; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
5 |
|
- |
|
6 |
|
- |
import com.google.gwt.user.client.ui.*; |
7 |
|
- |
|
8 |
|
- |
public class SizeableLabel extends AbstractSizeableComposite implements SourcesClickEvents { |
9 |
|
- |
protected OurLabel mLabel = new OurLabel( false ); |
10 |
|
- |
|
11 |
|
- |
public SizeableLabel( String pLabelText, boolean pAsHTML ) { |
12 |
|
- |
mLabel.setText( pLabelText, pAsHTML ); |
13 |
|
- |
initWidget( new ConstrainingSizeableOuterLayers( mLabel, "LayoutSizeableLabel" ) ); |
14 |
|
- |
} |
15 |
|
- |
|
16 |
|
- |
public String getText() { |
17 |
|
- |
return mLabel.getText(); |
18 |
|
- |
} |
19 |
|
- |
|
20 |
|
- |
public void setText( String pLabelText ) { |
21 |
|
- |
setText( pLabelText, false ); |
22 |
|
- |
} |
23 |
|
- |
|
24 |
|
- |
public void setText( String pLabelText, boolean pAsHTML ) { |
25 |
|
- |
mLabel.setText( pLabelText, pAsHTML ); |
26 |
|
- |
relayout(); |
27 |
|
- |
} |
28 |
|
- |
|
29 |
|
- |
public SizeableLabel style( String pName ) { |
30 |
|
- |
addStyleName( pName ); |
31 |
|
- |
return this; |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
35 |
|
- |
|
36 |
|
- |
public SizeableLabel stretchable() { |
37 |
|
- |
LLstretchable(); |
38 |
|
- |
return this; |
39 |
|
- |
} |
40 |
|
- |
|
41 |
|
- |
public SizeableLabel stretchableVertically() { |
42 |
|
- |
LLstretchableVertically(); |
43 |
|
- |
return this; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
public SizeableLabel stretchableHorizontally() { |
47 |
|
- |
LLstretchableHorizontally(); |
48 |
|
- |
return this; |
49 |
|
- |
} |
50 |
|
- |
|
51 |
|
- |
//****** SourcesClickEvents |
52 |
|
- |
|
53 |
|
- |
@Override |
54 |
|
- |
public void addClickListener( ClickListener pClickListener ) { |
55 |
|
- |
mLabel.addClickListener( pClickListener ); |
56 |
|
- |
} |
57 |
|
- |
|
58 |
|
- |
@Override |
59 |
|
- |
public void removeClickListener( ClickListener pClickListener ) { |
60 |
|
- |
mLabel.removeClickListener( pClickListener ); |
61 |
|
- |
} |
62 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.widgets; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
|
5 |
+ |
|
|
6 |
+ |
import com.google.gwt.user.client.ui.*; |
|
7 |
+ |
|
|
8 |
+ |
public class SizeableLabel extends AbstractSizeableComposite implements SourcesClickEvents { |
|
9 |
+ |
protected OurLabel mLabel = new OurLabel( false ); |
|
10 |
+ |
|
|
11 |
+ |
public SizeableLabel( String pLabelText, boolean pAsHTML ) { |
|
12 |
+ |
mLabel.setText( pLabelText, pAsHTML ); |
|
13 |
+ |
initWidget( new ConstrainingSizeableOuterLayers( mLabel, "LayoutSizeableLabel" ) ); |
|
14 |
+ |
} |
|
15 |
+ |
|
|
16 |
+ |
public String getText() { |
|
17 |
+ |
return mLabel.getText(); |
|
18 |
+ |
} |
|
19 |
+ |
|
|
20 |
+ |
public void setText( String pLabelText ) { |
|
21 |
+ |
setText( pLabelText, false ); |
|
22 |
+ |
} |
|
23 |
+ |
|
|
24 |
+ |
public void setText( String pLabelText, boolean pAsHTML ) { |
|
25 |
+ |
mLabel.setText( pLabelText, pAsHTML ); |
|
26 |
+ |
relayout(); |
|
27 |
+ |
} |
|
28 |
+ |
|
|
29 |
+ |
public SizeableLabel style( String pName ) { |
|
30 |
+ |
addStyleName( pName ); |
|
31 |
+ |
return this; |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
|
35 |
+ |
|
|
36 |
+ |
public SizeableLabel stretchable() { |
|
37 |
+ |
LLstretchable(); |
|
38 |
+ |
return this; |
|
39 |
+ |
} |
|
40 |
+ |
|
|
41 |
+ |
public SizeableLabel stretchableVertically() { |
|
42 |
+ |
LLstretchableVertically(); |
|
43 |
+ |
return this; |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
public SizeableLabel stretchableHorizontally() { |
|
47 |
+ |
LLstretchableHorizontally(); |
|
48 |
+ |
return this; |
|
49 |
+ |
} |
|
50 |
+ |
|
|
51 |
+ |
//****** SourcesClickEvents |
|
52 |
+ |
|
|
53 |
+ |
@Override |
|
54 |
+ |
public void addClickListener( ClickListener pClickListener ) { |
|
55 |
+ |
mLabel.addClickListener( pClickListener ); |
|
56 |
+ |
} |
|
57 |
+ |
|
|
58 |
+ |
@Override |
|
59 |
+ |
public void removeClickListener( ClickListener pClickListener ) { |
|
60 |
+ |
mLabel.removeClickListener( pClickListener ); |
|
61 |
+ |
} |
|
62 |
+ |
} |