JPanel () { JPanel panel = new JPanel(new BorderLayout()); if (mySupportRefactoring) { String annotateText = JvmAnalysisBundle.message("jvm.inspections.source.unsafe.to.sink.flow.propagate.safe.toolwindow.annotate"); JButton annotateButton = new JButton(annotateText); annotateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ToolWindow toolWindow = ProblemsView.getToolWindow(myProject); if (toolWindow == null) return; ContentManager contentManager = toolWindow.getContentManager(); contentManager.removeContent(myContent, true); myContent.release(); for (TaintNode root : myRoots) { Set<TaintNode> toAnnotate = getSelectedElements(root, new HashSet<>()); if (toAnnotate != null) myCallback.accept(toAnnotate); } } }); panel.add(annotateButton, BorderLayout.WEST); } return panel; }