本文整理匯總了Java中com.intellij.openapi.diff.impl.patch.ApplyPatchStatus.SUCCESS屬性的典型用法代碼示例。如果您正苦於以下問題:Java ApplyPatchStatus.SUCCESS屬性的具體用法?Java ApplyPatchStatus.SUCCESS怎麽用?Java ApplyPatchStatus.SUCCESS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.openapi.diff.impl.patch.ApplyPatchStatus
的用法示例。
在下文中一共展示了ApplyPatchStatus.SUCCESS屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getStatus
public ApplyPatchStatus getStatus() {
if (! myNotExact.isEmpty()) {
return ApplyPatchStatus.FAILURE;
} else {
if (myTransformations.isEmpty() && myHadAlreadyAppliedMet) return ApplyPatchStatus.ALREADY_APPLIED;
boolean haveAlreadyApplied = myHadAlreadyAppliedMet;
boolean haveTrue = false;
for (MyAppliedData data : myTransformations.values()) {
if (data.isHaveAlreadyApplied()) {
haveAlreadyApplied |= true;
} else {
haveTrue = true;
}
}
if (haveAlreadyApplied && ! haveTrue) return ApplyPatchStatus.ALREADY_APPLIED;
if (haveAlreadyApplied) return ApplyPatchStatus.PARTIAL;
return ApplyPatchStatus.SUCCESS;
}
}
示例2: getStatus
public ApplyPatchStatus getStatus() {
if (! myNotExact.isEmpty()) {
return ApplyPatchStatus.FAILURE;
} else {
if (myTransformations.isEmpty() && myHadAlreadyAppliedMet) return ALREADY_APPLIED;
boolean haveAlreadyApplied = myHadAlreadyAppliedMet;
boolean haveTrue = false;
for (MyAppliedData data : myTransformations.values()) {
if (data.isHaveAlreadyApplied()) {
haveAlreadyApplied |= true;
} else {
haveTrue = true;
}
}
if (haveAlreadyApplied && ! haveTrue) return ALREADY_APPLIED;
if (haveAlreadyApplied) return ApplyPatchStatus.PARTIAL;
return ApplyPatchStatus.SUCCESS;
}
}
示例3: nonWriteActionPreCheck
public ApplyPatchStatus nonWriteActionPreCheck() {
final boolean value = myVerifier.nonWriteActionPreCheck();
if (! value) return ApplyPatchStatus.FAILURE;
final List<FilePatch> skipped = myVerifier.getSkipped();
final boolean applyAll = skipped.isEmpty();
myPatches.removeAll(skipped);
return applyAll ? ApplyPatchStatus.SUCCESS : ((skipped.size() == myPatches.size()) ? ApplyPatchStatus.ALREADY_APPLIED : ApplyPatchStatus.PARTIAL) ;
}
示例4: nonWriteActionPreCheck
@Nonnull
public ApplyPatchStatus nonWriteActionPreCheck() {
final List<FilePatch> failedPreCheck = myVerifier.nonWriteActionPreCheck();
myFailedPatches.addAll(failedPreCheck);
myPatches.removeAll(failedPreCheck);
final List<FilePatch> skipped = myVerifier.getSkipped();
final boolean applyAll = skipped.isEmpty();
myPatches.removeAll(skipped);
if (!failedPreCheck.isEmpty()) return ApplyPatchStatus.FAILURE;
return applyAll
? ApplyPatchStatus.SUCCESS
: ((skipped.size() == myPatches.size()) ? ApplyPatchStatus.ALREADY_APPLIED : ApplyPatchStatus.PARTIAL);
}
示例5: createFiles
@Nonnull
private ApplyPatchStatus createFiles() {
final Application application = ApplicationManager.getApplication();
Boolean isSuccess = application.runWriteAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
final List<FilePatch> filePatches = myVerifier.execute();
myFailedPatches.addAll(filePatches);
myPatches.removeAll(filePatches);
return myFailedPatches.isEmpty();
}
});
return isSuccess ? ApplyPatchStatus.SUCCESS : ApplyPatchStatus.FAILURE;
}
示例6: tryApply
private ApplyPatchStatus tryApply(final List<String> lines, boolean acceptPartial) throws ApplyPatchException {
final List<PatchLine> hunkLines = myHunk.getLines();
ApplyPatchStatus result = null;
int curLine = findStartLine(hunkLines, lines);
for(PatchLine line: hunkLines) {
final String patchLineText = line.getText();
switch (line.getType()) {
case CONTEXT:
checkContextMismatch(lines, curLine, patchLineText);
curLine++;
break;
case ADD:
if (curLine < lines.size() && lines.get(curLine).equals(patchLineText) && acceptPartial) {
result = ApplyPatchStatus.and(result, ApplyPatchStatus.ALREADY_APPLIED);
}
else {
lines.add(curLine, patchLineText);
result = ApplyPatchStatus.and(result, ApplyPatchStatus.SUCCESS);
}
curLine++;
break;
case REMOVE:
if (curLine >= lines.size() || !patchLineText.equals(lines.get(curLine))) {
if (acceptPartial) {
// we'll get a context mismatch exception later if it's actually a conflict and not an already applied line
result = ApplyPatchStatus.and(result, ApplyPatchStatus.ALREADY_APPLIED);
}
else {
checkContextMismatch(lines, curLine, patchLineText);
}
}
else {
lines.remove(curLine);
result = ApplyPatchStatus.and(result, ApplyPatchStatus.SUCCESS);
}
break;
}
}
if (result != null) {
return result;
}
return ApplyPatchStatus.SUCCESS;
}