void (@NotNull AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); assert project != null; FileType fileType = null; FindModel.SearchContext context = FindModel.SearchContext.ANY; if (myList.getModel().getSize() > 0) { final InspectionPattern pattern = myList.getModel().getElementAt(0); fileType = pattern.fileType(); context = pattern.searchContext(); } final String replace = myReplace ? "" : null; final InspectionPattern defaultPattern = new InspectionPattern("", fileType, context, replace); final RegExpDialog dialog = new RegExpDialog(project, true, defaultPattern); if (!dialog.showAndGet()) return; final InspectionPattern pattern = dialog.getPattern(); myConfiguration.addPattern(pattern); ((MyListModel)myList.getModel()).fireContentsChanged(myList); saveChangesToProfile(myList); }