use of com.intellij.openapi.diff.DocumentContent in project intellij-community by JetBrains.
the class OpenPartialDiffAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
MergePanel2 mergePanel = MergePanel2.fromDataContext(dataContext);
Project project = projectFromDataContext(dataContext);
Editor leftEditor = mergePanel.getEditor(myLeftIndex);
Editor rightEditor = mergePanel.getEditor(myRightIndex);
FileType type = mergePanel.getContentType();
SimpleDiffRequest diffData = new SimpleDiffRequest(project, composeName());
diffData.setContents(new DocumentContent(project, leftEditor.getDocument(), type), new DocumentContent(project, rightEditor.getDocument(), type));
diffData.setContentTitles(mergePanel.getVersionTitle(myLeftIndex), mergePanel.getVersionTitle(myRightIndex));
LOG.assertTrue(DiffManagerImpl.INTERNAL_DIFF.canShow(diffData));
DiffManagerImpl.INTERNAL_DIFF.show(diffData);
}
Aggregations