public abstract class AbstractHyperlink extends Canvas
Modifier and Type | Field and Description |
---|---|
protected int |
marginHeight
Amount of the margin height around the hyperlink (default is 1).
|
protected int |
marginWidth
Amount of the margin width around the hyperlink (default is 1).
|
Constructor and Description |
---|
AbstractHyperlink(Composite parent,
int style)
Creates a new hyperlink in the provided parent.
|
Modifier and Type | Method and Description |
---|---|
void |
addHyperlinkListener(IHyperlinkListener listener)
Adds the event listener to this hyperlink.
|
Object |
getHref()
Returns the object associated with this hyperlink.
|
boolean |
getSelection()
Returns the selection state of the control.
|
String |
getText()
Returns the textual representation of this hyperlink suitable for showing
in tool tips or on the status line.
|
protected void |
handleActivate(Event e)
Called when hyperlink has been activated.
|
protected void |
handleEnter(Event e)
Called when hyperlink is entered.
|
protected void |
handleExit(Event e)
Called when hyperlink is exited.
|
protected void |
paint(PaintEvent e)
Paints the control as a reaction to the provided paint event.
|
protected abstract void |
paintHyperlink(GC gc)
Paints the hyperlink as a reaction to the provided paint event.
|
void |
removeHyperlinkListener(IHyperlinkListener listener)
Removes the event listener from this hyperlink.
|
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is
true ,
and disables it otherwise. |
void |
setHref(Object href)
Sets the object associated with this hyperlink.
|
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
protected int marginWidth
protected int marginHeight
public AbstractHyperlink(Composite parent, int style)
parent
- the control parentstyle
- the widget stylepublic void addHyperlinkListener(IHyperlinkListener listener)
listener
- the event listener to addpublic void removeHyperlinkListener(IHyperlinkListener listener)
listener
- the event listener to removepublic boolean getSelection()
true
if the widget has focus, false
otherwise.protected void handleEnter(Event e)
protected void handleExit(Event e)
protected void handleActivate(Event e)
public void setHref(Object href)
href
- the hyperlink object referencepublic Object getHref()
setHref(java.lang.Object)
public String getText()
protected abstract void paintHyperlink(GC gc)
gc
- graphic contextprotected void paint(PaintEvent e)
e
- the paint eventpublic void setEnabled(boolean enabled)
Control
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.setEnabled
in class Control
enabled
- the new enabled state
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.