# Class HyperlinkLabel

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.help.ui.internal.HyperlinkLabel

All Implemented Interfaces:
  `Drawable`

public class HyperlinkLabel extends Canvas
A canvas holding a hyperlink label. Need this to deal with focus selection.

## Field Summary

### Fields inherited from class Control

`handle`

### Fields inherited from class Widget

`nativeZoom`

## Constructor Summary

Constructors
Constructor
Description
`HyperlinkLabel(Composite parent, int style)`
Constructor for Hyperlink.

## Method Summary

Modifier and Type
Method
Description
`void`
`addMouseListener(MouseListener l)`
Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the `MouseListener` interface.
`void`
`addMouseTrackListener(MouseTrackListener l)`
Adds the listener to the collection of listeners who will be notified when the mouse passes or hovers over controls, by sending it one of the messages defined in the `MouseTrackListener` interface.
`void`
`addPaintListener(PaintListener l)`
Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in the `PaintListener` interface.
`void`
`addSelectionListener(SelectionListener listener)`
`Point`
`computeSize(int wHint, int hHint, boolean changed)`
Returns the preferred size (in points) of the receiver.
`Label`
`getLabel()`
`boolean`
`getSelection()`
`protected void`
`paint(PaintEvent e)`
`void`
`removeSelectionListener(SelectionListener listener)`
`void`
`setBackground(Color c)`
Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void`
`setCursor(Cursor c)`
Sets the receiver's cursor to the cursor specified by the argument, or to the default cursor for that kind of control if the argument is null.
`void`
`setForeground(Color c)`
Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void`
`setText(String text)`

### Methods inherited from class Canvas

`drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME`

### Methods inherited from class Composite

`changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString`

### Methods inherited from class Scrollable

`computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode`

### Methods inherited from class Control

`addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseMoveListener, addMouseWheelListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getData, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setAutoscalingMode, setBackgroundImage, setBounds, setBounds, setCapture, setData, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

### Methods inherited from class Widget

`addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface Drawable

`isAutoScalable`

## Constructor Details

### HyperlinkLabel

public HyperlinkLabel(Composite parent, int style)
Constructor for Hyperlink.

## Method Details

### setText

public void setText(String text)

### getSelection

public boolean getSelection()

### getLabel

public Label getLabel()

### paint

protected void paint(PaintEvent e)

### addSelectionListener

public void addSelectionListener(SelectionListener listener)

### removeSelectionListener

public void removeSelectionListener(SelectionListener listener)

### computeSize

public Point computeSize(int wHint, int hHint, boolean changed)
Description copied from class: `Control`
Returns the preferred size (in points) of the receiver.

The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant `SWT.DEFAULT` is passed for the hint.

If the changed flag is `true`, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be `false`, so layout manager caches can be retained.

Overrides:
  `computeSize` in class `Control`
Parameters:
  `wHint` - the width hint (can be `SWT.DEFAULT`)
  `hHint` - the height hint (can be `SWT.DEFAULT`)
  `changed` - `true` if the control's contents have changed, and `false` otherwise
Returns:
  the preferred size of the control.
See Also:
  - `Layout`
  - `Control.getBorderWidth()`
  - `Control.getBounds()`
  - `Control.getSize()`
  - `Control.pack(boolean)`
  - "computeTrim, getClientArea for controls that implement them"

### addMouseListener

public void addMouseListener(MouseListener l)
Description copied from class: `Control`
Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the `MouseListener` interface.

Overrides:
  `addMouseListener` in class `Control`
Parameters:
  `l` - the listener which should be notified
See Also:
  - `MouseListener`
  - `Control.removeMouseListener(MouseListener)`

### addMouseTrackListener

public void addMouseTrackListener(MouseTrackListener l)
Description copied from class: `Control`
Adds the listener to the collection of listeners who will be notified when the mouse passes or hovers over controls, by sending it one of the messages defined in the `MouseTrackListener` interface.

Overrides:
  `addMouseTrackListener` in class `Control`
Parameters:
  `l` - the listener which should be notified
See Also:
  - `MouseTrackListener`
  - `Control.removeMouseTrackListener(MouseTrackListener)`

### addPaintListener

public void addPaintListener(PaintListener l)
Description copied from class: `Control`
Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in the `PaintListener` interface.

Overrides:
  `addPaintListener` in class `Control`
Parameters:
  `l` - the listener which should be notified
See Also:
  - `PaintListener`
  - `Control.removePaintListener(PaintListener)`

### setBackground

public void setBackground(Color c)
Description copied from class: `Control`
Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

Note: This operation is a hint and may be overridden by the platform.

Note: The background color can be overridden by setting a background image.

Overrides:
  `setBackground` in class `Control`
Parameters:
  `c` - the new color (or null)

### setForeground

public void setForeground(Color c)
Description copied from class: `Control`
Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.

Note: This operation is a hint and may be overridden by the platform.

Overrides:
  `setForeground` in class `Control`
Parameters:
  `c` - the new color (or null)

### setCursor

public void setCursor(Cursor c)
Description copied from class: `Control`
Sets the receiver's cursor to the cursor specified by the argument, or to the default cursor for that kind of control if the argument is null.

When the mouse pointer passes over a control its appearance is changed to match the control's cursor.

Overrides:
  `setCursor` in class `Control`
Parameters:
  `c` - the new cursor (or null)