void () { commonParametersPanel.add(commonJavaParameters, BorderLayout.CENTER); classField.setComponent(new EditorTextFieldWithBrowseButton(project, true, (declaration, place) -> { if (declaration instanceof PsiClass && place.getParent() instanceof PsiJavaCodeReferenceElement) { return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE; } try { if (declaration instanceof PsiClass && new TestClassBrowser(project, TestNGConfigurationEditor.this).getFilter().isAccepted((PsiClass)declaration)) { return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE; } } catch (MessageInfoException e) { return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE; } return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE; })); final EditorTextFieldWithBrowseButton methodEditorTextField = new EditorTextFieldWithBrowseButton(project, true, JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE, PlainTextLanguage.INSTANCE.getAssociatedFileType()); methodField.setComponent(methodEditorTextField); groupField.setComponent(new TextFieldWithBrowseButton.NoPathCompletion()); suiteField.setComponent(new TextFieldWithBrowseButton()); packageField.setVisible(true); packageField.setEnabled(true); packageField.setComponent(new EditorTextFieldWithBrowseButton(project, false)); TextFieldWithBrowseButton outputDirectoryButton = new TextFieldWithBrowseButton(); outputDirectory.setComponent(outputDirectoryButton); outputDirectoryButton.addBrowseFolderListener(TestngBundle.message("testng.output.directory.button.title"), TestngBundle.message("testng.select.output.directory"), project, FileChooserDescriptorFactory.createSingleFolderDescriptor()); moduleClasspath.setEnabled(true); propertiesTableModel = new TestNGParametersTableModel(); listenerModel = new TestNGListenersTableModel(); TextFieldWithBrowseButton textFieldWithBrowseButton = new TextFieldWithBrowseButton(); propertiesFile.setComponent(textFieldWithBrowseButton); FileChooserDescriptor propertiesFileDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) { @Override public boolean isFileVisible(VirtualFile virtualFile, boolean showHidden) { if (!showHidden && virtualFile.getName().charAt(0) == '.') return false; return virtualFile.isDirectory() || "properties".equals(virtualFile.getExtension()); } }; textFieldWithBrowseButton .addBrowseFolderListener(TestngBundle.message("testng.browse.button.title"), TestngBundle.message("testng.select.properties.file"), project, propertiesFileDescriptor); propertiesTableView = new TableView(propertiesTableModel); myPropertiesPanel.add( ToolbarDecorator.createDecorator(propertiesTableView) .setAddAction(button -> { propertiesTableModel.addParameter(); int index = propertiesTableModel.getRowCount() - 1; propertiesTableView.setRowSelectionInterval(index, index); }).setRemoveAction(button -> { int idx = propertiesTableView.getSelectedRow() - 1; for (int row : propertiesTableView.getSelectedRows()) { propertiesTableModel.removeProperty(row); } if (idx > -1) propertiesTableView.setRowSelectionInterval(idx, idx); }).disableUpDownActions().createPanel(), BorderLayout.CENTER); myListenersList = new JBList(listenerModel); myListenersPanel.add( ToolbarDecorator.createDecorator(myListenersList).setAddAction(new AddActionButtonRunnable()) .setRemoveAction(button -> { int idx = myListenersList.getSelectedIndex() - 1; for (int row : myListenersList.getSelectedIndices()) { listenerModel.removeListener(row); } if (idx > -1) myListenersList.setSelectedIndex(idx); }).setAddActionUpdater(e -> !project.isDefault()).disableUpDownActions().createPanel(), BorderLayout.CENTER); }