Tabnine Logo
CompletionProposal.getDeclarationKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getDeclarationKey
method
in
org.eclipse.jdt.core.CompletionProposal

Best Java code snippets using org.eclipse.jdt.core.CompletionProposal.getDeclarationKey (Showing top 11 results out of 315)

origin: org.eclipse.recommenders.completion/rcp

public ProcessableAnonymousTypeCompletionProposal(CompletionProposal coreProposal, JavaCompletionProposal uiProposal,
    JavaContentAssistInvocationContext context) throws JavaModelException {
  super(context.getProject(), context.getCompilationUnit(), context, coreProposal.getReplaceStart(), uiProposal
      .getReplacementLength(), String.valueOf(coreProposal.getCompletion()), uiProposal
      .getStyledDisplayString(), String.valueOf(coreProposal.getDeclarationSignature()), (IType) context
      .getProject().findElement(String.valueOf(coreProposal.getDeclarationKey()), null), uiProposal
      .getRelevance());
  this.coreProposal = coreProposal;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: org.eclipse.tycho/org.eclipse.jdt.core

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: trylimits/Eclipse-Postfix-Code-Completion

buffer.append("\tDeclarationSignature[").append(proposal.getDeclarationSignature() == null ? "null".toCharArray() : proposal.getDeclarationSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tDeclarationKey[").append(proposal.getDeclarationKey() == null ? "null".toCharArray() : proposal.getDeclarationKey()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
printDebugTab(tab, buffer);
buffer.append("\tSignature[").append(proposal.getSignature() == null ? "null".toCharArray() : proposal.getSignature()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private IJavaCompletionProposal createAnonymousTypeProposal(CompletionProposal proposal, JavaContentAssistInvocationContext invocationContext) {
  if (fCompilationUnit == null || fJavaProject == null)
    return null;
  char[] declarationKey= proposal.getDeclarationKey();
  if (declarationKey == null)
    return null;
  try {
    IJavaElement element= fJavaProject.findElement(new String(declarationKey), null);
    if (!(element instanceof IType))
      return null;
    IType type= (IType) element;
    String completion= String.valueOf(proposal.getCompletion());
    int start= proposal.getReplaceStart();
    int length= getLength(proposal);
    int relevance= computeRelevance(proposal);
    StyledString label= fLabelProvider.createAnonymousTypeLabel(proposal);
    JavaCompletionProposal javaProposal= new AnonymousTypeCompletionProposal(fJavaProject, fCompilationUnit, invocationContext, start, length, completion, label, String.valueOf(proposal
        .getDeclarationSignature()), type, relevance);
    javaProposal.setProposalInfo(new AnonymousTypeProposalInfo(fJavaProject, proposal));
    return javaProposal;
  } catch (JavaModelException e) {
    return null;
  }
}
origin: org.eclipse.recommenders.completion.rcp/subwords

public static SwAnonymousTypeCompletionProposal createAnonymousTypeCompletionProposal(
    final SubwordsProposalContext subwordsContext) throws JavaModelException {
  final JavaContentAssistInvocationContext context = subwordsContext.getContext();
  final CompletionProposal proposal = subwordsContext.getProposal();
  final JavaCompletionProposal jdtProposal = subwordsContext.getJdtProposal();
  final IJavaProject project = context.getProject();
  final String declarationSignature = String.valueOf(proposal.getDeclarationSignature());
  final String declarationKey = String.valueOf(proposal.getDeclarationKey());
  final String completionText = String.valueOf(proposal.getCompletion());
  return new SwAnonymousTypeCompletionProposal(project, context.getCompilationUnit(), context,
      proposal.getReplaceStart(), jdtProposal.getReplacementLength(), completionText,
      jdtProposal.getStyledDisplayString(), declarationSignature, (IType) project.findElement(declarationKey,
          null), jdtProposal.getRelevance(), subwordsContext);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private IJavaCompletionProposal createAnonymousTypeProposal(CompletionProposal proposal, JavaContentAssistInvocationContext invocationContext) {
  if (fCompilationUnit == null || fJavaProject == null)
    return null;
  char[] declarationKey= proposal.getDeclarationKey();
  if (declarationKey == null)
    return null;
  try {
    IJavaElement element= fJavaProject.findElement(new String(declarationKey), null);
    if (!(element instanceof IType))
      return null;
    IType type= (IType) element;
    String completion= String.valueOf(proposal.getCompletion());
    int start= proposal.getReplaceStart();
    int length= getLength(proposal);
    int relevance= computeRelevance(proposal);
    StyledString label= fLabelProvider.createAnonymousTypeLabel(proposal);
    JavaCompletionProposal javaProposal= new AnonymousTypeCompletionProposal(fJavaProject, fCompilationUnit, invocationContext, start, length, completion, label, String.valueOf(proposal
        .getDeclarationSignature()), type, relevance);
    javaProposal.setProposalInfo(new AnonymousTypeProposalInfo(fJavaProject, proposal));
    return javaProposal;
  } catch (JavaModelException e) {
    return null;
  }
}
origin: eclipse/eclipse.jdt.ls

IBuffer buffer = this.compilationUnit.getBuffer();
document = JsonRpcHelpers.toDocument(buffer);
char[] declarationKey = proposal.getDeclarationKey();
if (declarationKey == null) {
  return;
org.eclipse.jdt.coreCompletionProposalgetDeclarationKey

Javadoc

Returns the key of the relevant declaration in the context, or null if none.

This field is available for the following kinds of completion proposals:

  • ANONYMOUS_CLASS_DECLARATION - key of the type that is being subclassed or implemented
  • METHOD_DECLARATION - key of the type that declares the method that is being implemented or overridden
For kinds of completion proposals, this method returns null. Clients must not modify the array returned.

Popular methods of CompletionProposal

  • getKind
    Returns the kind of completion being proposed. The set of different kinds of completion proposals is
  • getName
    Returns the simple name of the method, field, member, or variable relevant in the context, ornull if
  • getSignature
    Returns the signature of the method or type relevant in the context, or null if none. This field is
  • findParameterNames
    Finds the method parameter names. This information is relevant to method reference (and method decla
  • getCompletion
    Returns the proposed sequence of characters to insert into the source file buffer, replacing the cha
  • getDeclarationSignature
    Returns the type signature or package name of the relevant declaration in the context, or null if no
  • getReplaceStart
    Returns the character index of the start of the subrange in the source file buffer to be replaced by
  • create
    Creates a basic completion proposal. All instance field have plausible default values unless otherwi
  • getRelevance
    Returns the relative relevance rating of this proposal.
  • getReplaceEnd
    Returns the character index of the end of the subrange in the source file buffer to be replaced by t
  • getCompletionLocation
    Returns the character index in the source file buffer where source completion was requested (theoffs
  • getFlags
    Returns the modifier flags relevant in the context, orFlags.AccDefault if none. This field is avail
  • getCompletionLocation,
  • getFlags,
  • getRequiredProposals,
  • setCompletion,
  • setDeclarationSignature,
  • setRelevance,
  • setReplaceRange,
  • setSignature,
  • setFlags

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now