01: package fr.aliacom.form.swt.ui;
02:
03: import org.eclipse.swt.SWT;
04: import org.eclipse.swt.widgets.Composite;
05: import org.eclipse.swt.widgets.Text;
06:
07: import fr.aliacom.form.common.IFormComponent;
08:
09: /**
10: * Password field. Display '*' instead of the typed characters.
11: *
12: * @author tom
13: *
14: * (C) 2001, 2003 Thomas Cataldo
15: */
16: public final class SWTPassword extends SWTAbstractText {
17:
18: public SWTPassword(IFormComponent fc, String property, int length) {
19: this .property = property;
20: Composite parent = (Composite) fc.getNativeWidget();
21: initAsControl(parent, length);
22: }
23:
24: private void initAsControl(Composite parent, int length) {
25: text = new Text(parent, SWT.BORDER | SWT.SINGLE);
26: sizeControl(length);
27: text.setEchoChar('*');
28: }
29:
30: }
|