1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.Action", "$.ArrayTable"], "javax.swing.AbstractAction", ["java.lang.Boolean", "javax.swing.event.SwingPropertyChangeSupport"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.arrayTable = null;
6 this.changeSupport = null;
7 Clazz.instantialize (this, arguments);
8 }, javax.swing, "AbstractAction", null, [javax.swing.Action, Cloneable]);
9 c$.shouldReconfigure = Clazz.defineMethod (c$, "shouldReconfigure",
11 if (e.getPropertyName () == null) {
12 javax.swing.AbstractAction.RECONFIGURE_ON_NULL = new Boolean (false);
14 }, "java.beans.PropertyChangeEvent");
15 c$.setEnabledFromAction = Clazz.defineMethod (c$, "setEnabledFromAction",
17 c.setEnabled ((a != null) ? a.isEnabled () : true);
18 }, "javax.swing.JComponent,javax.swing.Action");
19 c$.setToolTipTextFromAction = Clazz.defineMethod (c$, "setToolTipTextFromAction",
21 c.setToolTipText (a != null ? a.getValue ("ShortDescription") : null);
22 }, "javax.swing.JComponent,javax.swing.Action");
23 c$.hasSelectedKey = Clazz.defineMethod (c$, "hasSelectedKey",
25 return (a != null && a.getValue ("SwingSelectedKey") != null);
26 }, "javax.swing.Action");
27 c$.isSelected = Clazz.defineMethod (c$, "isSelected",
29 return Boolean.TRUE.equals (a.getValue ("SwingSelectedKey"));
30 }, "javax.swing.Action");
31 Clazz.makeConstructor (c$,
34 Clazz.makeConstructor (c$,
36 this.putValue ("Name", name);
38 Clazz.makeConstructor (c$,
39 function (name, icon) {
40 this.construct (name);
41 this.putValue ("SmallIcon", icon);
42 }, "~S,javax.swing.Icon");
43 Clazz.defineMethod (c$, "getValue",
45 if (key === "enabled") {
47 }if (this.arrayTable == null) {
49 }return this.arrayTable.get (key);
51 Clazz.overrideMethod (c$, "putValue",
52 function (key, newValue) {
54 if (key === "enabled") {
55 if (newValue == null || !(Clazz.instanceOf (newValue, Boolean))) {
56 newValue = new Boolean (false);
57 }oldValue = new Boolean (this.enabled);
58 this.enabled = (newValue).booleanValue ();
60 if (this.arrayTable == null) {
61 this.arrayTable = new javax.swing.ArrayTable ();
62 }if (this.arrayTable.containsKey (key)) oldValue = this.arrayTable.get (key);
63 if (newValue == null) {
64 this.arrayTable.remove (key);
66 this.arrayTable.put (key, newValue);
67 }}this.firePropertyChange (key, oldValue, newValue);
69 Clazz.defineMethod (c$, "isEnabled",
73 Clazz.overrideMethod (c$, "setEnabled",
75 var oldValue = this.enabled;
76 if (oldValue != newValue) {
77 this.enabled = newValue;
78 this.firePropertyChange ("enabled", Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue));
80 Clazz.defineMethod (c$, "getKeys",
82 if (this.arrayTable == null) {
84 }var keys = new Array (this.arrayTable.size ());
85 this.arrayTable.getKeys (keys);
88 Clazz.defineMethod (c$, "firePropertyChange",
89 function (propertyName, oldValue, newValue) {
90 if (this.changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) {
92 }this.changeSupport.firePropertyChange (propertyName, oldValue, newValue);
94 Clazz.overrideMethod (c$, "addPropertyChangeListener",
96 if (this.changeSupport == null) {
97 this.changeSupport = new javax.swing.event.SwingPropertyChangeSupport (this);
98 }this.changeSupport.addPropertyChangeListener (listener);
99 }, "java.beans.PropertyChangeListener");
100 Clazz.overrideMethod (c$, "removePropertyChangeListener",
101 function (listener) {
102 if (this.changeSupport == null) {
104 }this.changeSupport.removePropertyChangeListener (listener);
105 }, "java.beans.PropertyChangeListener");
106 Clazz.defineMethod (c$, "getPropertyChangeListeners",
108 if (this.changeSupport == null) {
109 return new Array (0);
110 }return this.changeSupport.getPropertyChangeListeners ();
112 Clazz.defineMethod (c$, "clone",
114 var newAction = Clazz.superCall (this, javax.swing.AbstractAction, "clone", []);
116 if (this.arrayTable != null) {
117 newAction.arrayTable = this.arrayTable.clone ();
120 Clazz.defineStatics (c$,
121 "RECONFIGURE_ON_NULL", null);