Component (JTable table, Object value, boolean isSelected, int row, int column) { final Document document = JavaReferenceEditorUtil.createDocument(value == null ? "" : (String)value, myProject, true); myEditor = new EditorTextField(document, myProject, JavaFileType.INSTANCE){ @Override protected boolean shouldHaveBorder() { return false; } @Override protected void onEditorAdded(@NotNull Editor editor) { super.onEditorAdded(editor); final JComponent editorComponent = editor.getContentComponent(); editorComponent.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "ENTER"); editorComponent.getActionMap().put("ENTER", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { stopCellEditing(); } }); } }; final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(myEditor); final FixedSizeButton button = new FixedSizeButton(myEditor); panel.add(button, BorderLayout.EAST); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject) .createInheritanceClassChooser(JavaBundle.message("choose.class"), mySearchScope, null, true, true, Conditions.alwaysTrue()); chooser.showDialog(); final PsiClass psiClass = chooser.getSelected(); if (psiClass != null) { myEditor.setText(psiClass.getQualifiedName()); } } }); panel.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { if (!e.isTemporary() && myEditor != null) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myEditor, true)); } } @Override public void focusLost(FocusEvent e) { } }); myEditor.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent e) { if (!e.isTemporary()) { stopCellEditing(); } } }); //ComponentWithBrowseButton.MyDoClickAction.addTo(button, myEditor); return panel; }