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


Java ICompareInput类代码示例

本文整理汇总了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();
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:PlanDiffContentProvider.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:JavaStructureDiffViewer.java

示例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);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:11,代码来源:TypeScriptMergeViewer.java

示例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>");
			}
		}
	}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:35,代码来源:PlanDiffBrowserViewer.java

示例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()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:JavaStructureDiffViewer.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:JavaStructureCreator.java

示例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);
   }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaMergeViewer.java

示例9: getCompareElementFromCompareInput

import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
@Override
ITypedElement getCompareElementFromCompareInput(final ICompareInput input) {
    return input.getLeft();
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:5,代码来源:CompareElementType.java

示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:7,代码来源:CompareInputResourceProvider.java

示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:7,代码来源:DefaultMergeViewer.java

示例12: createInput

import org.eclipse.compare.structuremergeviewer.ICompareInput; //导入依赖的package包/类
private ICompareInput createInput() {
  return new GitDiffNode(diff);
}
 
开发者ID:sealuzh,项目名称:Permo,代码行数:4,代码来源:GitFileDiffEditorInput.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:CompareDialog.java

示例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();
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:CompareDialog.java

示例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);
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:18,代码来源:CompareLabelProvider.java


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