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