42c0883379ebbe83d2b4e6c02865294d1a89b3ad
[jalviewjs.git] / site / j2s / javax / swing / JCheckBoxMenuItem.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JMenuItem", "$.SwingConstants"], "javax.swing.JCheckBoxMenuItem", ["javax.swing.JToggleButton"], function () {
3 c$ = Clazz.declareType (javax.swing, "JCheckBoxMenuItem", javax.swing.JMenuItem, javax.swing.SwingConstants);
4 Clazz.makeConstructor (c$, 
5 function () {
6 this.construct (null, null, false);
7 });
8 Clazz.makeConstructor (c$, 
9 function (icon) {
10 this.construct (null, icon, false);
11 }, "javax.swing.Icon");
12 Clazz.makeConstructor (c$, 
13 function (text) {
14 this.construct (text, null, false);
15 }, "~S");
16 Clazz.makeConstructor (c$, 
17 function (a) {
18 this.construct ();
19 this.setAction (a);
20 }, "javax.swing.Action");
21 Clazz.makeConstructor (c$, 
22 function (text, icon) {
23 this.construct (text, icon, false);
24 }, "~S,javax.swing.Icon");
25 Clazz.makeConstructor (c$, 
26 function (text, b) {
27 this.construct (text, null, b);
28 }, "~S,~B");
29 Clazz.makeConstructor (c$, 
30 function (text, icon, b) {
31 Clazz.superConstructor (this, javax.swing.JCheckBoxMenuItem, [text, icon]);
32 this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ());
33 this.setSelected (b);
34 this.setFocusable (false);
35 }, "~S,javax.swing.Icon,~B");
36 Clazz.overrideMethod (c$, "getUIClassID", 
37 function () {
38 return "CheckBoxMenuItemUI";
39 });
40 Clazz.defineMethod (c$, "getState", 
41 function () {
42 return this.isSelected ();
43 });
44 Clazz.defineMethod (c$, "setState", 
45 function (b) {
46 this.setSelected (b);
47 }, "~B");
48 Clazz.overrideMethod (c$, "getSelectedObjects", 
49 function () {
50 if (this.isSelected () == false) return null;
51 var selectedObjects =  new Array (1);
52 selectedObjects[0] = this.getText ();
53 return selectedObjects;
54 });
55 Clazz.overrideMethod (c$, "shouldUpdateSelectedStateFromAction", 
56 function () {
57 return true;
58 });
59 Clazz.defineStatics (c$,
60 "$$uiClassID", "CheckBoxMenuItemUI");
61 });