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


Java CompletionProposal.setDeclarationSignature方法代码示例

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


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

示例1: createTypeProposal

import org.eclipse.jdt.core.CompletionProposal; //导入方法依赖的package包/类
private IJavaCompletionProposal createTypeProposal(
    int relevance, String fullyQualifiedType, JavaContentAssistInvocationContext context)
    throws JavaModelException {
  IType type = context.getCompilationUnit().getJavaProject().findType(fullyQualifiedType);
  if (type == null) return null;

  CompletionProposal proposal =
      CompletionProposal.create(CompletionProposal.TYPE_REF, context.getInvocationOffset());
  proposal.setCompletion(fullyQualifiedType.toCharArray());
  proposal.setDeclarationSignature(type.getPackageFragment().getElementName().toCharArray());
  proposal.setFlags(type.getFlags());
  proposal.setRelevance(relevance);
  proposal.setReplaceRange(context.getInvocationOffset(), context.getInvocationOffset());
  proposal.setSignature(Signature.createTypeSignature(fullyQualifiedType, true).toCharArray());

  if (shouldProposeGenerics(context.getProject()))
    return new LazyGenericTypeProposal(proposal, context);
  else return new LazyJavaTypeCompletionProposal(proposal, context);
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:JavaTypeCompletionProposalComputer.java

示例2: createJavaCompletionProposal

import org.eclipse.jdt.core.CompletionProposal; //导入方法依赖的package包/类
@Override
protected IJavaCompletionProposal createJavaCompletionProposal(
    CompletionProposal proposal) {
  IJavaCompletionProposal defaultProposal = super.createJavaCompletionProposal(proposal);

  // For members of inner classes, there's a bug in the JDT which results in
  // the declaration signature of the proposal missing the outer classes, so
  // we have to manually set the signature instead.
  if (proposal.getKind() == CompletionProposal.METHOD_REF
      || proposal.getKind() == CompletionProposal.FIELD_REF) {
    char[] typeSignature = Signature.createTypeSignature(qualifiedTypeName,
        true).toCharArray();
    proposal.setDeclarationSignature(typeSignature);
  }

  return JsniCompletionProposal.create(defaultProposal, proposal,
      getCompilationUnit().getJavaProject(), refOffset, refLength);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:19,代码来源:JsniCompletionProposalCollector.java


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