1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JTextField"], "javax.swing.JPasswordField", ["javax.swing.text.Segment"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.echoCharSet = false;
6 Clazz.instantialize (this, arguments);
7 }, javax.swing, "JPasswordField", javax.swing.JTextField);
8 Clazz.makeConstructor (c$,
10 this.construct (null, null, 0);
12 Clazz.makeConstructor (c$,
14 this.construct (null, text, 0);
16 Clazz.makeConstructor (c$,
18 this.construct (null, null, columns);
20 Clazz.makeConstructor (c$,
21 function (text, columns) {
22 this.construct (null, text, columns);
24 Clazz.overrideMethod (c$, "getUIClassID",
26 return "PasswordFieldUI";
28 Clazz.defineMethod (c$, "updateUI",
30 if (!this.echoCharSet) {
32 }Clazz.superCall (this, javax.swing.JPasswordField, "updateUI", []);
34 Clazz.defineMethod (c$, "getEchoChar",
38 Clazz.defineMethod (c$, "setEchoChar",
41 this.echoCharSet = true;
45 Clazz.defineMethod (c$, "echoCharIsSet",
47 return this.echoChar.charCodeAt (0) != 0;
49 Clazz.overrideMethod (c$, "cut",
52 Clazz.overrideMethod (c$, "copy",
55 Clazz.defineMethod (c$, "getPassword",
57 var doc = this.getDocument ();
58 var txt = new javax.swing.text.Segment ();
60 doc.getText (0, doc.getLength (), txt);
62 if (Clazz.exceptionOf (e, javax.swing.text.BadLocationException)) {
68 var retValue = Clazz.newCharArray (txt.count, '\0');
69 System.arraycopy (txt.array, txt.offset, retValue, 0, txt.count);
72 Clazz.defineMethod (c$, "paramString",
74 return Clazz.superCall (this, javax.swing.JPasswordField, "paramString", []) + ",echoChar=" + this.echoChar;
76 Clazz.defineMethod (c$, "customSetUIProperty",
77 function (propertyName, value) {
78 if (propertyName === "echoChar") {
79 if (!this.echoCharSet) {
80 this.setEchoChar ((value).charValue ());
81 this.echoCharSet = false;
85 Clazz.defineStatics (c$,
86 "$$uiClassID", "PasswordFieldUI");