Package org.eclipse.jface.text.contentassist

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


  private List collectContextInformation(ITextViewer viewer, int offset, IProgressMonitor monitor) {
    List proposals= new ArrayList();
   
    List providers= getCategories();
    for (Iterator it= providers.iterator(); it.hasNext();) {
      IContentAssistProcessor cat= (IContentAssistProcessor) it.next();
      IContextInformation[] computed= cat.computeContextInformation(viewer,offset);
      proposals.addAll(arrayToCollection(computed));
      if (fErrorMessage == null)
        fErrorMessage= cat.getErrorMessage();
    }
   
    return proposals;
  }
View Full Code Here


    ca.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
    ca.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    ca.setContextInformationPopupBackground(colorManager.getColor(new RGB(150, 150, 0)));
    ca.setInformationControlCreator(getInformationControlCreator(sv));

    IContentAssistProcessor cap = getCompletionProcessor();
    ca.setContentAssistProcessor(cap, IDocument.DEFAULT_CONTENT_TYPE);
    // ca.setInformationControlCreator(getInformationControlCreator(sv));
    return ca;
  }
View Full Code Here

    protected IContentAssistProcessor getContentAssistProcessor(ISourceViewer sourceViewer, String contentType) {
        if (DjCssSourceConfiguration.DEFAULT.equals(contentType)) {
            return DjCssSourceConfiguration.getDefault().getContentAssistProcessor(getEditor(), contentType);
        }
        //Note: The HTMLSourceViewerConfiguration should get the CSS content assist based on the content type.
        IContentAssistProcessor cssContentAssistProcessor = CSSSourceConfiguration.getDefault()
                .getContentAssistProcessor(getEditor(), contentType);
        if (CSSSourceConfiguration.DEFAULT.equals(contentType) || IDocument.DEFAULT_CONTENT_TYPE.equals(contentType)) {
            return new DjContentAssistProcessor(contentType, cssContentAssistProcessor);
        }
        return cssContentAssistProcessor;
View Full Code Here

    @Override
    protected IContentAssistProcessor getContentAssistProcessor(ISourceViewer sourceViewer, String contentType) {
        if (DjHtmlSourceConfiguration.DEFAULT.equals(contentType)) {
            return DjHtmlSourceConfiguration.getDefault().getContentAssistProcessor(getEditor(), contentType);
        }
        IContentAssistProcessor htmlContentAssistProcessor = HTMLSourceConfiguration.getDefault()
                .getContentAssistProcessor(getEditor(), contentType);
        if (HTMLSourceConfiguration.DEFAULT.equals(contentType) || IDocument.DEFAULT_CONTENT_TYPE.equals(contentType)) {
            return new DjContentAssistProcessor(contentType, htmlContentAssistProcessor);
        }
        return htmlContentAssistProcessor;
View Full Code Here

    }

    @Override
    protected SourceViewerConfiguration createSourceViewerConfiguration() {
        PyContentAssistant contentAssist = new PyContentAssistant();
        IContentAssistProcessor processor = createConsoleCompletionProcessor(contentAssist);
        contentAssist.setContentAssistProcessor(processor, JSScriptConsoleSourceViewerConfiguration.PARTITION_TYPE);

        contentAssist.enableAutoActivation(true);
        contentAssist.enableAutoInsert(false);
        contentAssist.setAutoActivationDelay(PyCodeCompletionPreferencesPage.getAutocompleteDelay());
View Full Code Here

    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);
    }
    return new ICompletionProposal[0];
  }
View Full Code Here

     */
    public IContentAssistant getContentAssistant( ISourceViewer sourceViewer )
    {
        //        ContentAssistant assistant = new ContentAssistant();
        ContentAssistant assistant = new DialogContentAssistant();
        IContentAssistProcessor aciContentAssistProcessor = new ACIContentAssistProcessor();

        assistant.setContentAssistProcessor( aciContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
        assistant.setDocumentPartitioning( "org.apache.directory.ldapstudio.aci" );
        assistant.enableAutoActivation( true );
        assistant.setAutoActivationDelay( 500 );
View Full Code Here

    @Override
    public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

        ContentAssistant ca = new ContentAssistant();
        IContentAssistProcessor pr = new ScenarioCompletionProcessor(scenarioAnnotationSearch);
        ca.setContentAssistProcessor(pr, CucumberPartitionScanner.SCENARIO);
        ca.setContentAssistProcessor(pr, IDocument.DEFAULT_CONTENT_TYPE);
        ca.setInformationControlCreator(getInformationControlCreator(sourceViewer));
        return ca;
    }
View Full Code Here

        for (int i = 0; i < elements.length; i++) {
            IConfigurationElement element = elements[i];
            if (element.getName().equals("processor")) { //$NON-NLS-1$
                ElementCreationProxy ecProxy = new ElementCreationProxy(
                        element, processorsExtensionName);
                IContentAssistProcessor processor = (IContentAssistProcessor) ecProxy
                        .getObject();
                if (processor != null) {
                    processors.add(processor);
                }
            }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.contentassist.IContentAssistProcessor

Copyright © 2018 www.massapicom. 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.