本文整理汇总了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;
}
}
示例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);
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例9: GitDiffNode
import org.eclipse.compare.structuremergeviewer.Differencer; //导入依赖的package包/类
public GitDiffNode(final Diff diff) {
super(Differencer.CHANGE);
init(diff);
}