JComponent () { final Project project = myOldMethod.getProject(); final VirtualFile file = PsiUtilCore.getVirtualFile(myOldMethod); DiffContentFactory contentFactory = DiffContentFactory.getInstance(); @Nls String methodCallPrefix = JavaRefactoringBundle.message("suggest.signature.preview.method.call.prefix"); DocumentContent oldContent = contentFactory.create(myOldMethod.getText() + "\n\n\n" + methodCallPrefix + "\n " + myOldCall.getText(), file); DocumentContent newContent = contentFactory.create(myNewMethod.getText() + "\n\n\n" + methodCallPrefix + "\n " + myNewCall.getText(), file); SimpleDiffRequest request = new SimpleDiffRequest(null, oldContent, newContent, JavaRefactoringBundle.message("suggest.signature.preview.title.before"), JavaRefactoringBundle.message("suggest.signature.preview.after.title")); DiffRequestPanel diffPanel = DiffManager.getInstance().createRequestPanel(project, getDisposable(), null); diffPanel.putContextHints(DiffUserDataKeys.PLACE, DIFF_PLACE); diffPanel.setRequest(request); final JPanel panel = new JPanel(new BorderLayout()); panel.add(diffPanel.getComponent(), BorderLayout.CENTER); panel.setBorder(IdeBorderFactory.createEmptyBorder(JBUI.insetsTop(5))); return panel; }