Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.IContentAssistProcessor.computeCompletionProposals()


        final MockSourceViewer sourceViewer = new MockSourceViewer(document, offset);
        final IContentAssistProcessor p = inStrings ? new ErlStringContentAssistProcessor(
                sourceViewer, module, project, null) : new ErlContentAssistProcessor(
                sourceViewer, module, project, null);
        final ICompletionProposal[] completionProposals = p.computeCompletionProposals(
                sourceViewer, offset);

        MatcherAssert.assertThat(ListExtensions.map(
                Lists.newArrayList(completionProposals),
                new Functions.Function1<ICompletionProposal, String>() {
View Full Code Here


        !getLegacyExtendedContentAssistProcessors().isEmpty()) {
     
      Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
      while (iter.hasNext()) {
        IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
        ICompletionProposal[] legacyComputed = legacyProcessor.computeCompletionProposals(viewer, offset);
        if (legacyComputed != null) {
          proposals.addAll(Arrays.asList(legacyComputed));
        }
      }
    }
View Full Code Here

      }
    }

    IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
    if (p != null) {
      embeddedResults = p.computeCompletionProposals(viewer, documentPosition);
      // get bean methods, objects, and constants if there are any...
      if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
        ICompletionProposal[] beanResults = getJSPJavaBeanProposals(viewer, documentPosition);
        if (beanResults != null && beanResults.length > 0) {
          ICompletionProposal[] added = new ICompletionProposal[beanResults.length + embeddedResults.length];
View Full Code Here

   * @return ICompletionProposal[]
   */
  private ICompletionProposal[] getHTMLCompletionProposals(ITextViewer viewer, int documentPosition) {

    IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
    return p.computeCompletionProposals(viewer, documentPosition);
  }

  /**
   *
   * @param viewer
View Full Code Here

        !getLegacyExtendedContentAssistProcessors().isEmpty()) {
     
      Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
      while (iter.hasNext()) {
        IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
        ICompletionProposal[] legacyComputed = legacyProcessor.computeCompletionProposals(viewer, offset);
        if (legacyComputed != null) {
          proposals.addAll(Arrays.asList(legacyComputed));
        }
      }
    }
View Full Code Here

    List ret = new LinkedList();
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      try {
        // isolate calls to each processor
        ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
        if (proposals != null && proposals.length > 0) {
          ret.addAll(Arrays.asList(proposals));
          fErrorMessage = null; // Hide previous errors
        }
        else {
View Full Code Here

    IContentAssistProcessor p = null;
    ICompletionProposal[] results = EMPTY_PROPOSAL_SET;

    p = guessContentAssistProcessor(viewer, documentOffset);
    if (p != null) {
      results = p.computeCompletionProposals(viewer, documentOffset);
    }

    return (results != null) ? results : EMPTY_PROPOSAL_SET;
  }
View Full Code Here

      viewer.setDocument(model.getStructuredDocument());
      // note: non-zero length can break html completion.
      viewer.setSelectedRange(offset, 0);

      ICompletionProposal[] proposals =
        processor.computeCompletionProposals(viewer, offset);
      model.releaseFromRead();
      return proposals;
    }
    return new ICompletionProposal[0];
  }
View Full Code Here

      getContentAssistProcessor(commandLine, project, file);

    ITextViewer viewer = getTextViewer(commandLine, project, file);

    if (processor != null && viewer != null){
      return processor.computeCompletionProposals(viewer, offset);
    }
    return new ICompletionProposal[0];
  }

  /**
 
View Full Code Here

      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

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.