本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例7: create
import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public static ApplyBinaryFilePatch create(final BinaryFilePatch patch) {
return new ApplyBinaryFilePatch(patch);
}
示例8: ApplyBinaryFilePatch
import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; //导入依赖的package包/类
public ApplyBinaryFilePatch(BinaryFilePatch patch) {
super(patch);
}
示例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();
}