Class HyperlinkLabel

All Implemented Interfaces:
Drawable

public class HyperlinkLabel extends Canvas
A canvas holding a hyperlink label. Need this to deal with focus selection.
  • 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:
    • 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:
    • 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:
    • 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:
    • 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.

      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)