/** * Returns <code>true</code> if the category contains any computers in the given partition, <code>false</code> * otherwise. * * @param partition the partition * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers(String partition) { List<CompletionProposalComputerDescriptor> descriptors= fRegistry.getProposalComputerDescriptors(partition); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) return true; } return false; }
/** * Returns <code>true</code> if the category contains any computers, <code>false</code> * otherwise. * * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers() { List<CompletionProposalComputerDescriptor> descriptors= fRegistry.getProposalComputerDescriptors(); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) return true; } return false; }
/** * Returns <code>true</code> if the category contains any computers, <code>false</code> * otherwise. * * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers() { List<CompletionProposalComputerDescriptor> descriptors= fRegistry.getProposalComputerDescriptors(); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) return true; } return false; }
/** * Returns <code>true</code> if the category contains any computers, <code>false</code> * otherwise. * * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers() { List descriptors= fRegistry.getProposalComputerDescriptors(); for (Iterator it= descriptors.iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); if (desc.getCategory() == this) return true; } return false; }
/** * Returns <code>true</code> if the category contains any computers in the given partition, <code>false</code> * otherwise. * * @param partition the partition * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers(String partition) { List<CompletionProposalComputerDescriptor> descriptors= fRegistry.getProposalComputerDescriptors(partition); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) return true; } return false; }
/** * Returns <code>true</code> if the category contains any computers in the given partition, <code>false</code> * otherwise. * * @param partition the partition * @return <code>true</code> if the category contains any computers, <code>false</code> * otherwise */ public boolean hasComputers(String partition) { List descriptors= fRegistry.getProposalComputerDescriptors(partition); for (Iterator it= descriptors.iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); if (desc.getCategory() == this) return true; } return false; }
/** * Notifies the computers in this category of a proposal computation session end. */ public void sessionEnded() { List descriptors= new ArrayList(fRegistry.getProposalComputerDescriptors()); for (Iterator it= descriptors.iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); if (desc.getCategory() == this) desc.sessionEnded(); if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * Returns the names of contributors affected by disabling a category. * * @param category the category that would be disabled * @param culprit the culprit plug-in, which is not included in the returned list * @return the names of the contributors other than <code>culprit</code> that contribute to <code>category</code> (element type: {@link String}) */ private Set getAffectedContributors(CompletionProposalCategory category, IContributor culprit) { Set affectedPlugins= new HashSet(); for (Iterator it= getProposalComputerDescriptors().iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); CompletionProposalCategory cat= desc.getCategory(); if (cat.equals(category)) { IContributor contributor= desc.getContributor(); if (contributor != null && !culprit.equals(contributor)) affectedPlugins.add(contributor.getName()); } } return affectedPlugins; }
/** * Notifies the computers in this category of a proposal computation session start. */ public void sessionStarted() { List descriptors= new ArrayList(fRegistry.getProposalComputerDescriptors()); for (Iterator it= descriptors.iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next(); if (desc.getCategory() == this) desc.sessionStarted(); if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * Returns the names of contributors affected by disabling a category. * * @param category the category that would be disabled * @param culprit the culprit plug-in, which is not included in the returned list * @return the names of the contributors other than <code>culprit</code> that contribute to <code>category</code> (element type: {@link String}) */ private Set<String> getAffectedContributors(CompletionProposalCategory category, IContributor culprit) { Set<String> affectedPlugins= new HashSet<>(); for (Iterator<CompletionProposalComputerDescriptor> it= getProposalComputerDescriptors().iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= it.next(); CompletionProposalCategory cat= desc.getCategory(); if (cat.equals(category)) { IContributor contributor= desc.getContributor(); if (contributor != null && !culprit.equals(contributor)) affectedPlugins.add(contributor.getName()); } } return affectedPlugins; }
/** * Returns the names of contributors affected by disabling a category. * * @param category the category that would be disabled * @param culprit the culprit plug-in, which is not included in the returned list * @return the names of the contributors other than <code>culprit</code> that contribute to <code>category</code> (element type: {@link String}) */ private Set<String> getAffectedContributors(CompletionProposalCategory category, IContributor culprit) { Set<String> affectedPlugins= new HashSet<>(); for (Iterator<CompletionProposalComputerDescriptor> it= getProposalComputerDescriptors().iterator(); it.hasNext();) { CompletionProposalComputerDescriptor desc= it.next(); CompletionProposalCategory cat= desc.getCategory(); if (cat.equals(category)) { IContributor contributor= desc.getContributor(); if (contributor != null && !culprit.equals(contributor)) affectedPlugins.add(contributor.getName()); } } return affectedPlugins; }
/** * Notifies the computers in this category of a proposal computation session end. */ public void sessionEnded() { fNeedsSortingAfterFiltering= false; List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors()); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) desc.sessionEnded(); if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * Safely computes context information objects 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 context information objects (element type: * {@link org.eclipse.jface.text.contentassist.IContextInformation}) */ public List computeContextInformation(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.computeContextInformation(context, monitor)); if (fLastError == null) fLastError= desc.getErrorMessage(); } return result; }
/** * Notifies the computers in this category of a proposal computation session end. */ public void sessionEnded() { fNeedsSortingAfterFiltering= false; List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors()); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) desc.sessionEnded(); if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * 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; }
/** * Notifies the computers in this category of a proposal computation session start. */ public void sessionStarted() { List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors()); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) { desc.sessionStarted(); fNeedsSortingAfterFiltering= fNeedsSortingAfterFiltering || desc.isSortingAfterFilteringNeeded(); } if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * Notifies the computers in this category of a proposal computation session start. */ public void sessionStarted() { List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors()); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this) { desc.sessionStarted(); fNeedsSortingAfterFiltering= fNeedsSortingAfterFiltering || desc.isSortingAfterFilteringNeeded(); } if (fLastError == null) fLastError= desc.getErrorMessage(); } }
/** * Safely computes context information objects 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 context information objects (element type: * {@link org.eclipse.jface.text.contentassist.IContextInformation}) */ public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, String partition, SubProgressMonitor monitor) { fLastError= null; List<IContextInformation> result= new ArrayList<>(); List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors(partition)); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this && (isIncluded() || isSeparateCommand())) result.addAll(desc.computeContextInformation(context, monitor)); if (fLastError == null) fLastError= desc.getErrorMessage(); } return result; }
/** * Safely computes context information objects 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 context information objects (element type: * {@link org.eclipse.jface.text.contentassist.IContextInformation}) */ public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, String partition, SubProgressMonitor monitor) { fLastError= null; List<IContextInformation> result= new ArrayList<>(); List<CompletionProposalComputerDescriptor> descriptors= new ArrayList<>(fRegistry.getProposalComputerDescriptors(partition)); for (CompletionProposalComputerDescriptor desc : descriptors) { if (desc.getCategory() == this && (isIncluded() || isSeparateCommand())) result.addAll(desc.computeContextInformation(context, monitor)); if (fLastError == null) fLastError= desc.getErrorMessage(); } return result; }