当前位置: 首页>>代码示例>>Java>>正文


Java DiffNode.getChildren方法代码示例

本文整理汇总了Java中org.eclipse.compare.structuremergeviewer.DiffNode.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java DiffNode.getChildren方法的具体用法?Java DiffNode.getChildren怎么用?Java DiffNode.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.compare.structuremergeviewer.DiffNode的用法示例。


在下文中一共展示了DiffNode.getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: commit

import org.eclipse.compare.structuremergeviewer.DiffNode; //导入方法依赖的package包/类
private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
	ITypedElement left= node.getLeft();
	if (left instanceof BufferedResourceNode)
		((BufferedResourceNode) left).commit(pm);
		
	ITypedElement right= node.getRight();
	if (right instanceof BufferedResourceNode)
		((BufferedResourceNode) right).commit(pm);

	IDiffElement[] children= node.getChildren();
	if (children != null) {
		for (int i= 0; i < children.length; i++) {
			IDiffElement element= children[i];
			if (element instanceof DiffNode)
				commit(pm, (DiffNode) element);
		}
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SVNLocalCompareInput.java

示例2: prepareInput

import org.eclipse.compare.structuremergeviewer.DiffNode; //导入方法依赖的package包/类
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
	initLabels();
	MultipleSelectionNode left = new MultipleSelectionNode(localResourceNodes);
	MultipleSelectionNode right = new MultipleSelectionNode(remoteResourceNodes);
       Object differences = new StatusAwareDifferencer().findDifferences(false, monitor,null,null,left,right);
       if (differences instanceof DiffNode) {
       	DiffNode diffNode = (DiffNode)differences;
       	
       	IDiffElement[] children = diffNode.getChildren();
       	for (IDiffElement child : children) {
       		if (child instanceof DiffNode) {
       			DiffNode childDiffNode = (DiffNode)child;
       			if (childDiffNode.getLeft() == null && childDiffNode.getRight() instanceof ResourceEditionNode) {
       				diffNode.remove(child);
       			}
       		}
       	}
       	
       	if (!diffNode.hasChildren()) {
       		return null;
       	}
       }
       for (IResource unaddedResource : unaddedResources) {
		try {
			SVNWorkspaceRoot.getSVNResourceFor(unaddedResource).revert();
		} catch (Exception e) {}
       }
       fRoot = differences;
       return differences;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:31,代码来源:SVNLocalBaseCompareInput.java


注:本文中的org.eclipse.compare.structuremergeviewer.DiffNode.getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。