X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fswingjs%2Fplaf%2FJSTextFieldUI.js;fp=site%2Fj2s%2Fswingjs%2Fplaf%2FJSTextFieldUI.js;h=af35b25aadba384c7d3aacd05fc717e941b25dca;hp=ca3701c28ae1dd502e20adbe9a995c04bc5f1507;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/swingjs/plaf/JSTextFieldUI.js b/site/j2s/swingjs/plaf/JSTextFieldUI.js index ca3701c..af35b25 100644 --- a/site/j2s/swingjs/plaf/JSTextFieldUI.js +++ b/site/j2s/swingjs/plaf/JSTextFieldUI.js @@ -1,31 +1,31 @@ -Clazz.declarePackage ("swingjs.plaf"); -Clazz.load (["swingjs.plaf.JSTextUI"], "swingjs.plaf.JSTextFieldUI", ["java.awt.Dimension", "java.awt.event.ActionEvent", "swingjs.api.DOMNode"], function () { -c$ = Clazz.decorateAsClass (function () { -this.inputType = "text"; -Clazz.instantialize (this, arguments); -}, swingjs.plaf, "JSTextFieldUI", swingjs.plaf.JSTextUI); -Clazz.overrideMethod (c$, "getDOMObject", -function () { -if (this.domNode == null) { -this.updateHandler.checkDocument (); -this.focusNode = this.enableNode = this.valueNode = this.domNode = swingjs.api.DOMNode.setStyles (this.createDOMObject ("input", this.id, ["type", this.inputType]), ["padding", "0px 1px"]); -swingjs.plaf.JSComponentUI.vCenter (this.domNode, -10); -this.bindMouse (this.domNode); -this.bindKeys (this.domNode); -this.setFocusable (); -}this.setCssFont (this.setProp (this.domNode, "value", this.getComponentText ()), this.c.getFont ()); -if (!this.editable) swingjs.api.DOMNode.setAttr (this.domNode, "readOnly", "true"); -return this.domNode; -}); -Clazz.overrideMethod (c$, "getCSSDimension", -function (w, h) { -return new java.awt.Dimension (w, h - 2); -}, "~N,~N"); -Clazz.overrideMethod (c$, "handleEnter", -function (eventType) { -if (eventType == 401) { -var a = this.getActionMap ().get ("notify-field-accept"); -if (a != null) a.actionPerformed ( new java.awt.event.ActionEvent (this.c, 1001, "notify-field-accept", System.currentTimeMillis (), 0)); -}return true; -}, "~N"); -}); +Clazz.declarePackage ("swingjs.plaf"); +Clazz.load (["swingjs.plaf.JSTextUI"], "swingjs.plaf.JSTextFieldUI", ["java.awt.Dimension", "java.awt.event.ActionEvent", "swingjs.api.DOMNode"], function () { +c$ = Clazz.decorateAsClass (function () { +this.inputType = "text"; +Clazz.instantialize (this, arguments); +}, swingjs.plaf, "JSTextFieldUI", swingjs.plaf.JSTextUI); +Clazz.overrideMethod (c$, "getDOMObject", +function () { +if (this.domNode == null) { +this.updateHandler.checkDocument (); +this.focusNode = this.enableNode = this.valueNode = this.domNode = swingjs.api.DOMNode.setStyles (this.createDOMObject ("input", this.id, ["type", this.inputType]), ["padding", "0px 1px"]); +swingjs.plaf.JSComponentUI.vCenter (this.domNode, -10); +this.bindMouse (this.domNode); +this.bindKeys (this.domNode); +this.setFocusable (); +}this.setCssFont (this.setProp (this.domNode, "value", this.getComponentText ()), this.c.getFont ()); +if (!this.editable) swingjs.api.DOMNode.setAttr (this.domNode, "readOnly", "true"); +return this.domNode; +}); +Clazz.overrideMethod (c$, "getCSSDimension", +function (w, h) { +return new java.awt.Dimension (w, h - 2); +}, "~N,~N"); +Clazz.overrideMethod (c$, "handleEnter", +function (eventType) { +if (eventType == 401) { +var a = this.getActionMap ().get ("notify-field-accept"); +if (a != null) a.actionPerformed ( new java.awt.event.ActionEvent (this.c, 1001, "notify-field-accept", System.currentTimeMillis (), 0)); +}return true; +}, "~N"); +});