1 Clazz.declarePackage ("javax.swing");
\r
2 Clazz.load (["java.awt.event.ActionListener", "$.ItemListener", "javax.swing.AbstractCellEditor", "javax.swing.table.TableCellEditor", "javax.swing.tree.TreeCellEditor"], "javax.swing.DefaultCellEditor", ["java.lang.Boolean", "java.awt.event.ActionEvent", "$.MouseEvent", "javax.swing.JCheckBox", "$.JComponent"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.editorComponent = null;
\r
5 this.delegate = null;
\r
6 this.clickCountToStart = 1;
\r
7 if (!Clazz.isClassDefined ("javax.swing.DefaultCellEditor.EditorDelegate")) {
\r
8 javax.swing.DefaultCellEditor.$DefaultCellEditor$EditorDelegate$ ();
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, javax.swing, "DefaultCellEditor", javax.swing.AbstractCellEditor, [javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor]);
\r
12 Clazz.makeConstructor (c$,
\r
13 function (textField) {
\r
14 Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
\r
15 this.editorComponent = textField;
\r
16 this.clickCountToStart = 2;
\r
17 this.delegate = ((Clazz.isClassDefined ("javax.swing.DefaultCellEditor$1") ? 0 : javax.swing.DefaultCellEditor.$DefaultCellEditor$1$ ()), Clazz.innerTypeInstance (javax.swing.DefaultCellEditor$1, this, Clazz.cloneFinals ("textField", textField)));
\r
18 textField.addActionListener (this.delegate);
\r
19 }, "javax.swing.JTextField");
\r
20 Clazz.makeConstructor (c$,
\r
21 function (checkBox) {
\r
22 Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
\r
23 this.editorComponent = checkBox;
\r
24 this.delegate = ((Clazz.isClassDefined ("javax.swing.DefaultCellEditor$2") ? 0 : javax.swing.DefaultCellEditor.$DefaultCellEditor$2$ ()), Clazz.innerTypeInstance (javax.swing.DefaultCellEditor$2, this, Clazz.cloneFinals ("checkBox", checkBox)));
\r
25 checkBox.addActionListener (this.delegate);
\r
26 checkBox.setRequestFocusEnabled (false);
\r
27 }, "javax.swing.JCheckBox");
\r
28 Clazz.makeConstructor (c$,
\r
29 function (comboBox) {
\r
30 Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
\r
31 this.editorComponent = comboBox;
\r
32 comboBox.putClientProperty ("JComboBox.isTableCellEditor", Boolean.TRUE);
\r
33 this.delegate = ((Clazz.isClassDefined ("javax.swing.DefaultCellEditor$3") ? 0 : javax.swing.DefaultCellEditor.$DefaultCellEditor$3$ ()), Clazz.innerTypeInstance (javax.swing.DefaultCellEditor$3, this, Clazz.cloneFinals ("comboBox", comboBox)));
\r
34 comboBox.addActionListener (this.delegate);
\r
35 }, "javax.swing.JComboBox");
\r
36 Clazz.defineMethod (c$, "getComponent",
\r
38 return this.editorComponent;
\r
40 Clazz.defineMethod (c$, "setClickCountToStart",
\r
42 this.clickCountToStart = count;
\r
44 Clazz.defineMethod (c$, "getClickCountToStart",
\r
46 return this.clickCountToStart;
\r
48 Clazz.overrideMethod (c$, "getCellEditorValue",
\r
50 return this.delegate.getCellEditorValue ();
\r
52 Clazz.overrideMethod (c$, "isCellEditable",
\r
53 function (anEvent) {
\r
54 return this.delegate.isCellEditable (anEvent);
\r
55 }, "java.util.EventObject");
\r
56 Clazz.overrideMethod (c$, "shouldSelectCell",
\r
57 function (anEvent) {
\r
58 return this.delegate.shouldSelectCell (anEvent);
\r
59 }, "java.util.EventObject");
\r
60 Clazz.overrideMethod (c$, "stopCellEditing",
\r
62 return this.delegate.stopCellEditing ();
\r
64 Clazz.overrideMethod (c$, "cancelCellEditing",
\r
66 this.delegate.cancelCellEditing ();
\r
68 Clazz.overrideMethod (c$, "getTreeCellEditorComponent",
\r
69 function (tree, value, isSelected, expanded, leaf, row) {
\r
70 var stringValue = tree.convertValueToText (value, isSelected, expanded, leaf, row, false);
\r
71 this.delegate.setValue (stringValue);
\r
72 return this.editorComponent;
\r
73 }, "javax.swing.JTree,~O,~B,~B,~B,~N");
\r
74 Clazz.overrideMethod (c$, "getTableCellEditorComponent",
\r
75 function (table, value, isSelected, row, column) {
\r
76 this.delegate.setValue (value);
\r
77 if (Clazz.instanceOf (this.editorComponent, javax.swing.JCheckBox)) {
\r
78 var renderer = table.getCellRenderer (row, column);
\r
79 var c = renderer.getTableCellRendererComponent (table, value, isSelected, true, row, column);
\r
81 this.editorComponent.setOpaque (true);
\r
82 this.editorComponent.setBackground (c.getBackground ());
\r
83 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
\r
84 this.editorComponent.setBorder ((c).getBorder ());
\r
86 this.editorComponent.setOpaque (false);
\r
87 }}return this.editorComponent;
\r
88 }, "javax.swing.JTable,~O,~B,~N,~N");
\r
89 c$.$DefaultCellEditor$EditorDelegate$ = function () {
\r
90 Clazz.pu$h(self.c$);
\r
91 c$ = Clazz.decorateAsClass (function () {
\r
92 Clazz.prepareCallback (this, arguments);
\r
94 Clazz.instantialize (this, arguments);
\r
95 }, javax.swing.DefaultCellEditor, "EditorDelegate", null, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
\r
96 Clazz.defineMethod (c$, "getCellEditorValue",
\r
100 Clazz.defineMethod (c$, "setValue",
\r
104 Clazz.defineMethod (c$, "isCellEditable",
\r
106 if (Clazz.instanceOf (a, java.awt.event.MouseEvent)) {
\r
107 return (a).getClickCount () >= this.b$["javax.swing.DefaultCellEditor"].clickCountToStart;
\r
109 }, "java.util.EventObject");
\r
110 Clazz.defineMethod (c$, "shouldSelectCell",
\r
113 }, "java.util.EventObject");
\r
114 Clazz.defineMethod (c$, "startCellEditing",
\r
117 }, "java.util.EventObject");
\r
118 Clazz.defineMethod (c$, "stopCellEditing",
\r
120 this.b$["javax.swing.DefaultCellEditor"].fireEditingStopped ();
\r
123 Clazz.defineMethod (c$, "cancelCellEditing",
\r
125 this.b$["javax.swing.DefaultCellEditor"].fireEditingCanceled ();
\r
127 Clazz.overrideMethod (c$, "actionPerformed",
\r
129 this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();
\r
130 }, "java.awt.event.ActionEvent");
\r
131 Clazz.overrideMethod (c$, "itemStateChanged",
\r
133 this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();
\r
134 }, "java.awt.event.ItemEvent");
\r
137 c$.$DefaultCellEditor$1$ = function () {
\r
138 Clazz.pu$h(self.c$);
\r
139 c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$1", javax.swing.DefaultCellEditor.EditorDelegate);
\r
140 Clazz.defineMethod (c$, "setValue",
\r
142 this.f$.textField.setText ((value != null) ? value.toString () : "");
\r
144 Clazz.defineMethod (c$, "getCellEditorValue",
\r
146 return this.f$.textField.getText ();
\r
150 c$.$DefaultCellEditor$2$ = function () {
\r
151 Clazz.pu$h(self.c$);
\r
152 c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$2", javax.swing.DefaultCellEditor.EditorDelegate);
\r
153 Clazz.defineMethod (c$, "setValue",
\r
155 var selected = false;
\r
156 if (Clazz.instanceOf (value, Boolean)) {
\r
157 selected = (value).booleanValue ();
\r
158 } else if (Clazz.instanceOf (value, String)) {
\r
159 selected = value.equals ("true");
\r
160 }this.f$.checkBox.setSelected (selected);
\r
162 Clazz.defineMethod (c$, "getCellEditorValue",
\r
164 return Boolean.$valueOf (this.f$.checkBox.isSelected ());
\r
168 c$.$DefaultCellEditor$3$ = function () {
\r
169 Clazz.pu$h(self.c$);
\r
170 c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$3", javax.swing.DefaultCellEditor.EditorDelegate);
\r
171 Clazz.defineMethod (c$, "setValue",
\r
173 this.f$.comboBox.setSelectedItem (value);
\r
175 Clazz.defineMethod (c$, "getCellEditorValue",
\r
177 return this.f$.comboBox.getSelectedItem ();
\r
179 Clazz.defineMethod (c$, "shouldSelectCell",
\r
180 function (anEvent) {
\r
181 if (Clazz.instanceOf (anEvent, java.awt.event.MouseEvent)) {
\r
183 return e.getID () != 506;
\r
185 }, "java.util.EventObject");
\r
186 Clazz.defineMethod (c$, "stopCellEditing",
\r
188 if (this.f$.comboBox.isEditable ()) {
\r
189 this.f$.comboBox.actionPerformed ( new java.awt.event.ActionEvent (this.b$["javax.swing.DefaultCellEditor"], 0, ""));
\r
190 }return Clazz.superCall (this, javax.swing.DefaultCellEditor$3, "stopCellEditing", []);
\r