Eclipse Platform
Release 3.1

org.eclipse.ui.forms.widgets
Class Hyperlink

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended byorg.eclipse.ui.forms.widgets.AbstractHyperlink
                          extended byorg.eclipse.ui.forms.widgets.Hyperlink
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
ImageHyperlink

public class Hyperlink
extends AbstractHyperlink

Hyperlink is a concrete implementation of the abstract base class that draws text in the client area. Text can be wrapped and underlined. Hyperlink is typically added to the hyperlink group so that certain properties are managed for all the hyperlinks that belong to it.

Hyperlink can be extended.

Since:
3.0
See Also:
HyperlinkGroup

Field Summary
 
Fields inherited from class org.eclipse.ui.forms.widgets.AbstractHyperlink
marginHeight, marginWidth
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
Hyperlink(Composite parent, int style)
          Creates a new hyperlink control in the provided parent.
 
Method Summary
 Point computeSize(int wHint, int hHint, boolean changed)
          Overrides the parent by incorporating the margin.
protected  Point computeTextSize(int wHint, int hHint)
           
 String getText()
          Returns the current hyperlink text.
protected  void initAccessible()
           
 boolean isUnderlined()
          Returns the underline state of the hyperlink.
protected  void paintHyperlink(GC gc)
          Paints the hyperlink text.
protected  void paintText(GC gc, Rectangle bounds)
          Paints the hyperlink text in provided bounding rectangle.
 void setText(String text)
          Sets the text of this hyperlink.
 void setUnderlined(boolean underlined)
          Sets the underlined state.
 
Methods inherited from class org.eclipse.ui.forms.widgets.AbstractHyperlink
addHyperlinkListener, getHref, getSelection, handleActivate, handleEnter, handleExit, paint, removeHyperlinkListener, setHref
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hyperlink

public Hyperlink(Composite parent,
                 int style)
Creates a new hyperlink control in the provided parent.

Parameters:
parent - the control parent
style - the widget style
Method Detail

initAccessible

protected void initAccessible()

setUnderlined

public void setUnderlined(boolean underlined)
Sets the underlined state. It is not necessary to call this method when in a hyperlink group.

Parameters:
underlined - if true , a line will be drawn below the text for each wrapped line.

isUnderlined

public boolean isUnderlined()
Returns the underline state of the hyperlink.

Returns:
true if text is underlined, false otherwise.

computeSize

public Point computeSize(int wHint,
                         int hHint,
                         boolean changed)
Overrides the parent by incorporating the margin.

Overrides:
computeSize in class Composite

getText

public String getText()
Returns the current hyperlink text.

Overrides:
getText in class AbstractHyperlink
Returns:
hyperlink text

setText

public void setText(String text)
Sets the text of this hyperlink.

Parameters:
text - the hyperlink text

paintHyperlink

protected void paintHyperlink(GC gc)
Paints the hyperlink text.

Specified by:
paintHyperlink in class AbstractHyperlink
Parameters:
gc - graphic context

paintText

protected void paintText(GC gc,
                         Rectangle bounds)
Paints the hyperlink text in provided bounding rectangle.

Parameters:
gc - graphic context
bounds - the bounding rectangle in which to paint the text

computeTextSize

protected Point computeTextSize(int wHint,
                                int hHint)

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.