public void setCell(DatasetEditorModelCell cell) { if (this.cell != null) updateUserValue(false); this.cell = cell; DatasetEditorModelRow row = cell.getRow(); boolean editable = !row.isDeleted() && row.getModel().isEditable(); editorComponent.setEnabled(editable); editorComponent.setUserValueHolder(cell); Formatter formatter = regionalSettings.getFormatter(); if (cell.getUserValue() instanceof String) { String userValue = (String) cell.getUserValue(); if (userValue.indexOf('\n') > -1) { userValue = userValue.replace('\n', ' '); editorComponent.setEditable(false); } else { editorComponent.setEditable(editable); } editorComponent.setText(userValue); } else { editable = editable && !(cell.getUserValue() instanceof LazyLoadedValue); editorComponent.setEditable(editable); String formattedUserValue = formatter.formatObject(cell.getUserValue()); editorComponent.setText(formattedUserValue); } JTextField valueTextField = editorComponent.getTextField(); valueTextField.setBackground(UIUtil.getTextFieldBackground()); }