a277c0b35bd18c0153b29bad3723cfb35b95771a
[jalviewjs.git] / site / swingjs / j2s / javax / swing / text / TextAction.js
1 Clazz.declarePackage ("javax.swing.text");
2 Clazz.load (["javax.swing.AbstractAction"], "javax.swing.text.TextAction", ["java.util.Hashtable", "javax.swing.text.JTextComponent"], function () {
3 c$ = Clazz.declareType (javax.swing.text, "TextAction", javax.swing.AbstractAction);
4 Clazz.defineMethod (c$, "getTextComponent", 
5 function (e) {
6 if (e != null) {
7 var o = e.getSource ();
8 if (Clazz.instanceOf (o, javax.swing.text.JTextComponent)) {
9 return o;
10 }}return this.getFocusedComponent ();
11 }, "java.awt.event.ActionEvent");
12 c$.augmentList = Clazz.defineMethod (c$, "augmentList", 
13 function (list1, list2) {
14 var h =  new java.util.Hashtable ();
15 if (list1 != null) for (var i = 0; i < list1.length; i++) {
16 var a = list1[i];
17 var value = a.getValue ("Name");
18 h.put ((value != null ? value : ""), a);
19 }
20 for (var i = 0; i < list2.length; i++) {
21 var a = list2[i];
22 var value = a.getValue ("Name");
23 h.put ((value != null ? value : ""), a);
24 }
25 var actions =  new Array (h.size ());
26 var index = 0;
27 for (var e = h.elements (); e.hasMoreElements (); ) {
28 actions[index++] = e.nextElement ();
29 }
30 return actions;
31 }, "~A,~A");
32 Clazz.defineMethod (c$, "getFocusedComponent", 
33 function () {
34 return javax.swing.text.JTextComponent.getFocusedComponent ();
35 });
36 });