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

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

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

origin: eclipse/eclipse.jdt.ls

private IJavaElement resolveJavaElement(IJavaProject project, CompletionProposal proposal) throws JavaModelException {
  char[] signature= proposal.getSignature();
  String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(signature));
  return project.findType(typeName);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public final String getQualifiedTypeName() {
  if (fQualifiedName == null)
    fQualifiedName= String.valueOf(Signature.toCharArray(Signature.getTypeErasure(fProposal.getSignature())));
  return fQualifiedName;
}
origin: org.eclipse.recommenders.completion/rcp

private static String[] computeParamTypes(CompletionProposal proposal) {
  // parameter types do not contain any ; and don't start with L:
  String[] paramTypes = Signature.getParameterTypes(String.valueOf(proposal.getSignature()));
  for (int index = 0; index < paramTypes.length; index++)
    paramTypes[index] = Signature.toString(paramTypes[index]);
  return paramTypes;
}
origin: eclipse/eclipse.jdt.ls

private void createSimpleLabelWithType(CompletionProposal proposal, CompletionItem item) {
  StringBuilder nameBuffer= new StringBuilder();
  nameBuffer.append(proposal.getCompletion());
  item.setInsertText(nameBuffer.toString());
  char[] typeName= Signature.getSignatureSimpleName(proposal.getSignature());
  if (typeName.length > 0) {
    nameBuffer.append(VAR_TYPE_SEPARATOR);
    nameBuffer.append(typeName);
  }
  item.setLabel(nameBuffer.toString());
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Returns <code>true</code> if the method being inserted has at least one parameter. Note
 * that this does not say anything about whether the argument list should be inserted.
 *
 * @return <code>true</code> if the method has any parameters, <code>false</code> if it has no parameters
 * @since 3.4
 */
private boolean hasParameters() {
  CompletionProposal proposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  return Signature.getParameterCount(proposal.getSignature()) > 0;
}
origin: eclipse/eclipse.jdt.ls

private IJavaElement[][] getAssignableElements(CompletionProposal proposal) {
  char[] signature = SignatureUtil.fix83600(proposal.getSignature());
  char[][] types = Signature.getParameterTypes(signature);
  IJavaElement[][] assignableElements = new IJavaElement[types.length][];
  for (int i = 0; i < types.length; i++) {
    assignableElements[i] = context.getVisibleElements(new String(types[i]));
  }
  return assignableElements;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private String[] getParameterTypes() {
  char[] signature= SignatureUtil.fix83600(fProposal.getSignature());
  char[][] types= Signature.getParameterTypes(signature);
  String[] ret= new String[types.length];
  for (int i= 0; i < types.length; i++) {
    ret[i]= new String(Signature.toCharArray(types[i]));
  }
  return ret;
}
origin: org.eclipse.recommenders.completion.rcp/subwords

private String[] getParameterTypes() {
  final char[] signature = SignatureUtil.fix83600(fProposal.getSignature());
  final char[][] types = Signature.getParameterTypes(signature);
  final String[] ret = new String[types.length];
  for (int i = 0; i < types.length; i++) {
    ret[i] = new String(Signature.toCharArray(types[i]));
  }
  return ret;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private String[] getParameterTypes() {
  char[] signature= SignatureUtil.fix83600(fProposal.getSignature());
  char[][] types= Signature.getParameterTypes(signature);
  String[] ret= new String[types.length];
  for (int i= 0; i < types.length; i++) {
    ret[i]= new String(Signature.toCharArray(types[i]));
  }
  return ret;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private IJavaElement[][] getAssignableElements() {
  char[] signature= SignatureUtil.fix83600(getProposal().getSignature());
  char[][] types= Signature.getParameterTypes(signature);
  IJavaElement[][] assignableElements= new IJavaElement[types.length][];
  for (int i= 0; i < types.length; i++) {
    assignableElements[i]= fCoreContext.getVisibleElements(new String(types[i]));
  }
  return assignableElements;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Returns whether we automatically complete the method with a semicolon.
 * 
 * @return <code>true</code> if the return type of the method is void, <code>false</code>
 *         otherwise
 * @since 3.9
 */
protected final boolean canAutomaticallyAppendSemicolon() {
  return !fProposal.isConstructor() && CharOperation.equals(new char[] { Signature.C_VOID }, Signature.getReturnType(fProposal.getSignature()));
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private IJavaElement[][] getAssignableElements() {
  char[] signature= SignatureUtil.fix83600(getProposal().getSignature());
  char[][] types= Signature.getParameterTypes(signature);
  IJavaElement[][] assignableElements= new IJavaElement[types.length][];
  for (int i= 0; i < types.length; i++) {
    assignableElements[i]= fCoreContext.getVisibleElements(new String(types[i]));
  }
  return assignableElements;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Returns whether we automatically complete the method with a semicolon.
 * 
 * @return <code>true</code> if the return type of the method is void, <code>false</code>
 *         otherwise
 * @since 3.9
 */
protected final boolean canAutomaticallyAppendSemicolon() {
  return !fProposal.isConstructor() && CharOperation.equals(new char[] { Signature.C_VOID }, Signature.getReturnType(fProposal.getSignature()));
}
origin: org.eclipse/org.eclipse.jdt.ui

private String[][] getParameterSignatures() {
  char[] signature= SignatureUtil.fix83600(fProposal.getSignature());
  char[][] types= Signature.getParameterTypes(signature);
  String[][] ret= new String[types.length][2];
  for (int i= 0; i < types.length; i++) {
    char[] type= SignatureUtil.getLowerBound(types[i]);
    ret[i][0]= String.valueOf(Signature.getSignatureQualifier(type));
    ret[i][1]= String.valueOf(Signature.getSignatureSimpleName(type));
  }
  return ret;
}
origin: org.eclipse.recommenders.completion/rcp

private IJavaElement[][] getAssignableElements() {
  final char[] signature = SignatureUtil.fix83600(getProposal().getSignature());
  final char[][] types = Signature.getParameterTypes(signature);
  final IJavaElement[][] assignableElements = new IJavaElement[types.length][];
  for (int i = 0; i < types.length; i++) {
    assignableElements[i] = fCoreContext.getVisibleElements(new String(types[i]));
  }
  return assignableElements;
}
origin: eclipse/eclipse.jdt.ls

@Override
public void accept(CompletionProposal proposal) {
  if (proposal.getKind() == CompletionProposal.TYPE_REF) {
    addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public void accept(CompletionProposal proposal) {
  if (proposal.getKind() == CompletionProposal.TYPE_REF) {
    addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
  }
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

  @Override
  protected IContextInformation computeContextInformation() {
    char[] signature= fProposal.getSignature();
    char[][] typeParameters= Signature.getTypeArguments(signature);
    if (typeParameters.length == 0)
      return super.computeContextInformation();

    ProposalContextInformation contextInformation= new ProposalContextInformation(fProposal);
    if (fContextInformationPosition != 0 && fProposal.getCompletion().length == 0)
      contextInformation.setContextInformationPosition(fContextInformationPosition);
    return contextInformation;

  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  @Override
  protected IContextInformation computeContextInformation() {
    char[] signature= fProposal.getSignature();
    char[][] typeParameters= Signature.getTypeArguments(signature);
    if (typeParameters.length == 0)
      return super.computeContextInformation();

    ProposalContextInformation contextInformation= new ProposalContextInformation(fProposal);
    if (fContextInformationPosition != 0 && fProposal.getCompletion().length == 0)
      contextInformation.setContextInformationPosition(fContextInformationPosition);
    return contextInformation;

  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

StyledString createSimpleLabelWithType(CompletionProposal proposal) {
  StyledString buf= new StyledString();
  buf.append(proposal.getCompletion());
  char[] typeName= Signature.getSignatureSimpleName(proposal.getSignature());
  if (typeName.length > 0) {
    buf.append(VAR_TYPE_SEPARATOR);
    buf.append(typeName);
  }
  return Strings.markJavaElementLabelLTR(buf);
}
org.eclipse.jdt.coreCompletionProposalgetSignature

Javadoc

Returns the signature of the method or type relevant in the context, or null if none.

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

  • ANNOTATION_ATTRIBUT_REF - the type signature of the referenced attribute's type
  • ANONYMOUS_CLASS_DECLARATION - method signature of the constructor that is being invoked
  • FIELD_IMPORT - the type signature of the referenced field's type
  • FIELD_REF - the type signature of the referenced field's type
  • FIELD_REF_WITH_CASTED_RECEIVER - the type signature of the referenced field's type
  • LOCAL_VARIABLE_REF - the type signature of the referenced local variable's type
  • METHOD_IMPORT - method signature of the method that is imported
  • METHOD_REF - method signature of the method that is referenced
  • METHOD_REF_WITH_CASTED_RECEIVER - method signature of the method that is referenced
  • METHOD_DECLARATION - method signature of the method that is being implemented or overridden
  • TYPE_IMPORT - type signature of the type that is imported
  • TYPE_REF - type signature of the type that is referenced
  • VARIABLE_DECLARATION - the type signature of the type of the variable being declared
  • POTENTIAL_METHOD_DECLARATION - method signature of the method that is being created
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
  • 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
  • getDeclarationKey
    Returns the key of the relevant declaration in the context, or null if none. This field is availabl
  • 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

  • Finding current android device location
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
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