本文整理汇总了Java中com.intellij.openapi.diff.DiffTool类的典型用法代码示例。如果您正苦于以下问题:Java DiffTool类的具体用法?Java DiffTool怎么用?Java DiffTool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DiffTool类属于com.intellij.openapi.diff包,在下文中一共展示了DiffTool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: chooseTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@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;
}
示例2: getDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@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<DiffTool>(myAdditionTools);
ContainerUtil.addAll(allTools, standardTools);
return new CompositeDiffTool(allTools);
}
}
示例3: registerDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public boolean registerDiffTool(@NotNull DiffTool tool) throws NullPointerException {
if (myAdditionTools.contains(tool)) {
return false;
}
myAdditionTools.add(tool);
return true;
}
示例4: onEveryMove
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
private void onEveryMove(final DiffRequest simpleRequest, final boolean showFrame) {
simpleRequest.passForDataContext(VcsDataKeys.DIFF_REQUEST_CHAIN, this);
if (showFrame) {
simpleRequest.addHint(DiffTool.HINT_SHOW_FRAME);
}
else {
simpleRequest.addHint(DiffTool.HINT_SHOW_MODAL_DIALOG);
}
if (mySteps.size() > 1) {
simpleRequest.addHint(DiffTool.HINT_ALLOW_NO_DIFFERENCES);
}
}
示例5: convertRequestFair
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Nullable
private static DiffRequest convertRequestFair(@NotNull com.intellij.openapi.diff.DiffRequest oldRequest) {
if (oldRequest.getOnOkRunnable() != null) return null;
//if (oldRequest.getBottomComponent() != null) return null; // TODO: we need EDT to make this check. Let's ignore bottom component.
// TODO: migrate layers
com.intellij.openapi.diff.DiffContent[] contents = oldRequest.getContents();
String[] titles = oldRequest.getContentTitles();
List<DiffContent> newContents = new ArrayList<DiffContent>(contents.length);
for (int i = 0; i < contents.length; i++) {
DiffContent convertedContent = convertContent(oldRequest.getProject(), contents[i]);
if (convertedContent == null) return null;
newContents.add(convertedContent);
}
SimpleDiffRequest newRequest = new SimpleDiffRequest(oldRequest.getWindowTitle(), newContents, Arrays.asList(titles));
newRequest.putUserData(DiffUserDataKeys.CONTEXT_ACTIONS, Collections.<AnAction>singletonList(new MyShowDiffAction(oldRequest)));
DiffNavigationContext navigationContext = (DiffNavigationContext)oldRequest.getGenericData().get(DiffTool.SCROLL_TO_LINE.getName());
if (navigationContext != null) {
newRequest.putUserData(DiffUserDataKeysEx.NAVIGATION_CONTEXT, navigationContext);
}
return newRequest;
}
示例6: canShow
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public boolean canShow(DiffRequest request) {
if (request instanceof MergeRequest) return false;
if (request.getContents().length != 2) return false;
if (request.getHints().contains(MigrateToNewDiffUtil.DO_NOT_TRY_MIGRATE)) return false;
if (request.getOnOkRunnable() != null) return false;
if (!DiffManagerImpl.INTERNAL_DIFF.canShow(request) && !BinaryDiffTool.INSTANCE.canShow(request)) return false;
for (DiffTool tool : DiffManagerImpl.getInstanceEx().getAdditionTools()) {
if (tool == this) continue;
if (tool.canShow(request)) return false;
}
return true;
}
示例7: getDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
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
};
}
ArrayList<DiffTool> allTools = new ArrayList<DiffTool>(myAdditionTools);
allTools.addAll(Arrays.asList(standardTools));
return new CompositeDiffTool(allTools);
}
示例8: getDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@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<DiffTool>(myAdditionTools);
ContainerUtil.addAll(allTools, standardTools);
return new CompositeDiffTool(allTools);
}
}
示例9: registerDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public boolean registerDiffTool(@Nonnull DiffTool tool) throws NullPointerException {
if (myAdditionTools.contains(tool)) {
return false;
}
myAdditionTools.add(tool);
return true;
}
示例10: CompositeDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
public CompositeDiffTool(@NotNull List<DiffTool> tools) {
myTools = new ArrayList<DiffTool>(tools);
}
示例11: show
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
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);
}
示例12: getIdeaDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public DiffTool getIdeaDiffTool() {
return INTERNAL_DIFF;
}
示例13: unregisterDiffTool
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public void unregisterDiffTool(DiffTool tool) {
myAdditionTools.remove(tool);
LOG.assertTrue(!myAdditionTools.contains(tool));
}
示例14: getAdditionTools
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
public List<DiffTool> getAdditionTools() {
return myAdditionTools;
}
示例15: createDiffPanel
import com.intellij.openapi.diff.DiffTool; //导入依赖的package包/类
@Override
public DiffPanel createDiffPanel(Window window, @NotNull Project project, DiffTool parentTool) {
return new DiffPanelImpl(window, project, true, true, FULL_DIFF_DIVIDER_POLYGONS_OFFSET, parentTool);
}