/** * Returns the {@link CompletionContext core completion context} if available, <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 core completion context if available, <code>null</code> otherwise */ public CompletionContext getCoreContext() { if (fCoreContext == null) { // use the context from the existing collector if it exists, retrieve one ourselves otherwise if (fCollector != null) fCoreContext= fCollector.getContext(); if (fCoreContext == null) computeKeywordsAndContext(); } return fCoreContext; }
/** * Returns the {@link CompletionContext core completion context} if available, <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 core completion context if available, <code>null</code> otherwise */ public CompletionContext getCoreContext() { if (fCollector != null) { CompletionContext context= fCollector.getContext(); if (context != null) { if (fCoreContext == null) fCoreContext= context; return context; } } if (fCoreContext == null) computeKeywordsAndContext(); // Retrieve the context ourselves return fCoreContext; }
/** * Returns the {@link CompletionContext core completion context} if available, <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 core completion context if available, <code>null</code> otherwise */ public CompletionContext getCoreContext() { if (fCollector != null) { CompletionContext context= fCollector.getContext(); if (context != null) { if (fCoreContext == null) fCoreContext= context; return context; } } if (fCoreContext == null) computeKeywordsAndContext(); // Retrieve the context ourselves return fCoreContext; }
/** * Returns the keyword proposals that are available in this context, possibly none. * <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 available keyword proposals */ public IJavaCompletionProposal[] getKeywordProposals() { if (fKeywordProposals == null) { if (fCollector != null && !fCollector.isIgnored(CompletionProposal.KEYWORD) && fCollector.getContext() != null) { // use the existing collector if it exists, collects keywords, and has already been invoked fKeywordProposals= fCollector.getKeywordCompletionProposals(); } else { // otherwise, retrieve keywords ourselves computeKeywordsAndContext(); } } return fKeywordProposals; }
/** * Returns the keyword proposals that are available in this context, possibly none. * <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 available keyword proposals */ public IJavaCompletionProposal[] getKeywordProposals() { if (fKeywordProposals == null) { if (fCollector != null && !fCollector.isIgnored(CompletionProposal.KEYWORD) && fCollector.getContext() != null) { // use the existing collector if it exists, collects keywords, and has already been invoked fKeywordProposals= fCollector.getKeywordCompletionProposals(); } else { // otherwise, retrieve keywords ourselves computeKeywordsAndContext(); } } return fKeywordProposals; }
/** * Returns the keyword proposals that are available in this context, possibly none. * <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 available keyword proposals */ public IJavaCompletionProposal[] getKeywordProposals() { if (fKeywordProposals == null) { if (fCollector != null && !fCollector.isIgnored(CompletionProposal.KEYWORD) && fCollector.getContext() != null) { // use the existing collector if it exists, collects keywords, and has already been invoked fKeywordProposals= fCollector.getKeywordCompletionProposals(); } else { // otherwise, retrieve keywords ourselves computeKeywordsAndContext(); } } return fKeywordProposals; }