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


Java CompletionContext.getExpectedTypesSignatures方法代码示例

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


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

示例1: getRHSHistory

import org.eclipse.jdt.core.CompletionContext; //导入方法依赖的package包/类
/**
 * Returns the content assist type history for the expected type.
 *
 * @return the content assist type history for the expected type
 */
private RHSHistory getRHSHistory() {
  if (fRHSHistory == null) {
    CompletionContext context = getCoreContext();
    if (context != null) {
      char[][] expectedTypes = context.getExpectedTypesSignatures();
      if (expectedTypes != null && expectedTypes.length > 0) {
        String expected = SignatureUtil.stripSignatureToFQN(String.valueOf(expectedTypes[0]));
        fRHSHistory = JavaPlugin.getDefault().getContentAssistHistory().getHistory(expected);
      }
    }
    if (fRHSHistory == null)
      fRHSHistory = JavaPlugin.getDefault().getContentAssistHistory().getHistory(null);
  }
  return fRHSHistory;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:JavaContentAssistInvocationContext.java

示例2: getExpectedType

import org.eclipse.jdt.core.CompletionContext; //导入方法依赖的package包/类
/**
 * Returns the expected type if any, <code>null</code> otherwise.
 *
 * <p><strong>Note:</strong> This method may run {@linkplain
 * org.eclipse.jdt.core.ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor)
 * codeComplete} on the compilation unit.
 *
 * @return the expected type if any, <code>null</code> otherwise
 */
public IType getExpectedType() {
  if (fType == null && getCompilationUnit() != null) {
    CompletionContext context = getCoreContext();
    if (context != null) {
      char[][] expectedTypes = context.getExpectedTypesSignatures();
      if (expectedTypes != null && expectedTypes.length > 0) {
        IJavaProject project = getCompilationUnit().getJavaProject();
        if (project != null) {
          try {
            fType =
                project.findType(
                    SignatureUtil.stripSignatureToFQN(String.valueOf(expectedTypes[0])));
          } catch (JavaModelException x) {
            JavaPlugin.log(x);
          }
        }
      }
    }
  }
  return fType;
}
 
开发者ID:eclipse,项目名称:che,代码行数:31,代码来源:JavaContentAssistInvocationContext.java

示例3: getRHSHistory

import org.eclipse.jdt.core.CompletionContext; //导入方法依赖的package包/类
/**
 * Returns the content assist type history for the expected type.
 *
 * @return the content assist type history for the expected type
 */
private RHSHistory getRHSHistory() {
	if (fRHSHistory == null) {
		CompletionContext context= getCoreContext();
		if (context != null) {
			char[][] expectedTypes= context.getExpectedTypesSignatures();
			if (expectedTypes != null && expectedTypes.length > 0) {
				String expected= SignatureUtil.stripSignatureToFQN(String.valueOf(expectedTypes[0]));
				fRHSHistory= JavaPlugin.getDefault().getContentAssistHistory().getHistory(expected);
			}
		}
		if (fRHSHistory == null)
			fRHSHistory= JavaPlugin.getDefault().getContentAssistHistory().getHistory(null);
	}
	return fRHSHistory;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:JavaContentAssistInvocationContext.java

示例4: getExpectedType

import org.eclipse.jdt.core.CompletionContext; //导入方法依赖的package包/类
/**
 * Returns the expected type if any, <code>null</code> otherwise.
 * <p>
 * <strong>Note:</strong> This method may run
 * {@linkplain ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor) codeComplete}
 * on the compilation unit.
 * </p>
 *
 * @return the expected type if any, <code>null</code> otherwise
 */
public IType getExpectedType() {
	if (fType == null && getCompilationUnit() != null) {
		CompletionContext context= getCoreContext();
		if (context != null) {
			char[][] expectedTypes= context.getExpectedTypesSignatures();
			if (expectedTypes != null && expectedTypes.length > 0) {
				IJavaProject project= getCompilationUnit().getJavaProject();
				if (project != null) {
					try {
						fType= project.findType(SignatureUtil.stripSignatureToFQN(String.valueOf(expectedTypes[0])));
					} catch (JavaModelException x) {
						JavaPlugin.log(x);
					}
				}
			}
		}
	}
	return fType;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:JavaContentAssistInvocationContext.java


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