void () { assert mySchemesModel != null; List<NamedScope> availableScopes = getAvailableScopes(); if (!availableScopes.isEmpty()) { ExcludedFilesScopeDialog dialog = new ExcludedFilesScopeDialog(mySchemesModel.getProject(), availableScopes); dialog.show(); if (dialog.isOK()) { FileSetDescriptor descriptor = dialog.getDescriptor(); if (descriptor != null) { int insertAt = getSelectedIndex() < 0 ? getItemsCount() : getSelectedIndex() + 1; int exiting = myModel.indexOf(descriptor); if (exiting < 0) { myModel.add(insertAt, descriptor); setSelectedValue(descriptor, true); } else { setSelectedValue(myModel.get(exiting), true); } } } else if (dialog.getExitCode() == ExcludedFilesScopeDialog.EDIT_SCOPES) { editScope(null); } } else { editScope(null); } }