Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.ITextHover


        }

        final ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;

        // does a text hover exist?
        final ITextHover textHover = textViewerExtension2.getCurrentTextHover();
        if (textHover == null) {
            // TODO this crashes... why?
            // fTextOperationAction.run();
            return;
        }

        final Point hoverEventLocation = textViewerExtension2.getHoverEventLocation();
        final int offset = computeOffsetAtLocation(sourceViewer, hoverEventLocation.x,
                hoverEventLocation.y);
        if (offset == -1) {
            fTextOperationAction.run();
            return;
        }

        try {
            // get the text hover content
            final String contentType = TextUtilities.getContentType(
                    sourceViewer.getDocument(), IErlangPartitions.ERLANG_PARTITIONING,
                    offset, true);

            final IRegion hoverRegion = textHover.getHoverRegion(sourceViewer, offset);
            if (hoverRegion == null) {
                return;
            }

            final String hoverInfo = "";
View Full Code Here


          return;
      }

      if (sourceViewer instanceof ITextViewerExtension2) {
        // does a text hover exist?
        ITextHover textHover= ((ITextViewerExtension2) sourceViewer).getCurrentTextHover();
        if (textHover != null && makeTextHoverFocusable(sourceViewer, textHover))
          return;
      }

      if (sourceViewer instanceof ISourceViewerExtension3) {
View Full Code Here

   *             <code>documentationTextHover</code> element in the
   *             <code>org.eclipse.wst.sse.ui.editorConfiguration</code>
   *             extension point
   */
  protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
    ITextHover bestMatchHover = new BestMatchHover(createDocumentationHovers(partitionType));
    return new TextHoverInformationProvider(bestMatchHover);
  }
View Full Code Here

    ITextHover[] hovers = (ITextHover[]) extendedTextHover.toArray(new ITextHover[extendedTextHover.size()]);
    return hovers;
  }

  public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
    ITextHover textHover = null;

    /*
     * Returns a default problem, annotation, and best match hover
     * depending on stateMask
     */
 
View Full Code Here

   *             <code>documentationTextHover</code> element in the
   *             <code>org.eclipse.wst.sse.ui.editorConfiguration</code>
   *             extension point
   */
  protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
    ITextHover bestMatchHover = new BestMatchHover(partitionType);
    return new TextHoverInformationProvider(bestMatchHover);
  }
View Full Code Here

    ITextHover[] hovers = (ITextHover[]) extendedTextHover.toArray(new ITextHover[extendedTextHover.size()]);
    return hovers;
  }

  public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
    ITextHover textHover = null;

    /*
     * Returns a default problem, annotation, and best match hover
     * depending on stateMask
     */
 
View Full Code Here

        int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t);

        if (stateMasks != null) {
          for (int j = 0; j < stateMasks.length; j++) {
            int stateMask = stateMasks[j];
            ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask);
            ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask);
          }
        }
        else {
          ITextHover textHover = configuration.getTextHover(sourceViewer, t);
          ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
        }
      }
      else
        sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t);
View Full Code Here

    // either had no best match hover or best match hover returned null
    if (displayText == null) {
      // go through list of text hovers and return first display string
      Iterator i = getTextHovers().iterator();
      while ((i.hasNext()) && (displayText == null)) {
        ITextHover hover = (ITextHover) i.next();
        displayText = hover.getHoverInfo(viewer, hoverRegion);
      }
    }
    return displayText;
  }
View Full Code Here

   */
  public IRegion getHoverRegion(ITextViewer viewer, int offset) {
    IRegion hoverRegion = null;

    // go through list of text hovers and return first hover region
    ITextHover hover = null;
    Iterator i = getTextHovers().iterator();
    while ((i.hasNext()) && (hoverRegion == null)) {
      hover = (ITextHover) i.next();
      hoverRegion = hover.getHoverRegion(viewer, offset);
    }

    // store the text hover processor that found region
    if (hoverRegion != null)
      fBestMatchHover = hover;
View Full Code Here

        int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t);

        if (stateMasks != null) {
          for (int j = 0; j < stateMasks.length; j++) {
            int stateMask = stateMasks[j];
            ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask);
            ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask);
          }
        }
        else {
          ITextHover textHover = configuration.getTextHover(sourceViewer, t);
          ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
        }
      }
      else
        sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t);
View Full Code Here

TOP

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

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.