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


Java Differencer类代码示例

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


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

示例1: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
@Override
protected Object prepareInput(IProgressMonitor pm) {
	try {
		ResourceNode ancestor = new ResourceNode(file);
		String ancestorContent = getContent(ancestor);
		String leftContent, rightContent;

		leftContent = this.comparisonFailure.getExpected();
		rightContent = this.comparisonFailure.getActual();
		if (!leftContent.equals(ancestorContent))
			getCompareConfiguration().setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, Boolean.TRUE);
		CompareItem left = new EditableCompareItem("Left", leftContent, file);
		CompareItem right = new CompareItem("Right", rightContent);
		return new DiffNode(null, Differencer.CHANGE | Differencer.DIRECTION_MASK, ancestor, left, right);
	} catch (Throwable t) {
		LOG.error(t.getMessage(), t);
		Exceptions.throwUncheckedException(t);
		return null;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:N4IDEXpectCompareEditorInput.java

示例2: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
@Override
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
	initLabels();
	if (monitor != null) {
		monitor.subTask(Policy.bind("PropertyCompareInput.0") + left.getLabel()); //$NON-NLS-1$
	}
	left.getProperties(recursive);
	if (monitor != null && monitor.isCanceled()) {
		return null;
	}
	if (monitor != null) {
		monitor.subTask(Policy.bind("PropertyCompareInput.0") + right.getLabel()); //$NON-NLS-1$
	}
	right.getProperties(recursive);
	if (monitor != null && monitor.isCanceled()) {
		return null;
	}
	return new Differencer().findDifferences(false, monitor,null,null,left,right);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:PropertyCompareInput.java

示例3: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
/**
    * Runs the compare operation and returns the compare result.
    */
protected Object prepareInput(IProgressMonitor monitor){
	initLabels();
	DiffNode diffRoot = new DiffNode(Differencer.NO_CHANGE);
	String localCharset = Utilities.getCharset(resource);
	for (int i = 0; i < logEntries.length; i++) {		
		ITypedElement left = new TypedBufferedContent(resource);
		ResourceRevisionNode right = new ResourceRevisionNode(logEntries[i]);
		try {
			right.setCharset(localCharset);
		} catch (CoreException e) {
		}
		diffRoot.add(new VersionCompareDiffNode(left, right));
	}
	return diffRoot;		
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SVNCompareRevisionsInput.java

示例4: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
@Override
protected Object prepareInput(IProgressMonitor pm) throws InvocationTargetException, InterruptedException {
	try {
		// fix for PR 1GFMLFB: ITPUI:WIN2000 - files that are out of sync with the file system appear as empty							
		pm.beginTask(Utilities.getString("ResourceCompare.taskName"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$

		String leftLabel = "Before ";
		String rightLabel = "After ";

		String format = Utilities.getString("ResourceCompare.twoWay.title"); //$NON-NLS-1$
		String title = MessageFormat.format(format, new String[] { leftLabel, rightLabel });
		setTitle(title);

		Differencer d = new Differencer();

		fRoot = d.findDifferences(false, pm, null, null, new CompareItem(left), new CompareItem(right));
		return fRoot;
	} finally {
		pm.done();
	}
}
 
开发者ID:azachar,项目名称:GrayTin,代码行数:22,代码来源:StringCompare.java

示例5: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
@Override
public Object prepareInput(IProgressMonitor monitor)
		throws InvocationTargetException, InterruptedException {
	Differencer d = new Differencer();
	Object diff = d.findDifferences(false, new NullProgressMonitor(),
			null, null, new Input(base_), new Input(mod_));
	return diff;
}
 
开发者ID:aserg-ufmg,项目名称:RefDiff,代码行数:9,代码来源:TreeView.java

示例6: getImage

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
private Image getImage(MergeResult mergeResult) {
	Image image = null;
	if (!mergeResult.getResource().exists() && mergeResult.getResource().getName().indexOf(".") == -1) { //$NON-NLS-1$
		image = workbenchLabelProvider.getImage(ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(mergeResult.getPath())));
	} else {
		image = workbenchLabelProvider.getImage(mergeResult.getResource());
	}

	if (mergeResult.getAction() != null && mergeResult.getAction().trim().length() > 0) {
		if (mergeResult.getAction().equals(MergeResult.ACTION_CHANGE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.CHANGE);
		else if (mergeResult.getAction().equals(MergeResult.ACTION_ADD)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.ADD);
		else if (mergeResult.getAction().equals(MergeResult.ACTION_DELETE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.DELETE);
		else if (mergeResult.getAction().equals(MergeResult.ACTION_CONFLICT)) {
			if (mergeResult.isResolved()) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.MERGE);
			else image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.CONFLICTED_CHANGE);
		}
		else if (mergeResult.getAction().equals(MergeResult.ACTION_MERGE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.CHANGE);  
		else if (mergeResult.getAction().equals(MergeResult.ACTION_SKIP)) image = compareConfiguration.getImage(image, Differencer.NO_CHANGE);
	}
	
	if (mergeResult.getPropertyAction() != null && mergeResult.getPropertyAction().trim().length() > 0) {
		if (mergeResult.getPropertyAction().equals(MergeResult.ACTION_CHANGE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.PROPERTY_CHANGE);
		else if (mergeResult.getPropertyAction().equals(MergeResult.ACTION_ADD)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.PROPERTY_ADD);
		else if (mergeResult.getPropertyAction().equals(MergeResult.ACTION_DELETE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.PROPERTY_DELETE);
		else if (mergeResult.getPropertyAction().equals(MergeResult.ACTION_CONFLICT)) {
			if (mergeResult.isPropertyResolved()) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.MERGE);
			else image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.PROPERTY_CONFLICTED_CHANGE);
		}
		else if (mergeResult.getPropertyAction().equals(MergeResult.ACTION_MERGE)) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.PROPERTY_CHANGE);  			
	}
	
	if (mergeResult.hasTreeConflict()) {
		if (mergeResult.isTreeConflictResolved()) image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.MERGE);
		else image = mergeResultsDecorator.getImage(image, MergeResultsDecorator.TREE_CONFLICTED);
	}
	
	return image;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:39,代码来源:MergeResultsViewLabelProvider.java

示例7: prepareInput

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
public Object prepareInput(IProgressMonitor monitor)
  throws InvocationTargetException, InterruptedException
{
  Differencer d = new Differencer();
  Object diff = d.findDifferences(false, new NullProgressMonitor(), 
    null, null, new Input(this.base_), new Input(this.mod_));
  return diff;
}
 
开发者ID:SEAL-UCLA,项目名称:Ref-Finder,代码行数:9,代码来源:TreeView.java

示例8: postDiffHook

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
@Override
protected void postDiffHook(Differencer differencer, IDiffContainer root, IProgressMonitor monitor) {
	if (fStructureCreator.canRewriteTree()) {
		boolean smart= JavaCompareUtilities.getBoolean(getCompareConfiguration(), SMART, false);
		if (smart && root != null)
			fStructureCreator.rewriteTree(differencer, root);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:JavaStructureDiffViewer.java

示例9: GitDiffNode

import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
public GitDiffNode(final Diff diff) {
  super(Differencer.CHANGE);
  init(diff);
}
 
开发者ID:sealuzh,项目名称:Permo,代码行数:5,代码来源:GitDiffNode.java


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