Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / DefaultCellEditor.js
index 4d803e8..6701640 100644 (file)
-Clazz.declarePackage ("javax.swing");\r
-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
-c$ = Clazz.decorateAsClass (function () {\r
-this.editorComponent = null;\r
-this.delegate = null;\r
-this.clickCountToStart = 1;\r
-if (!Clazz.isClassDefined ("javax.swing.DefaultCellEditor.EditorDelegate")) {\r
-javax.swing.DefaultCellEditor.$DefaultCellEditor$EditorDelegate$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing, "DefaultCellEditor", javax.swing.AbstractCellEditor, [javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor]);\r
-Clazz.makeConstructor (c$, \r
-function (textField) {\r
-Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);\r
-this.editorComponent = textField;\r
-this.clickCountToStart = 2;\r
-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
-textField.addActionListener (this.delegate);\r
-}, "javax.swing.JTextField");\r
-Clazz.makeConstructor (c$, \r
-function (checkBox) {\r
-Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);\r
-this.editorComponent = checkBox;\r
-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
-checkBox.addActionListener (this.delegate);\r
-checkBox.setRequestFocusEnabled (false);\r
-}, "javax.swing.JCheckBox");\r
-Clazz.makeConstructor (c$, \r
-function (comboBox) {\r
-Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);\r
-this.editorComponent = comboBox;\r
-comboBox.putClientProperty ("JComboBox.isTableCellEditor", Boolean.TRUE);\r
-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
-comboBox.addActionListener (this.delegate);\r
-}, "javax.swing.JComboBox");\r
-Clazz.defineMethod (c$, "getComponent", \r
-function () {\r
-return this.editorComponent;\r
-});\r
-Clazz.defineMethod (c$, "setClickCountToStart", \r
-function (count) {\r
-this.clickCountToStart = count;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getClickCountToStart", \r
-function () {\r
-return this.clickCountToStart;\r
-});\r
-Clazz.overrideMethod (c$, "getCellEditorValue", \r
-function () {\r
-return this.delegate.getCellEditorValue ();\r
-});\r
-Clazz.overrideMethod (c$, "isCellEditable", \r
-function (anEvent) {\r
-return this.delegate.isCellEditable (anEvent);\r
-}, "java.util.EventObject");\r
-Clazz.overrideMethod (c$, "shouldSelectCell", \r
-function (anEvent) {\r
-return this.delegate.shouldSelectCell (anEvent);\r
-}, "java.util.EventObject");\r
-Clazz.overrideMethod (c$, "stopCellEditing", \r
-function () {\r
-return this.delegate.stopCellEditing ();\r
-});\r
-Clazz.overrideMethod (c$, "cancelCellEditing", \r
-function () {\r
-this.delegate.cancelCellEditing ();\r
-});\r
-Clazz.overrideMethod (c$, "getTreeCellEditorComponent", \r
-function (tree, value, isSelected, expanded, leaf, row) {\r
-var stringValue = tree.convertValueToText (value, isSelected, expanded, leaf, row, false);\r
-this.delegate.setValue (stringValue);\r
-return this.editorComponent;\r
-}, "javax.swing.JTree,~O,~B,~B,~B,~N");\r
-Clazz.overrideMethod (c$, "getTableCellEditorComponent", \r
-function (table, value, isSelected, row, column) {\r
-this.delegate.setValue (value);\r
-if (Clazz.instanceOf (this.editorComponent, javax.swing.JCheckBox)) {\r
-var renderer = table.getCellRenderer (row, column);\r
-var c = renderer.getTableCellRendererComponent (table, value, isSelected, true, row, column);\r
-if (c != null) {\r
-this.editorComponent.setOpaque (true);\r
-this.editorComponent.setBackground (c.getBackground ());\r
-if (Clazz.instanceOf (c, javax.swing.JComponent)) {\r
-this.editorComponent.setBorder ((c).getBorder ());\r
-}} else {\r
-this.editorComponent.setOpaque (false);\r
-}}return this.editorComponent;\r
-}, "javax.swing.JTable,~O,~B,~N,~N");\r
-c$.$DefaultCellEditor$EditorDelegate$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.value = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.DefaultCellEditor, "EditorDelegate", null, [java.awt.event.ActionListener, java.awt.event.ItemListener]);\r
-Clazz.defineMethod (c$, "getCellEditorValue", \r
-function () {\r
-return this.value;\r
-});\r
-Clazz.defineMethod (c$, "setValue", \r
-function (a) {\r
-this.value = a;\r
-}, "~O");\r
-Clazz.defineMethod (c$, "isCellEditable", \r
-function (a) {\r
-if (Clazz.instanceOf (a, java.awt.event.MouseEvent)) {\r
-return (a).getClickCount () >= this.b$["javax.swing.DefaultCellEditor"].clickCountToStart;\r
-}return true;\r
-}, "java.util.EventObject");\r
-Clazz.defineMethod (c$, "shouldSelectCell", \r
-function (a) {\r
-return true;\r
-}, "java.util.EventObject");\r
-Clazz.defineMethod (c$, "startCellEditing", \r
-function (a) {\r
-return true;\r
-}, "java.util.EventObject");\r
-Clazz.defineMethod (c$, "stopCellEditing", \r
-function () {\r
-this.b$["javax.swing.DefaultCellEditor"].fireEditingStopped ();\r
-return true;\r
-});\r
-Clazz.defineMethod (c$, "cancelCellEditing", \r
-function () {\r
-this.b$["javax.swing.DefaultCellEditor"].fireEditingCanceled ();\r
-});\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (a) {\r
-this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();\r
-}, "java.awt.event.ActionEvent");\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (a) {\r
-this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();\r
-}, "java.awt.event.ItemEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$DefaultCellEditor$1$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$1", javax.swing.DefaultCellEditor.EditorDelegate);\r
-Clazz.defineMethod (c$, "setValue", \r
-function (value) {\r
-this.f$.textField.setText ((value != null) ? value.toString () : "");\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getCellEditorValue", \r
-function () {\r
-return this.f$.textField.getText ();\r
-});\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$DefaultCellEditor$2$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$2", javax.swing.DefaultCellEditor.EditorDelegate);\r
-Clazz.defineMethod (c$, "setValue", \r
-function (value) {\r
-var selected = false;\r
-if (Clazz.instanceOf (value, Boolean)) {\r
-selected = (value).booleanValue ();\r
-} else if (Clazz.instanceOf (value, String)) {\r
-selected = value.equals ("true");\r
-}this.f$.checkBox.setSelected (selected);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getCellEditorValue", \r
-function () {\r
-return Boolean.$valueOf (this.f$.checkBox.isSelected ());\r
-});\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$DefaultCellEditor$3$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$3", javax.swing.DefaultCellEditor.EditorDelegate);\r
-Clazz.defineMethod (c$, "setValue", \r
-function (value) {\r
-this.f$.comboBox.setSelectedItem (value);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getCellEditorValue", \r
-function () {\r
-return this.f$.comboBox.getSelectedItem ();\r
-});\r
-Clazz.defineMethod (c$, "shouldSelectCell", \r
-function (anEvent) {\r
-if (Clazz.instanceOf (anEvent, java.awt.event.MouseEvent)) {\r
-var e = anEvent;\r
-return e.getID () != 506;\r
-}return true;\r
-}, "java.util.EventObject");\r
-Clazz.defineMethod (c$, "stopCellEditing", \r
-function () {\r
-if (this.f$.comboBox.isEditable ()) {\r
-this.f$.comboBox.actionPerformed ( new java.awt.event.ActionEvent (this.b$["javax.swing.DefaultCellEditor"], 0, ""));\r
-}return Clazz.superCall (this, javax.swing.DefaultCellEditor$3, "stopCellEditing", []);\r
-});\r
-c$ = Clazz.p0p ();\r
-};\r
-});\r
+Clazz.declarePackage ("javax.swing");
+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 () {
+c$ = Clazz.decorateAsClass (function () {
+this.editorComponent = null;
+this.delegate = null;
+this.clickCountToStart = 1;
+if (!Clazz.isClassDefined ("javax.swing.DefaultCellEditor.EditorDelegate")) {
+javax.swing.DefaultCellEditor.$DefaultCellEditor$EditorDelegate$ ();
+}
+Clazz.instantialize (this, arguments);
+}, javax.swing, "DefaultCellEditor", javax.swing.AbstractCellEditor, [javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor]);
+Clazz.makeConstructor (c$, 
+function (textField) {
+Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
+this.editorComponent = textField;
+this.clickCountToStart = 2;
+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)));
+textField.addActionListener (this.delegate);
+}, "javax.swing.JTextField");
+Clazz.makeConstructor (c$, 
+function (checkBox) {
+Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
+this.editorComponent = checkBox;
+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)));
+checkBox.addActionListener (this.delegate);
+checkBox.setRequestFocusEnabled (false);
+}, "javax.swing.JCheckBox");
+Clazz.makeConstructor (c$, 
+function (comboBox) {
+Clazz.superConstructor (this, javax.swing.DefaultCellEditor, []);
+this.editorComponent = comboBox;
+comboBox.putClientProperty ("JComboBox.isTableCellEditor", Boolean.TRUE);
+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)));
+comboBox.addActionListener (this.delegate);
+}, "javax.swing.JComboBox");
+Clazz.defineMethod (c$, "getComponent", 
+function () {
+return this.editorComponent;
+});
+Clazz.defineMethod (c$, "setClickCountToStart", 
+function (count) {
+this.clickCountToStart = count;
+}, "~N");
+Clazz.defineMethod (c$, "getClickCountToStart", 
+function () {
+return this.clickCountToStart;
+});
+Clazz.overrideMethod (c$, "getCellEditorValue", 
+function () {
+return this.delegate.getCellEditorValue ();
+});
+Clazz.overrideMethod (c$, "isCellEditable", 
+function (anEvent) {
+return this.delegate.isCellEditable (anEvent);
+}, "java.util.EventObject");
+Clazz.overrideMethod (c$, "shouldSelectCell", 
+function (anEvent) {
+return this.delegate.shouldSelectCell (anEvent);
+}, "java.util.EventObject");
+Clazz.overrideMethod (c$, "stopCellEditing", 
+function () {
+return this.delegate.stopCellEditing ();
+});
+Clazz.overrideMethod (c$, "cancelCellEditing", 
+function () {
+this.delegate.cancelCellEditing ();
+});
+Clazz.overrideMethod (c$, "getTreeCellEditorComponent", 
+function (tree, value, isSelected, expanded, leaf, row) {
+var stringValue = tree.convertValueToText (value, isSelected, expanded, leaf, row, false);
+this.delegate.setValue (stringValue);
+return this.editorComponent;
+}, "javax.swing.JTree,~O,~B,~B,~B,~N");
+Clazz.overrideMethod (c$, "getTableCellEditorComponent", 
+function (table, value, isSelected, row, column) {
+this.delegate.setValue (value);
+if (Clazz.instanceOf (this.editorComponent, javax.swing.JCheckBox)) {
+var renderer = table.getCellRenderer (row, column);
+var c = renderer.getTableCellRendererComponent (table, value, isSelected, true, row, column);
+if (c != null) {
+this.editorComponent.setOpaque (true);
+this.editorComponent.setBackground (c.getBackground ());
+if (Clazz.instanceOf (c, javax.swing.JComponent)) {
+this.editorComponent.setBorder ((c).getBorder ());
+}} else {
+this.editorComponent.setOpaque (false);
+}}return this.editorComponent;
+}, "javax.swing.JTable,~O,~B,~N,~N");
+c$.$DefaultCellEditor$EditorDelegate$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.value = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.DefaultCellEditor, "EditorDelegate", null, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
+Clazz.defineMethod (c$, "getCellEditorValue", 
+function () {
+return this.value;
+});
+Clazz.defineMethod (c$, "setValue", 
+function (a) {
+this.value = a;
+}, "~O");
+Clazz.defineMethod (c$, "isCellEditable", 
+function (a) {
+if (Clazz.instanceOf (a, java.awt.event.MouseEvent)) {
+return (a).getClickCount () >= this.b$["javax.swing.DefaultCellEditor"].clickCountToStart;
+}return true;
+}, "java.util.EventObject");
+Clazz.defineMethod (c$, "shouldSelectCell", 
+function (a) {
+return true;
+}, "java.util.EventObject");
+Clazz.defineMethod (c$, "startCellEditing", 
+function (a) {
+return true;
+}, "java.util.EventObject");
+Clazz.defineMethod (c$, "stopCellEditing", 
+function () {
+this.b$["javax.swing.DefaultCellEditor"].fireEditingStopped ();
+return true;
+});
+Clazz.defineMethod (c$, "cancelCellEditing", 
+function () {
+this.b$["javax.swing.DefaultCellEditor"].fireEditingCanceled ();
+});
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (a) {
+this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();
+}, "java.awt.event.ActionEvent");
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (a) {
+this.b$["javax.swing.DefaultCellEditor"].stopCellEditing ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz.p0p ();
+};
+c$.$DefaultCellEditor$1$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$1", javax.swing.DefaultCellEditor.EditorDelegate);
+Clazz.defineMethod (c$, "setValue", 
+function (value) {
+this.f$.textField.setText ((value != null) ? value.toString () : "");
+}, "~O");
+Clazz.defineMethod (c$, "getCellEditorValue", 
+function () {
+return this.f$.textField.getText ();
+});
+c$ = Clazz.p0p ();
+};
+c$.$DefaultCellEditor$2$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$2", javax.swing.DefaultCellEditor.EditorDelegate);
+Clazz.defineMethod (c$, "setValue", 
+function (value) {
+var selected = false;
+if (Clazz.instanceOf (value, Boolean)) {
+selected = (value).booleanValue ();
+} else if (Clazz.instanceOf (value, String)) {
+selected = value.equals ("true");
+}this.f$.checkBox.setSelected (selected);
+}, "~O");
+Clazz.defineMethod (c$, "getCellEditorValue", 
+function () {
+return Boolean.$valueOf (this.f$.checkBox.isSelected ());
+});
+c$ = Clazz.p0p ();
+};
+c$.$DefaultCellEditor$3$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (javax.swing, "DefaultCellEditor$3", javax.swing.DefaultCellEditor.EditorDelegate);
+Clazz.defineMethod (c$, "setValue", 
+function (value) {
+this.f$.comboBox.setSelectedItem (value);
+}, "~O");
+Clazz.defineMethod (c$, "getCellEditorValue", 
+function () {
+return this.f$.comboBox.getSelectedItem ();
+});
+Clazz.defineMethod (c$, "shouldSelectCell", 
+function (anEvent) {
+if (Clazz.instanceOf (anEvent, java.awt.event.MouseEvent)) {
+var e = anEvent;
+return e.getID () != 506;
+}return true;
+}, "java.util.EventObject");
+Clazz.defineMethod (c$, "stopCellEditing", 
+function () {
+if (this.f$.comboBox.isEditable ()) {
+this.f$.comboBox.actionPerformed ( new java.awt.event.ActionEvent (this.b$["javax.swing.DefaultCellEditor"], 0, ""));
+}return Clazz.superCall (this, javax.swing.DefaultCellEditor$3, "stopCellEditing", []);
+});
+c$ = Clazz.p0p ();
+};
+});