1 package org.devaki.nextobjects.ui.workspace.models.objects;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import java.util.Vector;
22 import java.awt.Component;
23 import java.awt.GridBagConstraints;
24 import java.awt.GridBagLayout;
25 import java.awt.Insets;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
28 import java.awt.event.KeyAdapter;
29 import java.awt.event.KeyEvent;
30 import java.awt.event.MouseAdapter;
31 import java.awt.event.MouseEvent;
32 import javax.swing.BorderFactory;
33 import javax.swing.DefaultCellEditor;
34 import javax.swing.JButton;
35 import javax.swing.JCheckBox;
36 import javax.swing.JPanel;
37 import javax.swing.JScrollPane;
38 import javax.swing.JTable;
39 import javax.swing.JTextField;
40 import javax.swing.table.AbstractTableModel;
41 import javax.swing.DefaultListSelectionModel;
42 import javax.swing.table.JTableHeader;
43 import javax.swing.table.TableCellRenderer;
44 import javax.swing.table.TableColumnModel;
45 import org.devaki.nextobjects.constants.CstImages;
46 import org.devaki.nextobjects.ui.components.CustomButton;
47 import org.devaki.nextobjects.ui.components.CustomComboBox;
48 import org.devaki.nextobjects.ui.components.CustomTable;
49 import org.devaki.nextobjects.util.NOPreferences;
50 import org.devaki.nextobjects.util.ModelMan;
51 import org.devaki.nextobjects.workspace.models.objects.BaseClass;
52 import org.devaki.nextobjects.workspace.models.columns.Column;
53 import org.devaki.nextobjects.workspace.models.columns.ColumnType;
54 /***
55 * Provide a jtable representing columns and the ability to edit them
56 *
57 * @author <a href="mailto:eflorent@devaki.org">Emmanuel Florent</a>
58 */
59 public class DataDictionaryEdit extends JPanel
60 {
61 /***
62 * Selected row in the jTable
63 */
64 private int selectedRow = -1;
65 /***
66 * The combobox initialized with the torque's types
67 */
68 private CustomComboBox jComboBoxType =
69 new CustomComboBox(NOPreferences.TORQUE_TYPES, -1, "", true);
70 /***
71 * The combobox for javanaming method
72 */
73 private CustomComboBox jComboBoxColumnJavaNamingMethod;
74 /***
75 * the combobox for inheritance
76 */
77 private CustomComboBox jComboBoxInheritance;
78 /***
79 * The combobox for java type
80 */
81 private CustomComboBox jComboBoxJavaType;
82 /***
83 * The previous (UP) button
84 */
85 private CustomButton jButtonPrevious =
86 new CustomButton(CstImages.ICN_UP, "Move the selected field up", true);
87 /***
88 * The next (DOWN) button
89 */
90 private CustomButton jButtonNext =
91 new CustomButton(
92 CstImages.ICN_DOWN,
93 "Move the selected field down",
94 true);
95 /***
96 * The remove button
97 */
98 private CustomButton jButtonRemove =
99 new CustomButton("Remove", "Remove the selected field", true, false);
100 /***
101 * The new button
102 */
103 private CustomButton jButtonNew =
104 new CustomButton("New", "Create a new field", true, false);
105 /***
106 * The table for columns
107 */
108 private CustomTable jTableColumns =
109 new CustomTable(
110 false,
111 DefaultListSelectionModel.SINGLE_SELECTION,
112 false,
113 false);
114 /***
115 * The table model
116 */
117 private ObjectColumnsTableModel model = new ObjectColumnsTableModel();
118 /***
119 * Constructor
120 *
121 */
122 public DataDictionaryEdit()
123 {
124 super(new GridBagLayout());
125 String[] temp2 = { "nochange", "underscore", "javaname" };
126 this.jComboBoxColumnJavaNamingMethod =
127 new CustomComboBox(temp2, -1, "", true);
128
129 String[] temp4 = { "single", "false" };
130 this.jComboBoxInheritance = new CustomComboBox(temp4, -1, "", true);
131
132 String[] temp3 = { "object", "primitive" };
133 this.jComboBoxJavaType = new CustomComboBox(temp3, -1, "", true);
134
135
136 this.jTableColumns.setModel(this.model);
137
138 this.jTableColumns.getColumnModel().getColumn(1).setCellEditor(
139 new CodeEditor(new CodeRenderer()));
140 this.jTableColumns.getColumnModel().getColumn(1).setCellRenderer(
141 new CodeRenderer());
142
143 this.jTableColumns.getColumnModel().getColumn(2).setCellEditor(
144 new DefaultCellEditor(this.jComboBoxType));
145
146 this.jTableColumns.getColumnModel().getColumn(11).setCellEditor(
147 new DefaultCellEditor(this.jComboBoxColumnJavaNamingMethod));
148
149 this.jTableColumns.getColumnModel().getColumn(12).setCellEditor(
150 new DefaultCellEditor(this.jComboBoxJavaType));
151
152 this.jTableColumns.getColumnModel().getColumn(13).setCellEditor(
153 new DefaultCellEditor(this.jComboBoxInheritance));
154
155 this.jTableColumns.setTableHeader(
156 new ToolTipHeader(this.jTableColumns.getColumnModel()));
157
158 this.setColumnsWidth();
159 this.jComboBoxType.addActionListener(new ActionListener()
160 {
161 public final void actionPerformed(final ActionEvent e)
162 {
163 if (jTableColumns.getSelectedRow() >= 0)
164 {
165 String size =
166 ((Column) model
167 .getColumns()
168 .elementAt(jTableColumns.getSelectedRow()))
169 .getType()
170 .getDefaultSize();
171 size =
172 ((ColumnType) jComboBoxType.getSelectedItem())
173 .getDefaultSize();
174 (
175 (Column) model.getColumns().elementAt(
176 jTableColumns.getSelectedRow())).setSize(
177 size);
178 }
179 }
180 });
181
182 this.add(
183 new JScrollPane(this.jTableColumns),
184 new GridBagConstraints(
185 0,
186 0,
187 5,
188 1,
189 1.0,
190 1.0,
191 GridBagConstraints.CENTER,
192 GridBagConstraints.BOTH,
193 new Insets(5, 5, 0, 5),
194 0,
195 0));
196 this.add(
197 this.jButtonNew,
198 new GridBagConstraints(
199 0,
200 1,
201 1,
202 1,
203 0.0,
204 0.0,
205 GridBagConstraints.CENTER,
206 GridBagConstraints.NONE,
207 new Insets(5, 5, 5, 5),
208 0,
209 0));
210 this.add(
211 this.jButtonRemove,
212 new GridBagConstraints(
213 1,
214 1,
215 1,
216 1,
217 0.0,
218 0.0,
219 GridBagConstraints.CENTER,
220 GridBagConstraints.NONE,
221 new Insets(5, 0, 5, 5),
222 0,
223 0));
224 this.add(
225 this.jButtonPrevious,
226 new GridBagConstraints(
227 2,
228 1,
229 1,
230 1,
231 1.0,
232 0.0,
233 GridBagConstraints.EAST,
234 GridBagConstraints.NONE,
235 new Insets(5, 0, 5, 5),
236 0,
237 0));
238 this.add(
239 this.jButtonNext,
240 new GridBagConstraints(
241 3,
242 1,
243 1,
244 1,
245 0.0,
246 0.0,
247 GridBagConstraints.CENTER,
248 GridBagConstraints.NONE,
249 new Insets(5, 0, 5, 5),
250 0,
251 0));
252
253
254 this.jButtonPrevious.addActionListener(new ActionListener()
255 {
256
257
258 public final void actionPerformed(final ActionEvent e)
259 {
260
261
262 if (selectedRow > 0)
263 {
264 model.insertField(
265 (Column) model.getColumns().elementAt(selectedRow - 1),
266 selectedRow + 1);
267 model.removeField(selectedRow - 1);
268 jTableColumns.setSelectedRow(--selectedRow);
269 }
270 }
271 });
272 this.jButtonNext.addActionListener(new ActionListener()
273 {
274
275
276 public final void actionPerformed(final ActionEvent e)
277 {
278
279
280 if ((selectedRow > -1)
281 && (selectedRow < (jTableColumns.getRowCount() - 1)))
282 {
283 model.insertField(
284 (Column) model.getColumns().elementAt(selectedRow),
285 selectedRow + 2);
286 model.removeField(selectedRow);
287 jTableColumns.setSelectedRow(++selectedRow);
288 }
289 }
290 });
291 this.jButtonRemove.addActionListener(new ActionListener()
292 {
293
294 public final void actionPerformed(final ActionEvent e)
295 {
296 model.removeField(selectedRow);
297
298
299 if ((jTableColumns.getRowCount() > 0) && (selectedRow == 0))
300 {
301 jTableColumns.setSelectedRow(0);
302 }
303
304 else
305 {
306 jTableColumns.setSelectedRow(--selectedRow);
307 }
308
309
310
311 if (selectedRow == -1)
312 {
313 jButtonRemove.setEnabled(false);
314 }
315 }
316 });
317 this.jButtonNew.addActionListener(new ActionListener()
318 {
319
320 public final void actionPerformed(final ActionEvent e)
321 {
322
323 Column tmpColumn =
324 new Column(
325 new StringBuffer()
326 .append("Item ")
327 .append(jTableColumns.getRowCount())
328 .toString(),
329 new StringBuffer()
330 .append("item_")
331 .append(jTableColumns.getRowCount())
332 .toString(),
333 (ColumnType) NOPreferences.TORQUE_TYPES.firstElement(),
334 ((ColumnType) NOPreferences
335 .TORQUE_TYPES
336 .firstElement())
337 .getDefaultSize(),
338 "",
339 false,
340 false,
341 false,
342 false,
343 false,
344 "",
345 "",
346 "",
347 "",
348 "",
349 "",
350 (BaseClass) ModelMan.getCurrentObject());
351
352
353 if (jTableColumns.getRowCount() == 0)
354 {
355 jTableColumns.getColumnModel().getColumn(1).setCellEditor(
356 new CodeEditor(new CodeRenderer()));
357 jTableColumns.getColumnModel().getColumn(
358 1).setCellRenderer(
359 new CodeRenderer());
360 }
361
362 model.addColumn(tmpColumn);
363
364 selectedRow = jTableColumns.getRowCount() - 1;
365
366 jTableColumns.setSelectedRow(selectedRow);
367
368 jButtonRemove.setEnabled(true);
369 }
370 });
371
372 this.jTableColumns.addMouseListener(new MouseAdapter()
373 {
374
375 public final void mouseClicked(final MouseEvent e)
376 {
377
378 selectedRow = jTableColumns.getSelectedRow();
379
380 jButtonRemove.setEnabled(true);
381 }
382 });
383
384 this.jTableColumns.addKeyListener(new KeyAdapter()
385 {
386
387 public final void keyReleased(final KeyEvent e)
388 {
389
390 selectedRow = jTableColumns.getSelectedRow();
391
392 jButtonRemove.setEnabled(true);
393 }
394 });
395 this.setBorder(BorderFactory.createTitledBorder("Columns"));
396 }
397 /***
398 * Unused: Cancel edition if 'DataDictionaryEdit' was
399 * edited in its previous call
400 */
401 public final void cancelCellEditing()
402 {
403 if (this.jTableColumns.isEditing())
404 {
405 int tmpInt1 = this.jTableColumns.getEditingRow();
406 int tmpInt2 = this.jTableColumns.getEditingColumn();
407 this
408 .jTableColumns
409 .getCellEditor(tmpInt1, tmpInt2)
410 .cancelCellEditing();
411 }
412 }
413 /***
414 * Reset 'jTableField' columns width
415 */
416 private void setColumnsWidth()
417 {
418 for (int i = 0; i < this.model.getColumnCount(); i++)
419 {
420 this.jTableColumns.getColumnModel().getColumn(i).setPreferredWidth(
421 this.model.getColumnSize(i));
422 }
423 }
424 /***
425 * set the object column table model
426 * @param pModel the object column table model
427 */
428 protected final void setModel(final ObjectColumnsTableModel pModel)
429 {
430 this.model = pModel;
431 }
432 /***
433 * get the object column table model
434 * @return the object column table model
435 */
436 protected final ObjectColumnsTableModel getModel()
437 {
438 return model;
439 }
440 /***
441 * This class define a model to edit the object columns
442 */
443 public class ObjectColumnsTableModel extends AbstractTableModel
444 {
445 /*** The data stored to be restored with cancel button */
446 private Vector oldData = new Vector();
447 /***
448 * The column name
449 */
450 private final String[] columnNames =
451 { "Name", "Code", "Type", "Size", "P",
452 "R",
453 "A",
454 "U",
455 "I",
456 "Default",
457 "Java Naming Method",
458 "Java Name",
459 "Java Type",
460 "Inheritance",
461 "Input Validator",
462 "Description" };
463 /***
464 * The column class/types
465 */
466 private final Class[] columnClasses =
467 {
468 String.class,
469 String.class,
470 String.class,
471 String.class,
472 Boolean.class,
473 Boolean.class,
474 Boolean.class,
475 Boolean.class,
476 Boolean.class,
477 String.class,
478 String.class,
479 String.class,
480 String.class,
481 String.class,
482 String.class,
483 String.class };
484 /***
485 * The column size
486 */
487 private final int[] columnSizes =
488 {
489 110,
490 110,
491 110,
492 40,
493 25,
494 25,
495 25,
496 25,
497 25,
498 110,
499 150,
500 110,
501 110,
502 110,
503 120,
504 110 };
505 /***
506 * The columns
507 */
508 private Vector columns;
509 /***
510 * Return the data contained in the JTable
511 * @return colums
512 */
513 public final Vector getColumns()
514 {
515 return this.columns;
516 }
517 /***
518 * Reset the TableModel to its old values
519 */
520 public final void resetColumns()
521 {
522 cancelCellEditing();
523 this.columns = new Vector(oldData);
524 }
525 /***
526 * Set data in the JTable
527 * @param pData the columns
528 */
529 public final void setColumns(final Vector pData)
530 {
531
532 oldData.removeAllElements();
533 for (int i = 0; i < pData.size(); i++)
534 {
535 Column oldCol = (Column) pData.elementAt(i);
536 Column newCol = new Column(oldCol);
537 oldData.addElement(newCol);
538 }
539
540 this.columns = new Vector(pData);
541 }
542 /***
543 * Add a field
544 * @param pColumn the column
545 */
546 public final void addColumn(final Column pColumn)
547 {
548 this.columns.addElement(pColumn);
549 this.fireTableRowsInserted(
550 this.columns.size() - 1,
551 this.columns.size() - 1);
552 }
553 /***
554 * Add a field at a particular index
555 * @param pColumn the column
556 * @param i index
557 */
558 public final void insertField(final Column pColumn, final int i)
559 {
560 this.columns.insertElementAt(pColumn, i);
561 this.fireTableRowsInserted(
562 this.columns.size() - 1,
563 this.columns.size() - 1);
564 }
565 /***
566 * Remove a field at a particular index
567 * @param i index
568 */
569 public final void removeField(final int i)
570 {
571 if (i >= 0 && i < columns.size())
572 {
573 this.columns.removeElementAt(i);
574 this.fireTableRowsDeleted(
575 this.columns.size() - 1,
576 this.columns.size() - 1);
577 }
578 }
579 /***
580 * Return the number of columns
581 * @return count
582 */
583 public final int getColumnCount()
584 {
585 return this.columnNames.length;
586 }
587 /***
588 * Return the number of lines
589 * @return the count of row, number of columns.
590 */
591 public final int getRowCount()
592 {
593 return this.columns.size();
594 }
595 /***
596 * Return the name of the column at the specified index
597 * @param i index
598 * @return column
599 */
600 public final String getColumnName(final int i)
601 {
602 return this.columnNames[i];
603 }
604 /***
605 * Return the class of the column at the specified index
606 * @param i index
607 * @return class
608 */
609 public final Class getColumnClass(final int i)
610 {
611 return this.columnClasses[i];
612 }
613 /***
614 * Return the size of the column at the specified index
615 * @param i index
616 * @return the size
617 */
618 public final int getColumnSize(final int i)
619 {
620 return this.columnSizes[i];
621 }
622 /***
623 * Return the value at the specified row and column
624 * @param row row index
625 * @param col column index
626 * @return the value
627 */
628 public final Object getValueAt(final int row, final int col)
629 {
630 Column newField = (Column) columns.elementAt(row);
631 switch (col)
632 {
633 case 0 :
634 return newField.getName();
635 case 1 :
636 return newField.getCode();
637 case 2 :
638 return newField.getType();
639 case 3 :
640 return newField.getSize();
641 case 4 :
642 return new Boolean(newField.isPk());
643 case 5 :
644 return new Boolean(newField.isRequired());
645 case 6 :
646 return new Boolean(newField.isAutoIncrement());
647 case 7 :
648 return new Boolean(newField.isUnique());
649 case 8 :
650 return new Boolean(newField.isIndex());
651 case 9 :
652 return newField.getDefaultValue();
653 case 10 :
654 return newField.getJavaNamingMethod();
655 case 11 :
656 return newField.getJavaName();
657 case 12 :
658 return newField.getJavaType();
659 case 13 :
660 return newField.getInheritance();
661 case 14 :
662 return newField.getInputValidator();
663 case 15 :
664 return newField.getDescription();
665 default :
666 return null;
667 }
668 }
669 /***
670 * Set the specified value at the specified row and column
671 * @param value value
672 * @param row row index
673 * @param col column index
674 */
675 public final void setValueAt(
676 final Object value,
677 final int row,
678 final int col)
679 {
680 Column newField = (Column) columns.elementAt(row);
681 switch (col)
682 {
683 case 0 :
684 if (value.toString().length() != 0)
685 {
686 newField.setName(value.toString());
687 }
688 break;
689 case 1 :
690 if (value.toString().length() != 0)
691 {
692 newField.setCode(value.toString());
693 }
694 break;
695 case 2 :
696 newField.setType((ColumnType) value);
697 break;
698 case 3 :
699 newField.setSize(value.toString());
700 break;
701 case 4 :
702 if ((new Boolean(value.toString())).booleanValue())
703 {
704 newField.setPrimaryKey(true);
705 newField.setRequired(true);
706 newField.setUnique(false);
707 newField.setIndex(false);
708 }
709 else
710 {
711 newField.setPrimaryKey(false);
712 }
713 break;
714 case 5 :
715 newField.setRequired(
716 (new Boolean(value.toString())).booleanValue());
717 break;
718 case 6 :
719 newField.setAutoIncrement(
720 (new Boolean(value.toString())).booleanValue());
721 break;
722 case 7 :
723 if ((new Boolean(value.toString())).booleanValue())
724 {
725 newField.setUnique(true);
726 newField.setPrimaryKey(false);
727 }
728 else
729 {
730 newField.setUnique(false);
731 }
732 break;
733 case 8 :
734 if ((new Boolean(value.toString())).booleanValue())
735 {
736 newField.setIndex(true);
737 newField.setPrimaryKey(false);
738 }
739 else
740 {
741 newField.setIndex(false);
742 }
743 break;
744 case 9 :
745 newField.setDefaultValue(value.toString());
746 break;
747 case 10 :
748 newField.setJavaNamingMethod(value.toString());
749 break;
750 case 11 :
751 newField.setJavaName(value.toString());
752 break;
753 case 12 :
754 newField.setJavaType(value.toString());
755 break;
756 case 13 :
757 newField.setInheritance(value.toString());
758 break;
759 case 14 :
760 newField.setInputValidator(value.toString());
761 break;
762 case 15 :
763 newField.setDescription(value.toString());
764 break;
765 }
766
767 this.columns.setElementAt(newField, row);
768 this.fireTableDataChanged();
769
770 jTableColumns.setSelectedRow(row);
771 }
772 /***
773 * Return that every cell is editable
774 * @param row row index
775 * @param col column index
776 * @return is editable
777 */
778 public final boolean isCellEditable(final int row, final int col)
779 {
780 return true;
781 }
782 }
783 /***
784 * Define the tooltips of the 'jTableField' header
785 */
786 private class ToolTipHeader extends JTableHeader
787 {
788 /***
789 * The tooltips
790 */
791 private String[] toolTips =
792 {
793 "Name of the field",
794 "Code of the field",
795 "Type of field",
796 "Type size",
797 "Is primary key ?",
798 "Is required ?",
799 "Is auto-incrementation on ?",
800 "Is unique ?",
801 "Is to be indexed ?",
802 "Default value",
803 "How to convert to the Java class name ?",
804 "Name in Java",
805 "Type used in Java",
806 " - - ",
807 " - - ",
808 "Description of the column" };
809 /***
810 * Construct a new 'ToolTipHeader' object
811 * @param pModel the TableColumnModel
812 */
813 public ToolTipHeader(final TableColumnModel pModel)
814 {
815 super(pModel);
816 }
817 /***
818 * Return the tool tip depending on the mouse cursor position
819 * @param e the event
820 * @return the tooltip
821 */
822 public final String getToolTipText(final MouseEvent e)
823 {
824 int col = this.columnAtPoint(e.getPoint());
825 int modelCol = this.getTable().convertColumnIndexToModel(col);
826 return toolTips[modelCol];
827 }
828 }
829 /***
830 * Define a cell renderer for the Code column
831 * It is composed of a textfield and a button
832 * Clicking ion the button set a default textfield
833 * from the <code>name</code> textfield
834 */
835 private class CodeRenderer extends JPanel implements TableCellRenderer
836 {
837 /***
838 * The equal button
839 */
840 private CustomButton jButtonEqual =
841 new CustomButton("=", "Automatic field code", true, true);
842 /***
843 * The code text field
844 */
845 private JTextField jTextFieldCode = new JTextField("");
846 /***
847 * Construct a new 'CodeRenderer' object
848 */
849 public CodeRenderer()
850 {
851 super(new GridBagLayout());
852
853 this.jTextFieldCode.setBorder(null);
854 /*** Assembling components **/
855 this.add(
856 jButtonEqual,
857 new GridBagConstraints(
858 0,
859 0,
860 1,
861 1,
862 0.0,
863 0.0,
864 GridBagConstraints.CENTER,
865 GridBagConstraints.NONE,
866 new Insets(0, 0, 0, 0),
867 0,
868 0));
869 this.add(
870 jTextFieldCode,
871 new GridBagConstraints(
872 1,
873 0,
874 1,
875 1,
876 1.0,
877 0.0,
878 GridBagConstraints.CENTER,
879 GridBagConstraints.HORIZONTAL,
880 new Insets(0, 0, 0, 0),
881 0,
882 0));
883 }
884 /***
885 * Return 'this' as the component to render the cell
886 * @param table table
887 * @param value value
888 * @param isSelected is selected
889 * @param hasFocus has focus
890 * @param rowIndex row index
891 * @param vColIndex column index
892 * @return the component
893 */
894 public final Component getTableCellRendererComponent(
895 final JTable table,
896 final Object value,
897 final boolean isSelected,
898 final boolean hasFocus,
899 final int rowIndex,
900 final int vColIndex)
901 {
902 this.jTextFieldCode.setText(value.toString());
903 return this;
904 }
905 /***
906 * get the text of the textfield
907 * @return the text
908 */
909 public final String getText()
910 {
911 return this.jTextFieldCode.getText();
912 }
913 /***
914 * set the text
915 * @param text the text
916 */
917 public final void setText(final String text)
918 {
919 this.jTextFieldCode.setText(text);
920 }
921 /***
922 * get the button =
923 * @return the button
924 */
925 public final JButton getButton()
926 {
927 return this.jButtonEqual;
928 }
929 }
930 /***
931 *
932 * <p>Title: CodeEditor</p>
933 * <p>Description: Define a cell editor for the Code column</p>
934 */
935 private class CodeEditor extends DefaultCellEditor
936 {
937 /***
938 * Construct a new 'CodeEditor' object
939 * @param pCodeRenderer the code renderer
940 */
941 public CodeEditor(final CodeRenderer pCodeRenderer)
942 {
943 super(new JCheckBox());
944
945 this.editorComponent = pCodeRenderer;
946
947 this.setClickCountToStart(1);
948
949 pCodeRenderer.getButton().addActionListener(new ActionListener()
950 {
951 public final void actionPerformed(final ActionEvent e)
952 {
953
954 pCodeRenderer.setText(
955 jTableColumns
956 .getModel()
957 .getValueAt(jTableColumns.getSelectedRow(), 0)
958 .toString()
959 .replace(' ', '_'));
960 stopCellEditing();
961 }
962 });
963 }
964 /***
965 * Return the value of the editor component
966 * @return the value
967 */
968 public final Object getCellEditorValue()
969 {
970 return ((CodeRenderer) this.editorComponent).getText();
971 }
972 /***
973 * Return the cell editor component
974 * @param table table
975 * @param value value
976 * @param isSelected is selected
977 * @param row row
978 * @param column column
979 * @return the component
980 */
981 public final Component getTableCellEditorComponent(
982 final JTable table,
983 final Object value,
984 final boolean isSelected,
985 final int row,
986 final int column)
987 {
988 ((CodeRenderer) this.editorComponent).setText(value.toString());
989 return this.editorComponent;
990 }
991 }
992 }