use of com.intellij.diff.requests.ContentDiffRequest in project intellij-community by JetBrains.
the class OnesideDiffViewer method canShowRequest.
public static <T extends EditorHolder> boolean canShowRequest(@NotNull DiffContext context, @NotNull DiffRequest request, @NotNull EditorHolderFactory<T> factory) {
if (!(request instanceof ContentDiffRequest))
return false;
List<DiffContent> contents = ((ContentDiffRequest) request).getContents();
if (contents.size() != 2)
return false;
DiffContent content1 = contents.get(0);
DiffContent content2 = contents.get(1);
if (content1 instanceof EmptyContent) {
return factory.canShowContent(content2, context) && factory.wantShowContent(content2, context);
}
if (content2 instanceof EmptyContent) {
return factory.canShowContent(content1, context) && factory.wantShowContent(content1, context);
}
return false;
}
use of com.intellij.diff.requests.ContentDiffRequest in project intellij-community by JetBrains.
the class ThreesideDiffViewer method canShowRequest.
public static <T extends EditorHolder> boolean canShowRequest(@NotNull DiffContext context, @NotNull DiffRequest request, @NotNull EditorHolderFactory<T> factory) {
if (!(request instanceof ContentDiffRequest))
return false;
List<DiffContent> contents = ((ContentDiffRequest) request).getContents();
if (contents.size() != 3)
return false;
boolean canShow = true;
boolean wantShow = false;
for (DiffContent content : contents) {
canShow &= factory.canShowContent(content, context);
wantShow |= factory.wantShowContent(content, context);
}
return canShow && wantShow;
}
Aggregations