1 Clazz.declarePackage ("javajs.swing");
\r
2 Clazz.load (["javajs.swing.AbstractButton"], "javajs.swing.JMenuItem", null, function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
5 Clazz.instantialize (this, arguments);
\r
6 }, javajs.swing, "JMenuItem", javajs.swing.AbstractButton);
\r
7 Clazz.makeConstructor (c$,
\r
9 Clazz.superConstructor (this, javajs.swing.JMenuItem, ["btn"]);
\r
10 this.setText (text);
\r
11 this.btnType = (text == null ? 0 : 1);
\r
13 Clazz.makeConstructor (c$,
\r
14 function (type, i) {
\r
15 Clazz.superConstructor (this, javajs.swing.JMenuItem, [type]);
\r
18 Clazz.overrideMethod (c$, "toHTML",
\r
20 return this.htmlMenuOpener ("li") + (this.text == null ? "" : "<a>" + this.htmlLabel () + "</a>") + "</li>";
\r
22 Clazz.overrideMethod (c$, "getHtmlDisabled",
\r
24 return " class=\"ui-state-disabled\"";
\r
26 Clazz.defineMethod (c$, "htmlLabel",
\r
27 ($fz = function () {
\r
28 return (this.btnType == 1 ? this.text : "<label><input id=\"" + this.id + "-" + (this.btnType == 3 ? "r" : "c") + "b\" type=\"" + (this.btnType == 3 ? "radio\" name=\"" + this.htmlName : "checkbox") + "\" " + (this.selected ? "checked" : "") + " />" + this.text + "</label>");
\r
29 }, $fz.isPrivate = true, $fz));
\r
30 Clazz.defineStatics (c$,
\r
31 "TYPE_SEPARATOR", 0,
\r