Examples of IHyperlinkSegment


Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

      return;
    IFocusSelectable current = model.getSelectedSegment();
    // If the model and the control match, all is well
    if (current == cs)
      return;
    IHyperlinkSegment oldLink = null;
    if (current != null && current instanceof IHyperlinkSegment) {
      oldLink = (IHyperlinkSegment) current;
      exitLink(oldLink, SWT.NULL);
    }
    if (DEBUG_FOCUS)
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

   * @return href of the selected hyperlink or <code>null</code> if none
   *         selected.
   * @since 3.1
   */
  public Object getSelectedLinkHref() {
    IHyperlinkSegment link = getSelectedLink();
    return link != null ? link.getHref() : null;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

   * @return text of the selected hyperlink or <code>null</code> if none
   *         selected.
   * @since 3.1
   */
  public String getSelectedLinkText() {
    IHyperlinkSegment link = getSelectedLink();
    return link != null ? link.getText() : null;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

        if (e.childID == ACC.CHILDID_SELF)
          e.result = model.getAccessibleText();
        else {
          int linkCount = model.getHyperlinkCount();
          if (e.childID >= 0 && e.childID < linkCount) {
            IHyperlinkSegment link = model.getHyperlink(e.childID);
            e.result = link.getText();
          }
        }
      }

      public void getHelp(AccessibleEvent e) {
        e.result = getToolTipText();
        int linkCount = model.getHyperlinkCount();
        if (e.result == null && e.childID >= 0 && e.childID < linkCount) {
          IHyperlinkSegment link = model.getHyperlink(e.childID);
          e.result = link.getText();
        }
      }
    });
    accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
      public void getChildAtPoint(AccessibleControlEvent e) {
        Point pt = toControl(new Point(e.x, e.y));
        IHyperlinkSegment link = model.findHyperlinkAt(pt.x, pt.y);
        if (link != null)
          e.childID = model.indexOf(link);
        else
          e.childID = ACC.CHILDID_SELF;
      }

      public void getLocation(AccessibleControlEvent e) {
        Rectangle location = null;
        if (e.childID != ACC.CHILDID_SELF
            && e.childID != ACC.CHILDID_NONE) {
          int index = e.childID;
          IHyperlinkSegment link = model.getHyperlink(index);
          if (link != null) {
            location = link.getBounds();
          }
        }
        if (location == null) {
          location = getBounds();
        }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

  }

  private void computeSelection() {
    GC gc = new GC(this);
    Paragraph[] paragraphs = model.getParagraphs();
    IHyperlinkSegment selectedLink = getSelectedLink();
    if (getDisplay().getFocusControl() != this)
      selectedLink = null;
    for (int i = 0; i < paragraphs.length; i++) {
      Paragraph p = paragraphs[i];
      if (i > 0)
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

    if (DEBUG_FOCUS)
      System.out.println("FormText: mouse click(" + down + ")"); //$NON-NLS-1$ //$NON-NLS-2$
    if (down) {
      // select a hyperlink
      mouseFocus = true;
      IHyperlinkSegment segmentUnder = model.findHyperlinkAt(e.x, e.y);
      if (segmentUnder != null) {
        IHyperlinkSegment oldLink = getSelectedLink();
        if (getDisplay().getFocusControl() != this) {
          setFocus();
        }
        model.selectLink(segmentUnder);
        enterLink(segmentUnder, e.stateMask);
        paintFocusTransfer(oldLink, segmentUnder);
      }
      if (e.button == 1) {
        startSelection(e);
        armed = segmentUnder;
      }
      else {
      }
    } else {
      if (e.button == 1) {
        endSelection(e);
        IHyperlinkSegment segmentUnder = model
            .findHyperlinkAt(e.x, e.y);
        if (segmentUnder != null && armed == segmentUnder && selData == null) {
          activateLink(segmentUnder, e.stateMask);
          armed = null;
        }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

        entered = null;
      }
      setCursor(null);
    } else {
      if (segmentUnder instanceof IHyperlinkSegment) {
        IHyperlinkSegment linkUnder = (IHyperlinkSegment) segmentUnder;
        if (entered!=null && linkUnder!=entered) {
          // Special case: links are so close that there are 0 pixels between.
          // Must exit the link before entering the next one.
          exitLink(entered, e.stateMask);
          paintLinkHover(entered, false);
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

      newSegment = model.getSelectedSegment();
      if (newSegment == null)
        break;
      valid = setControlFocus(next, newSegment);
    }
    IHyperlinkSegment newLink = newSegment instanceof IHyperlinkSegment ? (IHyperlinkSegment) newSegment
        : null;
    if (valid)
      enterLink(newLink, SWT.NULL);
    IHyperlinkSegment oldLink = current instanceof IHyperlinkSegment ? (IHyperlinkSegment) current
        : null;
    if (oldLink != null || newLink != null)
      paintFocusTransfer(oldLink, newLink);
    if (newLink != null)
      ensureVisible(newLink);
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

        selData, null);
    gc.dispose();
  }

  private void activateSelectedLink() {
    IHyperlinkSegment link = getSelectedLink();
    if (link != null)
      activateLink(link, SWT.NULL);
  }
View Full Code Here

Examples of org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment

    textGC.setFont(getFont());
    textGC.fillRectangle(0, 0, width, height);
    Rectangle repaintRegion = new Rectangle(x, y, width, height);

    Paragraph[] paragraphs = model.getParagraphs();
    IHyperlinkSegment selectedLink = getSelectedLink();
    if (getDisplay().getFocusControl() != this)
      selectedLink = null;
    for (int i = 0; i < paragraphs.length; i++) {
      Paragraph p = paragraphs[i];
      p
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.