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


Java ITypeRoot.equals方法代码示例

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


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

示例1: reconciled

import org.eclipse.jdt.core.ITypeRoot; //导入方法依赖的package包/类
/**
 * Update internal structures after reconcile.
 * 
 * @param ast the compilation unit AST or <code>null</code> if the working copy was consistent
 *            or reconciliation has been cancelled
 * @param javaElement the Java element for which the AST was built
 * @param progressMonitor the progress monitor
 * @see org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener#reconciled(CompilationUnit,
 *      boolean, IProgressMonitor)
 */
void reconciled(CompilationUnit ast, ITypeRoot javaElement, IProgressMonitor progressMonitor) {
	if (DEBUG)
		System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "reconciled: " + toString(javaElement) + ", AST: " + toString(ast)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

	synchronized (fReconcileLock) {
		fIsReconciling= false;
		if (javaElement == null || !javaElement.equals(fReconcilingJavaElement)) {

			if (DEBUG)
				System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "  ignoring AST of out-dated editor"); //$NON-NLS-1$ //$NON-NLS-2$

			// Signal - threads might wait for wrong element
			synchronized (fWaitLock) {
				fWaitLock.notifyAll();
			}

			return;
		}
		cache(ast, javaElement);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:ASTProvider.java

示例2: detectHyperlinks

import org.eclipse.jdt.core.ITypeRoot; //导入方法依赖的package包/类
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
	ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
	if (region == null || !(textEditor instanceof JavaEditor))
		return null;

	IAction openAction= textEditor.getAction("OpenEditor"); //$NON-NLS-1$
	if (!(openAction instanceof SelectionDispatchAction))
		return null;

	int offset= region.getOffset();

	ITypeRoot input= EditorUtility.getEditorInputJavaElement(textEditor, false);
	if (input == null)
		return null;

	try {
		IDocumentProvider documentProvider= textEditor.getDocumentProvider();
		IEditorInput editorInput= textEditor.getEditorInput();
		IDocument document= documentProvider.getDocument(editorInput);
		IRegion wordRegion= JavaWordFinder.findWord(document, offset);
		if (wordRegion == null || wordRegion.getLength() == 0)
			return null;

		if (isInheritDoc(document, wordRegion) && getClass() != JavaElementHyperlinkDetector.class)
			return null;

		if (JavaElementHyperlinkDetector.class == getClass() && findBreakOrContinueTarget(input, region) != null)
			return new IHyperlink[] { new JavaElementHyperlink(wordRegion, (SelectionDispatchAction)openAction, null, false) };
		
		IJavaElement[] elements;
		long modStamp= documentProvider.getModificationStamp(editorInput);
		if (input.equals(fLastInput) && modStamp == fLastModStamp && wordRegion.equals(fLastWordRegion)) {
			elements= fLastElements;
		} else {
			elements= ((ICodeAssist) input).codeSelect(wordRegion.getOffset(), wordRegion.getLength());
			elements= selectOpenableElements(elements);
			fLastInput= input;
			fLastModStamp= modStamp;
			fLastWordRegion= wordRegion;
			fLastElements= elements;
		}
		if (elements.length == 0)
			return null;
		
		ArrayList<IHyperlink> links= new ArrayList<IHyperlink>(elements.length);
		for (int i= 0; i < elements.length; i++) {
			addHyperlinks(links, wordRegion, (SelectionDispatchAction)openAction, elements[i], elements.length > 1, (JavaEditor)textEditor);
		}
		if (links.size() == 0)
			return null;
		
		return CollectionsUtil.toArray(links, IHyperlink.class);

	} catch (JavaModelException e) {
		return null;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:58,代码来源:JavaElementHyperlinkDetector.java

示例3: isReconciling

import org.eclipse.jdt.core.ITypeRoot; //导入方法依赖的package包/类
/**
 * Tells whether the given Java element is the one
 * reported as currently being reconciled.
 *
 * @param javaElement the Java element
 * @return <code>true</code> if reported as currently being reconciled
 */
private boolean isReconciling(ITypeRoot javaElement) {
	return javaElement != null && javaElement.equals(fReconcilingJavaElement) && fIsReconciling;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ASTProvider.java


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