use of com.intellij.openapi.diff.DiffTool in project intellij-community by JetBrains.
the class CompositeDiffTool method show.
public void show(DiffRequest data) {
checkDiffData(data);
DiffTool tool = chooseTool(data);
if (tool != null)
tool.show(data);
else
LOG.error("No diff tool found which is able to handle request " + data);
}
use of com.intellij.openapi.diff.DiffTool in project intellij-community by JetBrains.
the class CompositeDiffTool method chooseTool.
@Nullable
private DiffTool chooseTool(DiffRequest data) {
final DiffContent[] contents = data.getContents();
if (contents.length == 2) {
final FileType type1 = contents[0].getContentType();
final FileType type2 = contents[1].getContentType();
if (type1 == type2 && type1 instanceof UIBasedFileType) {
return BinaryDiffTool.INSTANCE;
}
//todo[kb] register or not this instance in common diff tools ?
if (type1 == type2 && type1 instanceof ArchiveFileType) {
return ArchiveDiffTool.INSTANCE;
}
}
for (DiffTool tool : myTools) {
if (tool.canShow(data))
return tool;
}
return null;
}
use of com.intellij.openapi.diff.DiffTool in project intellij-community by JetBrains.
the class DiffManagerImpl method getDiffTool.
@Override
public DiffTool getDiffTool() {
DiffTool[] standardTools;
// there is inner check in multiple tool for external viewers as well
if (!ENABLE_FILES.value(myProperties) || !ENABLE_FOLDERS.value(myProperties) || !ENABLE_MERGE.value(myProperties)) {
DiffTool[] embeddableTools = { INTERNAL_DIFF, new MergeTool(), BinaryDiffTool.INSTANCE };
standardTools = new DiffTool[] { ExtCompareFolders.INSTANCE, ExtCompareFiles.INSTANCE, ExtMergeFiles.INSTANCE, new MultiLevelDiffTool(Arrays.asList(embeddableTools)), INTERNAL_DIFF, new MergeTool(), BinaryDiffTool.INSTANCE };
} else {
standardTools = new DiffTool[] { ExtCompareFolders.INSTANCE, ExtCompareFiles.INSTANCE, ExtMergeFiles.INSTANCE, INTERNAL_DIFF, new MergeTool(), BinaryDiffTool.INSTANCE };
}
if (myAdditionTools.isEmpty()) {
return new CompositeDiffTool(standardTools);
} else {
List<DiffTool> allTools = new ArrayList<>(myAdditionTools);
ContainerUtil.addAll(allTools, standardTools);
return new CompositeDiffTool(allTools);
}
}
Aggregations