public ContentAssistProcessor(ContentAssistant assistant, String partition) { Assert.isNotNull(partition); Assert.isNotNull(assistant); fPartition= partition; fComputerRegistry= CompletionProposalComputerRegistry.getDefault(); fCategories= fComputerRegistry.getProposalCategories(); fAssistant= assistant; fAssistant.addCompletionListener(new CompletionListener()); }
public ContentAssistProcessor(ContentAssistant assistant, String partition) { Assert.isNotNull(partition); Assert.isNotNull(assistant); fPartition= partition; fComputerRegistry= CompletionProposalComputerRegistry.getDefault(); fCategories= fComputerRegistry.getProposalCategories(); fAssistant= assistant; fAssistant.addCompletionListener(new CompletionListener()); }
fCategories= CompletionProposalComputerRegistry.getDefault().getProposalCategories(); fAssistant= assistant; fAssistant.addCompletionListener(new ICompletionListener() {
protected void setContentAssistProcessor(ContentAssistant assistant, SourceViewerConfiguration configuration, ISourceViewer sourceViewer) { if (contentAssistProcessor != null) { for(String contentType: configuration.getConfiguredContentTypes(sourceViewer)) { assistant.setContentAssistProcessor(contentAssistProcessor, contentType); } if (contentAssistProcessor instanceof ICompletionListener) { assistant.setRepeatedInvocationMode(true); assistant.setStatusLineVisible(true); assistant.addCompletionListener((ICompletionListener) contentAssistProcessor); } } }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (sourceViewer.isEditable() && fContentAssistant == null) { fContentAssistProcessor = new XMLContentAssistProcessor(fSourcePage); fContentAssistant = new ContentAssistant(); fContentAssistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); fContentAssistant.setContentAssistProcessor(fContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE); fContentAssistant.setContentAssistProcessor(fContentAssistProcessor, XMLPartitionScanner.XML_TAG); fContentAssistant.setInformationControlCreator(getInformationControlCreator(true)); fContentAssistant.setShowEmptyList(false); fContentAssistant.addCompletionListener(fContentAssistProcessor); fContentAssistant.enableAutoInsert(true); } return fContentAssistant; }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (fSourcePage != null && fSourcePage.isEditable()) { if (fContentAssistant == null) { fContentAssistant = new ContentAssistant(true); fContentAssistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); fContentAssistantProcessor = new ManifestContentAssistProcessor(fSourcePage); fContentAssistant.setContentAssistProcessor(fContentAssistantProcessor, IDocument.DEFAULT_CONTENT_TYPE); fContentAssistant.setContentAssistProcessor(fContentAssistantProcessor, ManifestPartitionScanner.MANIFEST_HEADER_VALUE); fContentAssistant.addCompletionListener(fContentAssistantProcessor); fContentAssistant.enableAutoInsert(true); fContentAssistant.setInformationControlCreator(parent -> new DefaultInformationControl(parent, false)); fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); } return fContentAssistant; } return null; }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ContentAssistant ca = new ContentAssistant(); JsonContentAssistProcessor processor = createContentAssistProcessor(ca); ca.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); ca.setInformationControlCreator(getInformationControlCreator(sourceViewer)); ca.enableAutoInsert(false); ca.enablePrefixCompletion(false); ca.enableAutoActivation(true); ca.setAutoActivationDelay(100); ca.enableColoredLabels(true); ca.setShowEmptyList(true); ca.setRepeatedInvocationMode(true); ca.addCompletionListener(processor); ca.setStatusLineVisible(true); return ca; }
fContentAssistant.setStatusLineVisible(true); fContentAssistant.setShowEmptyList(true); fContentAssistant.addCompletionListener(processor); return fContentAssistant;