本文整理汇总了Java中org.eclipse.compare.structuremergeviewer.ICompareInput类的典型用法代码示例。如果您正苦于以下问题:Java ICompareInput类的具体用法?Java ICompareInput怎么用?Java ICompareInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICompareInput类属于org.eclipse.compare.structuremergeviewer包,在下文中一共展示了ICompareInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inputChanged
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
leftPlan = null;
rightPlan = null;
diffTrees = null;
if (newInput instanceof ICompareInput) {
ICompareInput input = (ICompareInput) newInput;
ResourceNode left = (ResourceNode) input.getLeft();
ResourceNode right = (ResourceNode) input.getRight();
try {
leftPlan = EPlanUtils.loadOnePlan(left.getResource());
rightPlan = EPlanUtils.loadOnePlan(right.getResource());
diffTrees = computeDiffTrees(leftPlan, rightPlan);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例2: compareInputChanged
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
protected void compareInputChanged(ICompareInput input) {
fThreeWay= input != null ? input.getAncestor() != null
: false;
setSmartButtonVisible(fThreeWay);
if (input != null) {
Map<String, String> compilerOptions= getCompilerOptions(input.getAncestor());
if (compilerOptions == null)
compilerOptions= getCompilerOptions(input.getLeft());
if (compilerOptions == null)
compilerOptions= getCompilerOptions(input.getRight());
if (compilerOptions != null)
fStructureCreator.setDefaultCompilerOptions(compilerOptions);
}
super.compareInputChanged(input);
}
示例3: setInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
public void setInput(Object input) {
if (input instanceof ICompareInput) {
project = getTypeScriptProject((ICompareInput) input);
if (project != null) {
setPreferenceStore(createChainedPreferenceStore(project));
}
}
super.setInput(input);
}
示例4: setInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
public void setInput(Object newInput) {
earlierPlan = null;
laterPlan = null;
if (newInput instanceof ICompareInput) {
ICompareInput input = (ICompareInput) newInput;
ITypedElement left = input.getLeft();
ITypedElement right = input.getRight();
try {
boolean leftOlderThanRight = isOlder(left, right);
earlierPlan = loadOnePlan(leftOlderThanRight? left : right);
laterPlan = loadOnePlan(leftOlderThanRight? right : left);
PlanDiffList differenceInfo = computeDiffInfo ();
final File outputFile = File.createTempFile("Plan-Comparison", ".html");
PrintStream out = new PrintStream(new FileOutputStream(outputFile));
// new PlanDiffOutputAsTreeHTML().writeToStream(computeDiffTrees(differenceInfo),
// differenceInfo,
// earlierPlan, laterPlan, out);
new PlanDiffOutputAsTableHTML().writeToStream(
differenceInfo, earlierPlan, laterPlan, null, out);
out.close();
browser.setUrl(outputFile.toURI().toURL().toExternalForm());
} catch (Exception e) {
e.printStackTrace();
MessageDialog.openError(parent.getShell(),
"Error while comparing plans",
"Sorry, an error occurred while comparing plans:\n" + e);
OutputStream stream = new ByteArrayOutputStream();
e.printStackTrace(new PrintStream(stream));
browser.setText("<h1>Plan Diff Error</h1><pre>"
+ stream.toString() + "</pre>");
}
}
}
示例5: asCompareInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ICompareInput asCompareInput(final ISynchronizationContext context, final Object element) {
if (element instanceof RefactoringDescriptorProxy)
return super.asCompareInput(context, element);
final IResource resource= JavaModelProvider.getResource(element);
if (resource != null)
return super.asCompareInput(context, resource);
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaSynchronizationCompareAdapter.java
示例6: findAffectedElement
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
/**
* Tells which elements of the comparison are affected by the change.
*
* @param event element changed event
* @return array of typed elements affected by the event. May return an empty array.
* @since 3.5
*/
private ITypedElement[] findAffectedElement(ElementChangedEvent event) {
Object input= getInput();
if (!(input instanceof ICompareInput))
return new ITypedElement[0];
Set<ITypedElement> affectedElements= new HashSet<ITypedElement>();
ICompareInput ci= (ICompareInput)input;
IJavaElementDelta delta= event.getDelta();
addAffectedElement(ci.getAncestor(), delta, affectedElements);
addAffectedElement(ci.getLeft(), delta, affectedElements);
addAffectedElement(ci.getRight(), delta, affectedElements);
return affectedElements.toArray(new ITypedElement[affectedElements.size()]);
}
示例7: setDiff
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
void setDiff(ICompareInput diff) {
if (fIsOut)
return;
fIsOut= true;
JavaNode a= (JavaNode) diff.getAncestor();
JavaNode y= (JavaNode) diff.getLeft();
JavaNode m= (JavaNode) diff.getRight();
if (a != null) {
if (fAncestor != null)
return;
fAncestor= a;
}
if (y != null) {
if (fLeft != null)
return;
fLeft= y;
}
if (m != null) {
if (fRight != null)
return;
fRight= m;
}
fIsOut= false;
}
示例8: setInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
public void setInput(Object input) {
if (input instanceof ICompareInput) {
IJavaProject project= getJavaProject((ICompareInput)input);
if (project != null) {
setPreferenceStore(createChainedPreferenceStore(project));
}
}
super.setInput(input);
}
示例9: getCompareElementFromCompareInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
ITypedElement getCompareElementFromCompareInput(final ICompareInput input) {
return input.getLeft();
}
示例10: CompareInputResourceProvider
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
public CompareInputResourceProvider(ICompareInput compareInput, ITypedElement typedElement) {
Assert.isNotNull(compareInput, "parameter 'compareInput' must not be null");
Assert.isNotNull(typedElement, "parameter 'typedElement' must not be null");
this.compareInput = compareInput;
this.typedElement = typedElement;
}
示例11: createResourceProvider
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
protected IResourceProvider createResourceProvider(Object object) {
if (getInput() instanceof ICompareInput && object instanceof ITypedElement) {
return new CompareInputResourceProvider(((ICompareInput) getInput()), (ITypedElement) object);
}
return NULL_RESOURCE_PROVIDER;
}
示例12: createInput
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
private ICompareInput createInput() {
return new GitDiffNode(diff);
}
示例13: getViewer
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
protected Viewer getViewer(Viewer oldViewer, Object input) {
if (input instanceof ICompareInput)
return CompareUI.findContentViewer(oldViewer, (ICompareInput)input, this, fCompareConfiguration);
return null;
}
示例14: compare
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
void compare(ICompareInput input) {
fInput= input;
fCompareConfiguration.setLeftLabel(fInput.getLeft().getName());
fCompareConfiguration.setLeftImage(fInput.getLeft().getImage());
fCompareConfiguration.setRightLabel(fInput.getRight().getName());
fCompareConfiguration.setRightImage(fInput.getRight().getImage());
if (fContentPane != null)
fContentPane.setInput(fInput);
open();
}
示例15: getImage
import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
/**
* Get an {@link Image} for a compare element.
*
* @param compareInput
* the {@link ICompareInput} that represents the current node being
* displayed in the content/merge viewer - for example, a
* {@link DiffNode} (must not be <code>null</code>)
* @param compareElement
* the compare element representing one side of the compare to
* provide an image for (must not be <code>null</code>)
* @param type
* the {@link CompareElementType} that represents which side of the
* compare the <code>compareElement</code> is (must not be
* <code>null</code>)
* @return an {@link Image} for the element, or <code>null</code>
*/
public Image getImage(ICompareInput compareInput, ITypedElement compareElement, CompareElementType type);