JButton (Project project) { JButton configureClassPatterns = new JButton(JavaBundle.message("button.code.patterns")); configureClassPatterns.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { EntryPointsManagerBase entryPointsManagerBase = getInstance(project); ArrayList<ClassPattern> list = new ArrayList<>(); for (ClassPattern pattern : entryPointsManagerBase.getPatterns()) { list.add(new ClassPattern(pattern)); } ClassPatternsPanel panel = new ClassPatternsPanel(list); new DialogWrapper(entryPointsManagerBase.myProject) { { init(); setTitle(JavaBundle.message("dialog.title.configure.code.patterns")); } @Override protected JComponent createCenterPanel() { return panel; } @Override protected void doOKAction() { String error = panel.getValidationError(project); if (error != null) { Messages.showErrorDialog(panel, error); return; } Set<ClassPattern> patterns = entryPointsManagerBase.getPatterns(); patterns.clear(); patterns.addAll(list); DaemonCodeAnalyzer.getInstance(entryPointsManagerBase.myProject).restart(); super.doOKAction(); } }.show(); } }); return configureClassPatterns; }