private List getDefaultCategoriesUnchecked() { List included= new ArrayList(); for (Iterator it= fCategories.iterator(); it.hasNext();) { CompletionProposalCategory category= (CompletionProposalCategory) it.next(); if (category.isIncluded() && category.hasComputers(fPartition)) included.add(category); } return included; }
/** * Determine whether the category is enabled by default. * * @param category the category to check * @return <code>true</code> if this category is enabled by default, <code>false</code> * otherwise * @since 3.8 */ protected boolean checkDefaultEnablement(CompletionProposalCategory category) { return category.isIncluded() && category.hasComputers(fPartition); }
/** * Determine whether the category is enabled by default. * * @param category the category to check * @return <code>true</code> if this category is enabled by default, <code>false</code> * otherwise * @since 3.8 */ protected boolean checkDefaultEnablement(CompletionProposalCategory category) { return category.isIncluded() && category.hasComputers(fPartition); }
private void preventDuplicateCategories(IPreferenceStore store, Set<String> disabled, CompletionProposalCategory allProposals, CompletionProposalCategory typeProposals, CompletionProposalCategory allButTypeProposals) { boolean adjusted= false; if (allProposals == null || !allProposals.isIncluded()) return; if (allButTypeProposals != null && allButTypeProposals.isIncluded()) { allButTypeProposals.setIncluded(false); disabled.add(allButTypeProposals.getId()); adjusted= true; } if (typeProposals != null && typeProposals.isIncluded()) { typeProposals.setIncluded(false); disabled.add(typeProposals.getId()); adjusted= true; } if (adjusted) { StringBuilder buf= new StringBuilder(50 * disabled.size()); Iterator<String> iter= disabled.iterator(); while (iter.hasNext()) { buf.append(iter.next()); buf.append('\0'); } store.putValue(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, buf.toString()); } }
private void preventDuplicateCategories(IPreferenceStore store, Set<String> disabled, CompletionProposalCategory allProposals, CompletionProposalCategory typeProposals, CompletionProposalCategory allButTypeProposals) { boolean adjusted= false; if (allProposals == null || !allProposals.isIncluded()) return; if (allButTypeProposals != null && allButTypeProposals.isIncluded()) { allButTypeProposals.setIncluded(false); disabled.add(allButTypeProposals.getId()); adjusted= true; } if (typeProposals != null && typeProposals.isIncluded()) { typeProposals.setIncluded(false); disabled.add(typeProposals.getId()); adjusted= true; } if (adjusted) { StringBuffer buf= new StringBuffer(50 * disabled.size()); Iterator<String> iter= disabled.iterator(); while (iter.hasNext()) { buf.append(iter.next()); buf.append('\0'); } store.putValue(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, buf.toString()); } }
/** * 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; }
for (Iterator it= categories.iterator(); it.hasNext(); i++) { CompletionProposalCategory cat= (CompletionProposalCategory) it.next(); inclusionState[i]= cat.isIncluded(); cat.setIncluded(cat.getId().equals(categoryId)); separateState[i]= cat.isSeparateCommand();
for (Iterator<CompletionProposalCategory> it= categories.iterator(); it.hasNext(); i++) { CompletionProposalCategory cat= it.next(); inclusionState[i]= cat.isIncluded(); cat.setIncluded(cat.getId().equals(categoryId)); separateState[i]= cat.isSeparateCommand();
for (Iterator<CompletionProposalCategory> it= categories.iterator(); it.hasNext(); i++) { CompletionProposalCategory cat= it.next(); inclusionState[i]= cat.isIncluded(); cat.setIncluded(cat.getId().equals(categoryId)); separateState[i]= cat.isSeparateCommand();