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

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

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

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

@Override
protected boolean isOffsetValid(int offset) {
  if (fProposal.getKind() != CompletionProposal.CONSTRUCTOR_INVOCATION)
    return super.isOffsetValid(offset);
  return fProposal.getRequiredProposals()[0].getReplaceStart() <= offset;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
protected boolean isOffsetValid(int offset) {
  if (fProposal.getKind() != CompletionProposal.CONSTRUCTOR_INVOCATION)
    return super.isOffsetValid(offset);
  return fProposal.getRequiredProposals()[0].getReplaceStart() <= offset;
}
origin: eclipse/eclipse.jdt.ls

private void createAnonymousTypeLabel(CompletionProposal proposal, CompletionItem item) {
  char[] declaringTypeSignature= proposal.getDeclarationSignature();
  declaringTypeSignature= Signature.getTypeErasure(declaringTypeSignature);
  String name = new String(Signature.getSignatureSimpleName(declaringTypeSignature));
  item.setInsertText(name);
  StringBuilder buf= new StringBuilder();
  buf.append(name);
  buf.append('(');
  appendUnboundedParameterList(buf, proposal);
  buf.append(')');
  buf.append("  "); //$NON-NLS-1$
  buf.append("Anonymous Inner Type"); //TODO: consider externalization
  item.setLabel(buf.toString());
  if (proposal.getRequiredProposals() != null) {
    char[] signatureQualifier= Signature.getSignatureQualifier(declaringTypeSignature);
    if (signatureQualifier.length > 0) {
      item.setDetail(String.valueOf(signatureQualifier));
    }
  }
  setDeclarationSignature(item, String.valueOf(declaringTypeSignature));
}
origin: eclipse/eclipse.jdt.ls

  @Override
  public void accept(CompletionProposal proposal) {
    if (elementName.equals(new String(proposal.getName()))) {
      CompletionProposal[] requiredProposals= proposal.getRequiredProposals();
      for (int i= 0; i < requiredProposals.length; i++) {
        CompletionProposal curr= requiredProposals[i];
        if (curr.getKind() == CompletionProposal.METHOD_IMPORT || curr.getKind() == CompletionProposal.FIELD_IMPORT) {
          result.add(JavaModelUtil.concatenateName(Signature.toCharArray(curr.getDeclarationSignature()), curr.getName()));
        }
      }
    }
  }
};
origin: org.eclipse.jdt/org.eclipse.jdt.ui

  @Override
  public void accept(CompletionProposal proposal) {
    if (elementName.equals(new String(proposal.getName()))) {
      CompletionProposal[] requiredProposals= proposal.getRequiredProposals();
      for (int i= 0; i < requiredProposals.length; i++) {
        CompletionProposal curr= requiredProposals[i];
        if (curr.getKind() == CompletionProposal.METHOD_IMPORT || curr.getKind() == CompletionProposal.FIELD_IMPORT) {
          result.add(JavaModelUtil.concatenateName(Signature.toCharArray(curr.getDeclarationSignature()), curr.getName()));
        }
      }
    }
  }
};
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  @Override
  public void accept(CompletionProposal proposal) {
    if (elementName.equals(new String(proposal.getName()))) {
      CompletionProposal[] requiredProposals= proposal.getRequiredProposals();
      for (int i= 0; i < requiredProposals.length; i++) {
        CompletionProposal curr= requiredProposals[i];
        if (curr.getKind() == CompletionProposal.METHOD_IMPORT || curr.getKind() == CompletionProposal.FIELD_IMPORT) {
          result.add(JavaModelUtil.concatenateName(Signature.toCharArray(curr.getDeclarationSignature()), curr.getName()));
        }
      }
    }
  }
};
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public int getPrefixCompletionStart(IDocument document, int completionOffset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.getPrefixCompletionStart(document, completionOffset);
  return coreProposal.getRequiredProposals()[0].getReplaceStart();
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
protected boolean isOffsetValid(int offset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.isOffsetValid(offset);
  return coreProposal.getRequiredProposals()[0].getReplaceStart() <= offset;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
protected boolean isOffsetValid(int offset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.isOffsetValid(offset);
  return coreProposal.getRequiredProposals()[0].getReplaceStart() <= offset;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
public int getPrefixCompletionStart(IDocument document, int completionOffset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.getPrefixCompletionStart(document, completionOffset);
  return coreProposal.getRequiredProposals()[0].getReplaceStart();
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
protected String getPrefix(IDocument document, int offset) {
  if (fProposal.getKind() != CompletionProposal.CONSTRUCTOR_INVOCATION)
    return super.getPrefix(document, offset);
  int replacementOffset= fProposal.getRequiredProposals()[0].getReplaceStart();
  try {
    int length= offset - replacementOffset;
    if (length > 0)
      return document.get(replacementOffset, length);
  } catch (BadLocationException x) {
  }
  return ""; //$NON-NLS-1$
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
protected String getPrefix(IDocument document, int offset) {
  if (fProposal.getKind() != CompletionProposal.CONSTRUCTOR_INVOCATION)
    return super.getPrefix(document, offset);
  int replacementOffset= fProposal.getRequiredProposals()[0].getReplaceStart();
  try {
    int length= offset - replacementOffset;
    if (length > 0)
      return document.get(replacementOffset, length);
  } catch (BadLocationException x) {
  }
  return ""; //$NON-NLS-1$
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public int getPrefixCompletionStart(IDocument document, int completionOffset) {
  if (fProposal.getKind() == CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER) {
    return fProposal.getTokenStart();
  } else if (fProposal.getKind() == CompletionProposal.CONSTRUCTOR_INVOCATION)
    return fProposal.getRequiredProposals()[0].getReplaceStart();
  return super.getPrefixCompletionStart(document, completionOffset);
}

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

@Override
public int getPrefixCompletionStart(IDocument document, int completionOffset) {
  if (fProposal.getKind() == CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER) {
    return fProposal.getTokenStart();
  } else if (fProposal.getKind() == CompletionProposal.CONSTRUCTOR_INVOCATION)
    return fProposal.getRequiredProposals()[0].getReplaceStart();
  return super.getPrefixCompletionStart(document, completionOffset);
}

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

@Override
protected String getPrefix(IDocument document, int offset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.getPrefix(document, offset);
  int replacementOffset= coreProposal.getRequiredProposals()[0].getReplaceStart();
  try {
    int length= offset - replacementOffset;
    if (length > 0)
      return document.get(replacementOffset, length);
  } catch (BadLocationException x) {
  }
  return ""; //$NON-NLS-1$
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
protected String getPrefix(IDocument document, int offset) {
  CompletionProposal coreProposal= ((MemberProposalInfo)getProposalInfo()).fProposal;
  if (coreProposal.getKind() != CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION)
    return super.getPrefix(document, offset);
  int replacementOffset= coreProposal.getRequiredProposals()[0].getReplaceStart();
  try {
    int length= offset - replacementOffset;
    if (length > 0)
      return document.get(replacementOffset, length);
  } catch (BadLocationException x) {
  }
  return ""; //$NON-NLS-1$
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

StyledString createAnonymousTypeLabel(CompletionProposal proposal) {
  char[] declaringTypeSignature= proposal.getDeclarationSignature();
  declaringTypeSignature= Signature.getTypeErasure(declaringTypeSignature);
  StyledString buffer= new StyledString();
  buffer.append(Signature.getSignatureSimpleName(declaringTypeSignature));
  buffer.append('(');
  appendUnboundedParameterList(buffer, proposal);
  buffer.append(')');
  buffer.append("  "); //$NON-NLS-1$
  buffer.append(JavaTextMessages.ResultCollector_anonymous_type);
  if (proposal.getRequiredProposals() != null) {
    char[] signatureQualifier= Signature.getSignatureQualifier(declaringTypeSignature);
    if (signatureQualifier.length > 0) {
      buffer.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER);
      buffer.append(signatureQualifier, StyledString.QUALIFIER_STYLER);
    }
  }
  return Strings.markJavaElementLabelLTR(buffer);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

StyledString createAnonymousTypeLabel(CompletionProposal proposal) {
  char[] declaringTypeSignature= proposal.getDeclarationSignature();
  declaringTypeSignature= Signature.getTypeErasure(declaringTypeSignature);
  StyledString buffer= new StyledString();
  buffer.append(Signature.getSignatureSimpleName(declaringTypeSignature));
  buffer.append('(');
  appendUnboundedParameterList(buffer, proposal);
  buffer.append(')');
  buffer.append("  "); //$NON-NLS-1$
  buffer.append(JavaTextMessages.ResultCollector_anonymous_type);
  if (proposal.getRequiredProposals() != null) {
    char[] signatureQualifier= Signature.getSignatureQualifier(declaringTypeSignature);
    if (signatureQualifier.length > 0) {
      buffer.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER);
      buffer.append(signatureQualifier, StyledString.QUALIFIER_STYLER);
    }
  }
  return Strings.markJavaElementLabelLTR(buffer);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

StyledString createLabelWithTypeAndDeclaration(CompletionProposal proposal) {
  char[] name= proposal.getCompletion();
  if (!isThisPrefix(name))
    name= proposal.getName();
  StyledString buf= new StyledString();
  buf.append(name);
  char[] typeName= Signature.getSignatureSimpleName(proposal.getSignature());
  if (typeName.length > 0) {
    buf.append(VAR_TYPE_SEPARATOR);
    buf.append(typeName);
  }
  char[] declaration= proposal.getDeclarationSignature();
  if (declaration != null) {
    declaration= Signature.getSignatureSimpleName(declaration);
    if (declaration.length > 0) {
      buf.append(QUALIFIER_SEPARATOR, StyledString.QUALIFIER_STYLER);
      if (proposal.getRequiredProposals() != null) {
        String declaringType= extractDeclaringTypeFQN(proposal);
        String qualifier= Signature.getQualifier(declaringType);
        if (qualifier.length() > 0) {
          buf.append(qualifier, StyledString.QUALIFIER_STYLER);
          buf.append('.', StyledString.QUALIFIER_STYLER);
        }
      }
      buf.append(declaration, StyledString.QUALIFIER_STYLER);
    }
  }
  return Strings.markJavaElementLabelLTR(buf);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

StyledString createLabelWithTypeAndDeclaration(CompletionProposal proposal) {
  char[] name= proposal.getCompletion();
  if (!isThisPrefix(name))
    name= proposal.getName();
  StyledString buf= new StyledString();
  buf.append(name);
  char[] typeName= Signature.getSignatureSimpleName(proposal.getSignature());
  if (typeName.length > 0) {
    buf.append(VAR_TYPE_SEPARATOR);
    buf.append(typeName);
  }
  char[] declaration= proposal.getDeclarationSignature();
  if (declaration != null) {
    declaration= Signature.getSignatureSimpleName(declaration);
    if (declaration.length > 0) {
      buf.append(QUALIFIER_SEPARATOR, StyledString.QUALIFIER_STYLER);
      if (proposal.getRequiredProposals() != null) {
        String declaringType= extractDeclaringTypeFQN(proposal);
        String qualifier= Signature.getQualifier(declaringType);
        if (qualifier.length() > 0) {
          buf.append(qualifier, StyledString.QUALIFIER_STYLER);
          buf.append('.', StyledString.QUALIFIER_STYLER);
        }
      }
      buf.append(declaration, StyledString.QUALIFIER_STYLER);
    }
  }
  return Strings.markJavaElementLabelLTR(buf);
}
org.eclipse.jdt.coreCompletionProposalgetRequiredProposals

Javadoc

Returns the required completion proposals. The proposal can be apply only if these required completion proposals are also applied. If the required proposal aren't applied the completion could create completion problems.

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

  • FIELD_REF - The allowed required proposals for this kind are:
    • TYPE_REF
    • TYPE_IMPORT
    • FIELD_IMPORT
  • METHOD_REF - The allowed required proposals for this kind are:
    • TYPE_REF
    • TYPE_IMPORT
    • METHOD_IMPORT
  • TYPE_REF - The allowed required proposals for this kind are:
    • TYPE_REF
  • CONSTRUCTOR_INVOCATION - The allowed required proposals for this kind are:
    • TYPE_REF
  • ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION - The allowed required proposals for this kind are:
    • TYPE_REF
  • ANONYMOUS_CLASS_DECLARATION - The allowed required proposals for this kind are:
    • TYPE_REF

Other kinds of required proposals will be returned in the future, therefore clients of this API must allow with CompletionRequestor#setAllowsRequiredProposals(int,int,boolean)only kinds which are in this list to avoid unexpected results in the future.

A required proposal of a given kind is proposed even if CompletionRequestor#isIgnored(int)return true for that kind.

A required completion proposal cannot have required completion proposals.

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
  • 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
  • getReplaceEnd,
  • getCompletionLocation,
  • getFlags,
  • setCompletion,
  • setDeclarationSignature,
  • setRelevance,
  • setReplaceRange,
  • setSignature,
  • setFlags

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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