Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IWidgetTokenOwner


      case PROPOSAL_SELECTOR:
        if (fContentAssistSubjectControl instanceof IWidgetTokenOwnerExtension) {
          IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
          return extension.requestWidgetToken(this, WIDGET_PRIORITY);
        } else if (fContentAssistSubjectControl instanceof IWidgetTokenOwner) {
          IWidgetTokenOwner owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
          return owner.requestWidgetToken(this);
        } else if (fViewer instanceof IWidgetTokenOwnerExtension) {
          IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fViewer;
          return extension.requestWidgetToken(this, WIDGET_PRIORITY);
        } else if (fViewer instanceof IWidgetTokenOwner) {
          IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
          return owner.requestWidgetToken(this);
        }
    }
    return true;
  }
View Full Code Here


   * @param type the listener type
   * @since 2.0
   */
  private void releaseWidgetToken(int type) {
    if (fListeners[CONTEXT_SELECTOR] == null && fListeners[PROPOSAL_SELECTOR] == null) {
      IWidgetTokenOwner owner= null;
      if (fContentAssistSubjectControl instanceof IWidgetTokenOwner)
        owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
      else if (fViewer instanceof IWidgetTokenOwner)
        owner= (IWidgetTokenOwner) fViewer;
      if (owner != null)
        owner.releaseWidgetToken(this);
    }
  }
View Full Code Here

    if (fTextViewer instanceof IWidgetTokenOwnerExtension && fTextViewer instanceof IWidgetTokenOwner) {
      IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fTextViewer;
      if (extension.requestWidgetToken(this, WIDGET_PRIORITY))
        super.showInformationControl(subjectArea);
    } else if (fTextViewer instanceof IWidgetTokenOwner) {
      IWidgetTokenOwner owner= (IWidgetTokenOwner) fTextViewer;
      if (owner.requestWidgetToken(this))
        super.showInformationControl(subjectArea);

    } else
      super.showInformationControl(subjectArea);
  }
View Full Code Here

  protected void hideInformationControl() {
    try {
      super.hideInformationControl();
    } finally {
      if (fTextViewer instanceof IWidgetTokenOwner) {
        IWidgetTokenOwner owner= (IWidgetTokenOwner) fTextViewer;
        owner.releaseWidgetToken(this);
      }
    }
  }
View Full Code Here

  protected void handleInformationControlDisposed() {
    try {
      super.handleInformationControlDisposed();
    } finally {
      if (fTextViewer instanceof IWidgetTokenOwner) {
        IWidgetTokenOwner owner= (IWidgetTokenOwner) fTextViewer;
        owner.releaseWidgetToken(this);
      }
    }
  }
View Full Code Here

  private boolean acquireWidgetToken(int type) {
    switch (type) {
      case CONTEXT_SELECTOR:
      case PROPOSAL_SELECTOR:
        if (fViewer instanceof IWidgetTokenOwner) {
          IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
          return owner.requestWidgetToken(this);
        } else if (fViewer instanceof IWidgetTokenOwnerExtension)  {
          IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fViewer;
          return extension.requestWidgetToken(this, WIDGET_PRIORITY);
        }
    }
View Full Code Here

   * @since 2.0
   */
  private void releaseWidgetToken(int type) {
    if (fListeners[CONTEXT_SELECTOR] == null && fListeners[PROPOSAL_SELECTOR] == null) {
      if (fViewer instanceof IWidgetTokenOwner) {
        IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
        owner.releaseWidgetToken(this);
      }
    }
  }
View Full Code Here

      case PROPOSAL_SELECTOR:
        if (fContentAssistSubjectControl instanceof IWidgetTokenOwnerExtension) {
          IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
          return extension.requestWidgetToken(this, WIDGET_PRIORITY);
        } else if (fContentAssistSubjectControl instanceof IWidgetTokenOwner) {
          IWidgetTokenOwner owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
          return owner.requestWidgetToken(this);
        } else if (fViewer instanceof IWidgetTokenOwnerExtension) {
          IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fViewer;
          return extension.requestWidgetToken(this, WIDGET_PRIORITY);
        } else if (fViewer instanceof IWidgetTokenOwner) {
          IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
          return owner.requestWidgetToken(this);
        }
    }
    return true;
  }
View Full Code Here

   * @param type the listener type
   * @since 2.0
   */
  private void releaseWidgetToken(int type) {
    if (fListeners[CONTEXT_SELECTOR] == null && fListeners[PROPOSAL_SELECTOR] == null) {
      IWidgetTokenOwner owner= null;
      if (fContentAssistSubjectControl instanceof IWidgetTokenOwner)
        owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
      else if (fViewer instanceof IWidgetTokenOwner)
        owner= (IWidgetTokenOwner) fViewer;
      if (owner != null)
        owner.releaseWidgetToken(this);
    }
  }
View Full Code Here

            IWidgetTokenOwnerExtension extension = (IWidgetTokenOwnerExtension) fControl;
            if (extension.requestWidgetToken(this, WIDGET_PRIORITY)) {
                super.showInformationControl(subjectArea);
            }
        } else if (fControl instanceof IWidgetTokenOwner) {
            IWidgetTokenOwner owner = (IWidgetTokenOwner) fControl;
            if (owner.requestWidgetToken(this)) {
                super.showInformationControl(subjectArea);
            }

        } else {
            super.showInformationControl(subjectArea);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.IWidgetTokenOwner

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.