当前位置: 首页>>代码示例>>Java>>正文


Java BinaryFilePatch类代码示例

本文整理汇总了Java中com.intellij.openapi.diff.impl.patch.BinaryFilePatch的典型用法代码示例。如果您正苦于以下问题:Java BinaryFilePatch类的具体用法?Java BinaryFilePatch怎么用?Java BinaryFilePatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BinaryFilePatch类属于com.intellij.openapi.diff.impl.patch包,在下文中一共展示了BinaryFilePatch类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
@Override
public void apply(MultiMap<VirtualFile, FilePatchInProgress> patchGroups,
                  LocalChangeList localList,
                  String fileName,
                  TransparentlyFailedValueI<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
  final Collection<PatchApplier> appliers = new LinkedList<PatchApplier>();
  final CommitContext commitContext = new CommitContext();
  applyAdditionalInfoBefore(myProject, additionalInfo, commitContext);

  for (VirtualFile base : patchGroups.keySet()) {
    final PatchApplier patchApplier =
      new PatchApplier<BinaryFilePatch>(myProject, base, ObjectsConvertor.convert(patchGroups.get(base),
                                                                                new Convertor<FilePatchInProgress, FilePatch>() {
                                                                                  public FilePatch convert(FilePatchInProgress o) {
                                                                                    return o.getPatch();
                                                                                  }
                                                                                }), localList, null, commitContext);
    appliers.add(patchApplier);
  }
  PatchApplier.executePatchGroup(appliers, localList);

  applyAdditionalInfo(myProject, additionalInfo, commitContext);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:ApplyPatchDefaultExecutor.java

示例2: addPatch

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
private void addPatch(final FilePatch patch, final VirtualFile file) {
  final Pair<VirtualFile, ApplyFilePatchBase> patchPair = Pair.create(file, ApplyFilePatchFactory.createGeneral(patch));
  if (patch instanceof TextFilePatch) {
    myTextPatches.add(Pair.create(file, ApplyFilePatchFactory.create((TextFilePatch)patch)));
  } else {
    final ApplyFilePatchBase<BinaryType> applyBinaryPatch = (ApplyFilePatchBase<BinaryType>)((patch instanceof BinaryFilePatch)
                                                                                             ? ApplyFilePatchFactory
                                                                                               .create((BinaryFilePatch)patch)
                                                                                             :
                                                                                             ApplyFilePatchFactory.create(
                                                                                               (ShelveChangesManager.ShelvedBinaryFilePatch)patch));
    myBinaryPatches.add(Pair.create(file, applyBinaryPatch));
  }
  myWritableFiles.add(file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PathsVerifier.java

示例3: createGeneral

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public static ApplyFilePatchBase createGeneral(final FilePatch patch) {
  if (patch instanceof TextFilePatch) {
    return create((TextFilePatch) patch);
  } else if (patch instanceof BinaryFilePatch) {
    return create((BinaryFilePatch) patch);
  } else if (patch instanceof ShelveChangesManager.ShelvedBinaryFilePatch) {
    return create((ShelveChangesManager.ShelvedBinaryFilePatch) patch);
  }
  throw new IllegalStateException();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ApplyFilePatchFactory.java

示例4: addPatch

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
private void addPatch(final FilePatch patch, final VirtualFile file) {
  final Pair<VirtualFile, ApplyFilePatchBase> patchPair = new Pair<VirtualFile, ApplyFilePatchBase>(file, ApplyFilePatchFactory.createGeneral(patch));
  if (patch instanceof TextFilePatch) {
    myTextPatches.add(new Pair<VirtualFile, ApplyTextFilePatch>(file, ApplyFilePatchFactory.create((TextFilePatch) patch)));
  } else {
    final ApplyFilePatchBase<BinaryType> applyBinaryPatch = (ApplyFilePatchBase<BinaryType>) ((patch instanceof BinaryFilePatch) ? ApplyFilePatchFactory
      .create((BinaryFilePatch) patch) :
            ApplyFilePatchFactory.create((ShelveChangesManager.ShelvedBinaryFilePatch) patch));
    myBinaryPatches.add(new Pair<VirtualFile, ApplyFilePatchBase<BinaryType>>(file, applyBinaryPatch));
  }
  myWritableFiles.add(file);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:PathsVerifier.java

示例5: addPatch

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
private void addPatch(final FilePatch patch, final VirtualFile file) {
  final Pair<VirtualFile, ApplyFilePatchBase> patchPair = Pair.create(file, ApplyFilePatchFactory.createGeneral(patch));
  if (patch instanceof TextFilePatch) {
    myTextPatches.add(Pair.create(file, ApplyFilePatchFactory.create((TextFilePatch)patch)));
  } else {
    final ApplyFilePatchBase<BinaryType> applyBinaryPatch = (ApplyFilePatchBase<BinaryType>)((patch instanceof BinaryFilePatch)
                                                                                             ? ApplyFilePatchFactory
                                                                                                     .create((BinaryFilePatch)patch)
                                                                                             : ApplyFilePatchFactory
                                                                                                     .create((ShelvedBinaryFilePatch)patch));
    myBinaryPatches.add(Pair.create(file, applyBinaryPatch));
  }
  myWritableFiles.add(file);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:PathsVerifier.java

示例6: createGeneral

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public static ApplyFilePatchBase createGeneral(final FilePatch patch) {
  if (patch instanceof TextFilePatch) {
    return create((TextFilePatch) patch);
  } else if (patch instanceof BinaryFilePatch) {
    return create((BinaryFilePatch) patch);
  } else if (patch instanceof ShelvedBinaryFilePatch) {
    return create((ShelvedBinaryFilePatch) patch);
  }
  throw new IllegalStateException();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ApplyFilePatchFactory.java

示例7: create

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public static ApplyBinaryFilePatch create(final BinaryFilePatch patch) {
  return new ApplyBinaryFilePatch(patch);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ApplyFilePatchFactory.java

示例8: ApplyBinaryFilePatch

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public ApplyBinaryFilePatch(BinaryFilePatch patch) {
  super(patch);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ApplyBinaryFilePatch.java

示例9: applyPatch

import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
protected void applyPatch() throws Exception {
  PatchReader reader = PatchVirtualFileReader.create(LocalFileSystem.getInstance().refreshAndFindFileByPath(patchFilePath));

  List<FilePatch> patches = new ArrayList<FilePatch>(reader.readAllPatches());

  new PatchApplier<BinaryFilePatch>(myProject, myRoot, patches, null, null, null).execute();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PatchingTestCase.java


注:本文中的com.intellij.openapi.diff.impl.patch.BinaryFilePatch类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。