コード例 #1
0
 protected static boolean canShowDiff(Change[] changes) {
   if (changes == null || changes.length == 0) return false;
   for (Change change : changes) {
     if (!ChangesUtil.getFilePath(change).isDirectory() || change.hasOtherLayers()) return true;
   }
   return false;
 }
コード例 #2
0
  public static boolean isBinaryChange(Change change) {
    if (change.hasOtherLayers()) return false; // +-
    final ContentRevision bRev = change.getBeforeRevision();
    final ContentRevision aRev = change.getAfterRevision();

    return (aRev == null || aRev instanceof BinaryContentRevision)
        && (bRev == null || bRev instanceof BinaryContentRevision);
  }
コード例 #3
0
 private static boolean directoryOrBinary(final Change change) {
   // todo instead for repository tab, filter directories (? ask remotely ? non leaf nodes)
   /*if ((change.getBeforeRevision() instanceof BinaryContentRevision) || (change.getAfterRevision() instanceof BinaryContentRevision)) {
     changesList.remove(i);
     continue;
   }*/
   final FilePath path = ChangesUtil.getFilePath(change);
   if (path.isDirectory()) {
     return !change.hasOtherLayers();
   }
   /*final FileType type = path.getFileType();
   if ((! FileTypes.UNKNOWN.equals(type)) && (type.isBinary())) {
     return true;
   }*/
   return false;
 }