Examples of IContextInformationValidator


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

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

      IContextInformation realInfo = getContextInformation(info);
      if (fValidator != null)
        fValidator.install(realInfo, viewer, documentPosition);
      else {
        for (Iterator it = fValidators.iterator(); it.hasNext();) {
          IContextInformationValidator v = (IContextInformationValidator) it.next();
          v.install(realInfo, viewer, documentPosition);
        }
      }
    }
View Full Code Here

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

      boolean isValid = false;
      if (fValidator != null)
        isValid = fValidator.isContextInformationValid(documentPosition);
      else {
        for (Iterator it = fValidators.iterator(); it.hasNext();) {
          IContextInformationValidator v = (IContextInformationValidator) it.next();
          isValid |= v.isContextInformationValid(documentPosition);
        }
      }
      return isValid;
    }
View Full Code Here

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

      boolean presentationUpdated = false;
      if (fValidator instanceof IContextInformationPresenter)
        presentationUpdated = ((IContextInformationPresenter) fValidator).updatePresentation(offset, presentation);
      else {
        for (Iterator it = fValidators.iterator(); it.hasNext();) {
          IContextInformationValidator v = (IContextInformationValidator) it.next();
          if (v instanceof IContextInformationPresenter)
            presentationUpdated |= ((IContextInformationPresenter) v).updatePresentation(offset, presentation);
        }
      }
      return presentationUpdated;
View Full Code Here

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

   * @since 2.0
   */

  private void internalShowContextInfo(IContextInformation information, int offset) {

    IContextInformationValidator validator= fContentAssistant.getContextInformationValidator(fViewer, offset);

    if (validator != null) {
      ContextFrame current= new ContextFrame();
      current.fInformation= information;
      current.fBeginOffset= (information instanceof IContextInformationExtension) ? ((IContextInformationExtension) information).getContextInformationPosition() : offset;
View Full Code Here

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

   * @param offset a document offset
   * @return a presenter
   * @since 2.0
   */
  IContextInformationPresenter getContextInformationPresenter(ITextViewer textViewer, int offset) {
    IContextInformationValidator validator= getContextInformationValidator(textViewer, offset);
    if (validator instanceof IContextInformationPresenter)
      return (IContextInformationPresenter) validator;
    return null;
  }
View Full Code Here

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

    /**
     *
     * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
     */
    public IContextInformationValidator getContextInformationValidator() {
        return new IContextInformationValidator() {

            public void install(IContextInformation info, ITextViewer viewer, int offset) {
            }

            public boolean isContextInformationValid(int offset) {
View Full Code Here

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

    /**
     * @return the validator we should use
     */
    public IContextInformationValidator getContextInformationValidator() {
        final IContextInformationValidator defaultContextInformationValidator = defaultPythonProcessor
                .getContextInformationValidator();
        return new ContextInformationDelegator(defaultContextInformationValidator);
    }
View Full Code Here

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

   * @since 2.0
   */

  private void internalShowContextInfo(IContextInformation information, int offset) {

    IContextInformationValidator validator= fContentAssistant.getContextInformationValidator(fViewer, offset);

    if (validator != null) {
      ContextFrame current= new ContextFrame();
      current.fInformation= information;
      current.fBeginOffset= (information instanceof IContextInformationExtension) ? ((IContextInformationExtension) information).getContextInformationPosition() : offset;
View Full Code Here

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

   * @param offset a document offset
   * @return a presenter
   * @since 2.0
   */
  IContextInformationPresenter getContextInformationPresenter(ITextViewer textViewer, int offset) {
    IContextInformationValidator validator= getContextInformationValidator(textViewer, offset);
    if (validator instanceof IContextInformationPresenter)
      return (IContextInformationPresenter) validator;
    return null;
  }
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.