|
@@ -1,63 +1,63 @@ |
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 SizeableTextBox extends AbstractSizeableTextBoxBase { |
9 |
|
- |
private TextBox mTextBox = new TextBox(); |
10 |
|
- |
|
11 |
|
- |
public SizeableTextBox() { |
12 |
|
- |
initWidget( new ConstrainingSizeableOuterLayers( mTextBox, "LayoutSizeableTextBox" ) ); |
13 |
|
- |
LLstretchableHorizontally(); |
14 |
|
- |
} |
15 |
|
- |
|
16 |
|
- |
@Override |
17 |
|
- |
protected TextBoxBase getTextBoxBase() { |
18 |
|
- |
return mTextBox; |
19 |
|
- |
} |
20 |
|
- |
|
21 |
|
- |
public SizeableTextBox style( String pStyleName ) { |
22 |
|
- |
addStyleName( pStyleName ); |
23 |
|
- |
return this; |
24 |
|
- |
} |
25 |
|
- |
|
26 |
|
- |
/** |
27 |
|
- |
* Gets the maximum allowable length of the text box. |
28 |
|
- |
* |
29 |
|
- |
* @return the maximum length, in characters |
30 |
|
- |
*/ |
31 |
|
- |
public int getMaxLength() { |
32 |
|
- |
return mTextBox.getMaxLength(); |
33 |
|
- |
} |
34 |
|
- |
|
35 |
|
- |
/** |
36 |
|
- |
* Gets the number of visible characters in the text box. |
37 |
|
- |
* |
38 |
|
- |
* @return the number of visible characters |
39 |
|
- |
*/ |
40 |
|
- |
public int getVisibleLength() { |
41 |
|
- |
return mTextBox.getVisibleLength(); |
42 |
|
- |
} |
43 |
|
- |
|
44 |
|
- |
/** |
45 |
|
- |
* Sets the maximum allowable length of the text box. |
46 |
|
- |
* |
47 |
|
- |
* @param length the maximum length, in characters |
48 |
|
- |
*/ |
49 |
|
- |
public SizeableTextBox setMaxLength( int length ) { |
50 |
|
- |
mTextBox.setMaxLength( length ); |
51 |
|
- |
return this; |
52 |
|
- |
} |
53 |
|
- |
|
54 |
|
- |
/** |
55 |
|
- |
* Sets the number of visible characters in the text box. |
56 |
|
- |
* |
57 |
|
- |
* @param length the number of visible characters |
58 |
|
- |
*/ |
59 |
|
- |
public SizeableTextBox setVisibleLength( int length ) { |
60 |
|
- |
mTextBox.setVisibleLength( length ); |
61 |
|
- |
return this; |
62 |
|
- |
} |
63 |
|
- |
} |
|
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 SizeableTextBox extends AbstractSizeableTextBoxBase { |
|
9 |
+ |
private TextBox mTextBox = new TextBox(); |
|
10 |
+ |
|
|
11 |
+ |
public SizeableTextBox() { |
|
12 |
+ |
initWidget( new ConstrainingSizeableOuterLayers( mTextBox, "LayoutSizeableTextBox" ) ); |
|
13 |
+ |
LLstretchableHorizontally(); |
|
14 |
+ |
} |
|
15 |
+ |
|
|
16 |
+ |
@Override |
|
17 |
+ |
protected TextBoxBase getTextBoxBase() { |
|
18 |
+ |
return mTextBox; |
|
19 |
+ |
} |
|
20 |
+ |
|
|
21 |
+ |
public SizeableTextBox style( String pStyleName ) { |
|
22 |
+ |
addStyleName( pStyleName ); |
|
23 |
+ |
return this; |
|
24 |
+ |
} |
|
25 |
+ |
|
|
26 |
+ |
/** |
|
27 |
+ |
* Gets the maximum allowable length of the text box. |
|
28 |
+ |
* |
|
29 |
+ |
* @return the maximum length, in characters |
|
30 |
+ |
*/ |
|
31 |
+ |
public int getMaxLength() { |
|
32 |
+ |
return mTextBox.getMaxLength(); |
|
33 |
+ |
} |
|
34 |
+ |
|
|
35 |
+ |
/** |
|
36 |
+ |
* Gets the number of visible characters in the text box. |
|
37 |
+ |
* |
|
38 |
+ |
* @return the number of visible characters |
|
39 |
+ |
*/ |
|
40 |
+ |
public int getVisibleLength() { |
|
41 |
+ |
return mTextBox.getVisibleLength(); |
|
42 |
+ |
} |
|
43 |
+ |
|
|
44 |
+ |
/** |
|
45 |
+ |
* Sets the maximum allowable length of the text box. |
|
46 |
+ |
* |
|
47 |
+ |
* @param length the maximum length, in characters |
|
48 |
+ |
*/ |
|
49 |
+ |
public SizeableTextBox setMaxLength( int length ) { |
|
50 |
+ |
mTextBox.setMaxLength( length ); |
|
51 |
+ |
return this; |
|
52 |
+ |
} |
|
53 |
+ |
|
|
54 |
+ |
/** |
|
55 |
+ |
* Sets the number of visible characters in the text box. |
|
56 |
+ |
* |
|
57 |
+ |
* @param length the number of visible characters |
|
58 |
+ |
*/ |
|
59 |
+ |
public SizeableTextBox setVisibleLength( int length ) { |
|
60 |
+ |
mTextBox.setVisibleLength( length ); |
|
61 |
+ |
return this; |
|
62 |
+ |
} |
|
63 |
+ |
} |