1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.AbstractButton"], "javax.swing.JButton", ["javax.swing.DefaultButtonModel", "$.SwingUtilities", "$.UIManager"], function () {
3 c$ = Clazz.declareType (javax.swing, "JButton", javax.swing.AbstractButton);
4 Clazz.makeConstructor (c$,
6 this.construct (null, null);
8 Clazz.makeConstructor (c$,
10 this.construct (null, icon);
11 }, "javax.swing.Icon");
12 Clazz.makeConstructor (c$,
14 this.construct (text, null);
16 Clazz.makeConstructor (c$,
20 }, "javax.swing.Action");
21 Clazz.makeConstructor (c$,
22 function (text, icon) {
23 Clazz.superConstructor (this, javax.swing.JButton, []);
24 this.setModel ( new javax.swing.DefaultButtonModel ());
25 this.init (text, icon);
26 }, "~S,javax.swing.Icon");
27 Clazz.overrideMethod (c$, "updateUI",
29 this.setUI (javax.swing.UIManager.getUI (this));
31 Clazz.overrideMethod (c$, "getUIClassID",
35 Clazz.defineMethod (c$, "isDefaultButton",
37 var root = javax.swing.SwingUtilities.getRootPane (this);
39 return root.getDefaultButton () === this;
42 Clazz.defineMethod (c$, "isDefaultCapable",
44 return this.defaultCapable;
46 Clazz.defineMethod (c$, "setDefaultCapable",
47 function (defaultCapable) {
48 var oldDefaultCapable = this.defaultCapable;
49 this.defaultCapable = defaultCapable;
50 this.firePropertyChangeBool ("defaultCapable", oldDefaultCapable, defaultCapable);
52 Clazz.defineMethod (c$, "removeNotify",
54 var root = javax.swing.SwingUtilities.getRootPane (this);
55 if (root != null && root.getDefaultButton () === this) {
56 root.setDefaultButton (null);
57 }Clazz.superCall (this, javax.swing.JButton, "removeNotify", []);
59 Clazz.defineMethod (c$, "paramString",
61 var defaultCapableString = (this.defaultCapable ? "true" : "false");
62 return Clazz.superCall (this, javax.swing.JButton, "paramString", []) + ",defaultCapable=" + defaultCapableString;
64 Clazz.defineStatics (c$,
65 "$uiClassID", "ButtonUI");