MetadataTable metadataTable = (MetadataTable) ui;
if(MetadataTableModel.IS_KEY_FIELD_INDEX == selectedColumn) {//isKey
Object cellValueObj = metadataTable.getValueAt(selectedRow, selectedColumn);
boolean isKey = ((Boolean) cellValueObj).booleanValue();
MetadataTableModel metadataTableModel = (MetadataTableModel) metadataTable.getModel();
metadataTableModel.setCellEditableAt(isKey, selectedRow, MetadataTableModel.CONSTRAINT_TYPE_INDEX);
metadataTableModel.setCellEditableAt(isKey, selectedRow, MetadataTableModel.REFERENCING_TABLE_INDEX);
metadataTableModel.setCellEditableAt(isKey, selectedRow, MetadataTableModel.REFERENCING_COLUMN_INDEX);
metadataTableModel.setCellEditableAt(isKey, selectedRow, MetadataTableModel.DELETE_RULE_INDEX);
metadataTableModel.setValueAt(null, selectedRow, MetadataTableModel.CONSTRAINT_TYPE_INDEX);
metadataTableModel.setValueAt(null, selectedRow, MetadataTableModel.REFERENCING_TABLE_INDEX);
metadataTableModel.setValueAt(null, selectedRow, MetadataTableModel.REFERENCING_COLUMN_INDEX);
metadataTableModel.setValueAt(null, selectedRow, MetadataTableModel.DELETE_RULE_INDEX);
} else if(MetadataTableModel.IS_QUERY_FIELD_INDEX == selectedColumn) {//isQueryField
Object cellValueObj = metadataTable.getValueAt(selectedRow, selectedColumn);
boolean isQueryField = ((Boolean) cellValueObj).booleanValue();
MetadataTableModel metadataTableModel = (MetadataTableModel) metadataTable.getModel();
metadataTableModel.setCellEditableAt(isQueryField, selectedRow, MetadataTableModel.QUERY_MODE_INDEX);
metadataTableModel.setValueAt(null, selectedRow, MetadataTableModel.QUERY_MODE_INDEX);
}
}
}
}