org.eclipse.jface.text.contentassist.ICompletionProposalSorter Java Examples
The following examples show how to use
org.eclipse.jface.text.contentassist.ICompletionProposalSorter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TLASourceViewerConfiguration.java From tlaplus with MIT License | 6 votes |
/** * Content assistant */ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ContentAssistant assistant = new ContentAssistant(); assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); assistant.setContentAssistProcessor(new TLACompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(new PCalCompletionProcessor(), TLAPartitionScanner.TLA_PCAL); assistant.enableColoredLabels(true); assistant.enableAutoActivation(true); assistant.setAutoActivationDelay(500); assistant.setInformationControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(final Shell parent) { return new DefaultInformationControl(parent, (DefaultInformationControl.IInformationPresenter) null); } }); assistant.setSorter(new ICompletionProposalSorter() { public int compare(ICompletionProposal p1, ICompletionProposal p2) { return 0; } }); assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setContextInformationPopupBackground(TLAEditorActivator.getDefault().getTLAColorProvider().getColor( TLAColorProvider.CONTENT_ASSIST_BACKGROUND_KEY)); return assistant; }
Example #2
Source File: TypeScriptCompletionProcessor.java From typescript.java with MIT License | 5 votes |
public TypeScriptCompletionProcessor(ITextEditor editor, ContentAssistant assistant, String partition) { super(editor, assistant, partition); this.editor = editor; assistant.setSorter(new ICompletionProposalSorter() { @Override public int compare(ICompletionProposal p1, ICompletionProposal p2) { return RELEVANCE_SORTER.compare(p1, p2); } }); }