예제 #1
0
 public static FileType[] chooseContentTypes(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;
 }
예제 #2
0
 public FragmentContent(DiffContent original, TextRange range, Project project, VirtualFile file) {
   this(original, range, project, file != null ? DiffContentUtil.getContentType(file) : null);
 }