|
@@ -1,72 +1,72 @@ |
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.*; |
7 |
|
- |
import com.google.gwt.user.client.ui.*; |
8 |
|
- |
|
9 |
|
- |
public class PasswordTextBoxChangeListenable extends PasswordTextBox implements IExtendedTextBox { |
10 |
|
- |
public PasswordTextBoxChangeListenable() { |
11 |
|
- |
mHelper = new TextBoxBaseChangeListenableHelper( this ); |
12 |
|
- |
} |
13 |
|
- |
|
14 |
|
- |
TextBoxBaseChangeListenableHelper mHelper; |
15 |
|
- |
|
16 |
|
- |
@Override |
17 |
|
- |
protected void onDetach() { |
18 |
|
- |
super.onDetach(); |
19 |
|
- |
mHelper.onDetach(); |
20 |
|
- |
} |
21 |
|
- |
|
22 |
|
- |
@Override |
23 |
|
- |
public void setText( String text ) { |
24 |
|
- |
super.setText( text ); |
25 |
|
- |
mHelper.setText( text ); |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
@Override |
29 |
|
- |
public void setEnabled( boolean enabled ) { |
30 |
|
- |
DOM.setElementPropertyBoolean( getElement(), "readOnly", !enabled ); |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
/** |
34 |
|
- |
* Gets the maximum allowable length of the text box. |
35 |
|
- |
* |
36 |
|
- |
* @return the maximum length, in characters |
37 |
|
- |
*/ |
38 |
|
- |
@Override |
39 |
|
- |
public int getMaxLength() { |
40 |
|
- |
return DOM.getElementPropertyInt( getElement(), "maxLength" ); |
41 |
|
- |
} |
42 |
|
- |
|
43 |
|
- |
/** |
44 |
|
- |
* Gets the number of visible characters in the text box. |
45 |
|
- |
* |
46 |
|
- |
* @return the number of visible characters |
47 |
|
- |
*/ |
48 |
|
- |
@Override |
49 |
|
- |
public int getVisibleLength() { |
50 |
|
- |
return DOM.getElementPropertyInt( getElement(), "size" ); |
51 |
|
- |
} |
52 |
|
- |
|
53 |
|
- |
/** |
54 |
|
- |
* Sets the maximum allowable length of the text box. |
55 |
|
- |
* |
56 |
|
- |
* @param length the maximum length, in characters |
57 |
|
- |
*/ |
58 |
|
- |
@Override |
59 |
|
- |
public void setMaxLength( int length ) { |
60 |
|
- |
DOM.setElementPropertyInt( getElement(), "maxLength", length ); |
61 |
|
- |
} |
62 |
|
- |
|
63 |
|
- |
/** |
64 |
|
- |
* Sets the number of visible characters in the text box. |
65 |
|
- |
* |
66 |
|
- |
* @param length the number of visible characters |
67 |
|
- |
*/ |
68 |
|
- |
@Override |
69 |
|
- |
public void setVisibleLength( int length ) { |
70 |
|
- |
DOM.setElementPropertyInt( getElement(), "size", length ); |
71 |
|
- |
} |
72 |
|
- |
} |
|
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.*; |
|
7 |
+ |
import com.google.gwt.user.client.ui.*; |
|
8 |
+ |
|
|
9 |
+ |
public class PasswordTextBoxChangeListenable extends PasswordTextBox implements IExtendedTextBox { |
|
10 |
+ |
public PasswordTextBoxChangeListenable() { |
|
11 |
+ |
mHelper = new TextBoxBaseChangeListenableHelper( this ); |
|
12 |
+ |
} |
|
13 |
+ |
|
|
14 |
+ |
TextBoxBaseChangeListenableHelper mHelper; |
|
15 |
+ |
|
|
16 |
+ |
@Override |
|
17 |
+ |
protected void onDetach() { |
|
18 |
+ |
super.onDetach(); |
|
19 |
+ |
mHelper.onDetach(); |
|
20 |
+ |
} |
|
21 |
+ |
|
|
22 |
+ |
@Override |
|
23 |
+ |
public void setText( String text ) { |
|
24 |
+ |
super.setText( text ); |
|
25 |
+ |
mHelper.setText( text ); |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
@Override |
|
29 |
+ |
public void setEnabled( boolean enabled ) { |
|
30 |
+ |
DOM.setElementPropertyBoolean( getElement(), "readOnly", !enabled ); |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
/** |
|
34 |
+ |
* Gets the maximum allowable length of the text box. |
|
35 |
+ |
* |
|
36 |
+ |
* @return the maximum length, in characters |
|
37 |
+ |
*/ |
|
38 |
+ |
@Override |
|
39 |
+ |
public int getMaxLength() { |
|
40 |
+ |
return DOM.getElementPropertyInt( getElement(), "maxLength" ); |
|
41 |
+ |
} |
|
42 |
+ |
|
|
43 |
+ |
/** |
|
44 |
+ |
* Gets the number of visible characters in the text box. |
|
45 |
+ |
* |
|
46 |
+ |
* @return the number of visible characters |
|
47 |
+ |
*/ |
|
48 |
+ |
@Override |
|
49 |
+ |
public int getVisibleLength() { |
|
50 |
+ |
return DOM.getElementPropertyInt( getElement(), "size" ); |
|
51 |
+ |
} |
|
52 |
+ |
|
|
53 |
+ |
/** |
|
54 |
+ |
* Sets the maximum allowable length of the text box. |
|
55 |
+ |
* |
|
56 |
+ |
* @param length the maximum length, in characters |
|
57 |
+ |
*/ |
|
58 |
+ |
@Override |
|
59 |
+ |
public void setMaxLength( int length ) { |
|
60 |
+ |
DOM.setElementPropertyInt( getElement(), "maxLength", length ); |
|
61 |
+ |
} |
|
62 |
+ |
|
|
63 |
+ |
/** |
|
64 |
+ |
* Sets the number of visible characters in the text box. |
|
65 |
+ |
* |
|
66 |
+ |
* @param length the number of visible characters |
|
67 |
+ |
*/ |
|
68 |
+ |
@Override |
|
69 |
+ |
public void setVisibleLength( int length ) { |
|
70 |
+ |
DOM.setElementPropertyInt( getElement(), "size", length ); |
|
71 |
+ |
} |
|
72 |
+ |
} |