Examples of IContentAssistant


Examples of org.eclipse.jface.text.contentassist.IContentAssistant

    /**
     * Requests proposals in the last location of the given editor.
     */
    protected ICompletionProposal[] requestProposals(String mod1Contents, PyEdit editor) {
        editor.setSelection(mod1Contents.length(), 0);
        IContentAssistant contentAssistant = editor.getEditConfiguration().getContentAssistant(
                editor.getPySourceViewer());
        SimpleAssistProcessor processor = (SimpleAssistProcessor) contentAssistant
                .getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE);
        processor.doCycle(); //we want to show the default completions in this case (not the simple ones)
        ICompletionProposal[] props = processor.computeCompletionProposals(editor.getPySourceViewer(),
                mod1Contents.length());
        return props;
View Full Code Here

Examples of org.eclipse.jface.text.contentassist.IContentAssistant

    XtextSourceViewerConfiguration configuration = configurationProvider
        .get();
    ISourceViewer sourceViewer = getSourceViewer(xtextDocument,
        configuration);
    IContentAssistant contentAssistant = configuration
        .getContentAssistant(sourceViewer);
    String contentType;
    try {
      contentType = xtextDocument.getContentType(cursorPosition);
    } catch (BadLocationException e) {
      return new ICompletionProposal[0];
    }
    IContentAssistProcessor processor = contentAssistant
        .getContentAssistProcessor(contentType);
    if (processor != null) {
      return processor.computeCompletionProposals(sourceViewer,
          cursorPosition);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.