use of com.intellij.openapi.diff.DiffContent in project intellij-community by JetBrains.
the class DiffSideView method setMouseListeners.
private void setMouseListeners(EditorSource source) {
DiffContent content = source.getContent();
MouseLineNumberListener.install(content, source, myContainer);
}
use of com.intellij.openapi.diff.DiffContent in project intellij-community by JetBrains.
the class DiffUtil method chooseContentTypes.
@NotNull
public static FileType[] chooseContentTypes(@NotNull DiffContent[] contents) {
FileType commonType = FileTypes.PLAIN_TEXT;
for (DiffContent content : contents) {
FileType contentType = content.getContentType();
if (DiffContentUtil.isTextType(contentType))
commonType = contentType;
}
FileType[] result = new FileType[contents.length];
for (int i = 0; i < contents.length; i++) {
FileType contentType = contents[i].getContentType();
result[i] = DiffContentUtil.isTextType(contentType) ? contentType : commonType;
}
return result;
}
use of com.intellij.openapi.diff.DiffContent in project intellij-community by JetBrains.
the class DiffContentFactory method compareVirtualFiles.
@Nullable
public static SimpleDiffRequest compareVirtualFiles(Project project, VirtualFile file1, VirtualFile file2, String title) {
DiffContent content1 = DiffContent.fromFile(project, file1);
DiffContent content2 = DiffContent.fromFile(project, file2);
if (content1 == null || content2 == null)
return null;
SimpleDiffRequest diffRequest = new SimpleDiffRequest(project, title);
diffRequest.setContents(content1, content2);
return diffRequest;
}
Aggregations