Component (JTable table, Object value, boolean isSelected, int row, int column) { final DefaultMutableTreeNode defaultNode = (DefaultMutableTreeNode)((TreeTable)table).getTree(). getPathForRow(row).getLastPathComponent(); myCurrentEditor = null; myCurrentNode = null; if (defaultNode instanceof MyTreeNode node) { myCurrentNode = node; if (node.getKey() instanceof BooleanOption) { myCurrentEditor = myBooleanEditor; myBooleanEditor.setSelected(node.getValue() == Boolean.TRUE); myBooleanEditor.setEnabled(node.isEnabled()); } else if (node.getKey() instanceof IntOption intOption) { myCurrentEditor = myIntOptionsEditor; myIntOptionsEditor.setCanBeEmpty(true); myIntOptionsEditor.setMinValue(intOption.getMinValue()); myIntOptionsEditor.setMaxValue(intOption.getMaxValue()); myIntOptionsEditor.setDefaultValue(intOption.getDefaultValue()); myIntOptionsEditor.setValue((Integer)node.getValue()); } else if (node.getKey() instanceof SelectionOption) { myCurrentEditor = myOptionsEditor; myOptionsEditor.setCell(table, row, column); myOptionsEditor.setText(String.valueOf(node.getValue())); //noinspection ConfusingArgumentToVarargsMethod myOptionsEditor.setOptions(((SelectionOption)node.getKey()).options); myOptionsEditor.setDefaultValue(node.getValue()); } else { myCurrentEditor = getCustomNodeEditor(node); } } if (myCurrentEditor != null) { myCurrentEditor.setBackground(table.getBackground()); if (myCurrentEditor instanceof JTextField) { myCurrentEditor.getInputMap().put(ENTER_KEY_STROKE, STOP_CELL_EDIT_ACTION_KEY); myCurrentEditor.getActionMap().put(STOP_CELL_EDIT_ACTION_KEY, STOP_CELL_EDIT_ACTION); } } return myCurrentEditor; }