Component (JTable table, Object value, boolean isSelected, final boolean hasFocus, int row, int column) { PsiCodeFragment codeFragment = (PsiCodeFragment)value; final EditorTextField editorTextField; Document document = null; if (codeFragment != null) { document = PsiDocumentManager.getInstance(myProject).getDocument(codeFragment); editorTextField = new EditorTextField(document, myProject, myFileType) { @Override protected boolean shouldHaveBorder() { return false; } }; } else { editorTextField = new EditorTextField("", myProject, myFileType) { @Override protected boolean shouldHaveBorder() { return false; } }; } if (!table.isShowing()) { editorTextField.ensureWillComputePreferredSize(); } editorTextField.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE); editorTextField.setBorder((hasFocus || isSelected) ? BorderFactory.createLineBorder(table.getSelectionBackground()) : JBUI.Borders.empty(1)); if (isSelected && document != null) { final Color bg = table.getSelectionBackground(); final Color fg = table.getSelectionForeground(); editorTextField.setBackground(bg); editorTextField.setForeground(fg); editorTextField.setAsRendererWithSelection(bg, fg); } return editorTextField; }