Examples of IContentAssistProcessor


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

    if (isFirstPage() && getLegacyExtendedContentAssistProcessors() != null &&
        !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

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

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

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

   */
  public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
    fErrorMessage = null;
    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 {
          if (fErrorMessage == null && ret.isEmpty()) {
            String errorMessage = p.getErrorMessage();
            if (errorMessage != null) {
              fErrorMessage = errorMessage;
            }
          }
        }
View Full Code Here

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

   */
  public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
    fErrorMessage = null;
    List ret = new LinkedList();
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      IContextInformation[] informations = p.computeContextInformation(viewer, documentOffset);
      if (informations != null && informations.length > 0) {
        for (int i = 0; i < informations.length; i++)
          ret.add(new WrappedContextInformation(informations[i], p));
        fErrorMessage = null; // Hide previous errors
      } else {
        if (fErrorMessage == null && ret.isEmpty()) {
          String errorMessage = p.getErrorMessage();
          if (errorMessage != null) {
            fErrorMessage = errorMessage;
          }
        }
      }
View Full Code Here

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

   * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
   */
  public char[] getCompletionProposalAutoActivationCharacters() {
    Set ret = new LinkedHashSet();
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      char[] chars = p.getCompletionProposalAutoActivationCharacters();
      if (chars != null)
        for (int i = 0; i < chars.length; i++)
          ret.add(new Character(chars[i]));
    }

View Full Code Here

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

   * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
   */
  public char[] getContextInformationAutoActivationCharacters() {
    Set ret = new LinkedHashSet();
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      char[] chars = p.getContextInformationAutoActivationCharacters();
      if (chars != null)
        for (int i = 0; i < chars.length; i++)
          ret.add(new Character(chars[i]));
    }

View Full Code Here

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

    boolean hasPresenter = false;
    boolean hasExtension = false;

    Iterator itp = fProcessors.iterator();
    while (itp.hasNext() && (!hasPresenter || !hasExtension)) {
      IContentAssistProcessor p = (IContentAssistProcessor) itp.next();
      IContextInformationValidator v = p.getContextInformationValidator();
      if (v != null) {
        hasValidator = true;
        if (v instanceof IContextInformationPresenter) {
          hasPresenter = true;
        }
        if (v instanceof ISubjectControlContextInformationPresenter || v instanceof ISubjectControlContextInformationValidator) {
          hasExtension = true;
        }
      }
    }

    CompoundContentAssistValidator validator = null;
    if (hasPresenter && hasExtension)
      validator = new CompoundContentAssistValidatorPresenterEx();
    else if (hasPresenter)
      validator = new CompoundContentAssistValidatorPresenter();
    else if (hasExtension)
      validator = new CompoundContentAssistValidatorEx();
    else if (hasValidator)
      validator = new CompoundContentAssistValidator();

    if (validator != null)
      for (Iterator it = fProcessors.iterator(); it.hasNext();) {
        IContentAssistProcessor p = (IContentAssistProcessor) it.next();
        IContextInformationValidator v = p.getContextInformationValidator();
        if (v != null)
          validator.add(v);
      }

    return validator;
View Full Code Here

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

    this.release();
  }
 
  public void install(ITextViewer viewer) {
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      if (p instanceof StructuredContentAssistProcessor) {
        ((StructuredContentAssistProcessor) p).install(viewer);
      }
    }
  }
View Full Code Here

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

   * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
   */
  public void release() {
    // go through list of content assist processors and dispose
    for (Iterator it = fProcessors.iterator(); it.hasNext();) {
      IContentAssistProcessor p = (IContentAssistProcessor) it.next();
      if (p instanceof IReleasable) {
        ((IReleasable) p).release();
      }
    }
  }
View Full Code Here

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

  /*
   * @see org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML#initPartitionToProcessorMap()
   */
  protected void initPartitionToProcessorMap() {
    super.initPartitionToProcessorMap();
    IContentAssistProcessor jspContentAssistProcessor = new JSPContentAssistProcessor();

    // JSP
    addPartitionProcessor(IStructuredPartitions.DEFAULT_PARTITION, jspContentAssistProcessor);
    addPartitionProcessor(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor);
    addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, jspContentAssistProcessor);
    addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, jspContentAssistProcessor);
    addPartitionProcessor(IJSPPartitions.JSP_DEFAULT, jspContentAssistProcessor);
    addPartitionProcessor(IJSPPartitions.JSP_DIRECTIVE, jspContentAssistProcessor);
    addPartitionProcessor(IJSPPartitions.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
    addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);

    IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor();
    addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor);

  }
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.