/** * Safely computes completion proposals of all computers of this category through their * extension. If an extension is disabled, throws an exception or otherwise does not adhere to * the contract described in {@link IJavaCompletionProposalComputer}, it is disabled. * * @param context the invocation context passed on to the extension * @param partition the partition type where to invocation occurred * @param monitor the progress monitor passed on to the extension * @return the list of computed completion proposals (element type: * {@link org.eclipse.jface.text.contentassist.ICompletionProposal}) */ public List computeCompletionProposals(ContentAssistInvocationContext context, String partition, SubProgressMonitor monitor) { fLastError= null; List result= new ArrayList(); List descriptors= new ArrayList(fRegistry.getProposalComputerDescriptors(partition)); for (Iterator it= descriptors.iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); if (desc.getCategory() == this) result.addAll(desc.computeCompletionProposals(context, monitor)); if (fLastError == null) fLastError= desc.getErrorMessage(); } return result; }
/** * Safely computes completion proposals of all computers of this category through their * extension. If an extension is disabled, throws an exception or otherwise does not adhere to * the contract described in {@link IJavaCompletionProposalComputer}, it is disabled. * * @param context the invocation context passed on to the extension * @param partition the partition type where to invocation occurred * @param monitor the progress monitor passed on to the extension * @return the list of computed completion proposals (element type: * {@link org.eclipse.jface.text.contentassist.ICompletionProposal}) */ public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, String partition, SubProgressMonitor monitor) { fLastError= null; List<ICompletionProposal> result= new ArrayList<>(); List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors(partition)); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) result.addAll(desc.computeCompletionProposals(context, monitor)); if (fLastError == null && desc.getErrorMessage() != null) fLastError= desc.getErrorMessage(); } return result; }
/** * Safely computes completion proposals of all computers of this category through their * extension. If an extension is disabled, throws an exception or otherwise does not adhere to * the contract described in {@link IJavaCompletionProposalComputer}, it is disabled. * * @param context the invocation context passed on to the extension * @param partition the partition type where to invocation occurred * @param monitor the progress monitor passed on to the extension * @return the list of computed completion proposals (element type: * {@link org.eclipse.jface.text.contentassist.ICompletionProposal}) */ public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, String partition, SubProgressMonitor monitor) { fLastError= null; List<ICompletionProposal> result= new ArrayList<>(); List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors(partition)); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) result.addAll(desc.computeCompletionProposals(context, monitor)); if (fLastError == null && desc.getErrorMessage() != null) fLastError= desc.getErrorMessage(); } return result; }