DBNativeDataType nativeDataType = dataType.getNativeDataType();
if (nativeDataType != null) {
DataTypeDefinition dataTypeDefinition = nativeDataType.getDataTypeDefinition();
GenericDataType genericDataType = dataTypeDefinition.getGenericDataType();
DataEditorSettings dataEditorSettings = DataEditorSettings.getInstance(project);
long dataLength = dataType.getLength();
if (genericDataType.is(GenericDataType.DATE_TIME, GenericDataType.LITERAL)) {
TextFieldWithPopup textFieldWithPopup = new TextFieldWithPopup(project);
textFieldWithPopup.setPreferredSize(new Dimension(200, -1));
JTextField valueTextField = textFieldWithPopup.getTextField();
valueTextField.getDocument().addDocumentListener(documentListener);
valueTextField.addKeyListener(keyAdapter);
valueTextField.addFocusListener(focusListener);
if (cell.getRow().getModel().isEditable()) {
if (genericDataType == GenericDataType.DATE_TIME) {
textFieldWithPopup.createCalendarPopup(false);
}
if (genericDataType == GenericDataType.LITERAL) {
if (dataLength > 20 && !column.isPrimaryKey() && !column.isForeignKey())
textFieldWithPopup.createTextAreaPopup(false);
DataEditorValueListPopupSettings valueListPopupSettings = dataEditorSettings.getValueListPopupSettings();
if (column.isForeignKey() || (dataLength <= valueListPopupSettings.getDataLengthThreshold() &&
(!column.isSinglePrimaryKey() || valueListPopupSettings.isActiveForPrimaryKeyColumns()))) {
ListPopupValuesProvider valuesProvider = new ListPopupValuesProvider() {
public List<String> getValues() {