public class Hyperlink extends AbstractHyperlink
Hyperlink can be extended.
HyperlinkGroup
marginHeight, marginWidth
Constructor and Description |
---|
Hyperlink(Composite parent,
int style)
Creates a new hyperlink control in the provided parent.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addHyperlinkListener, getHref, getSelection, handleActivate, handleEnter, handleExit, paint, removeHyperlinkListener, setHref
drawBackground, getCaret, scroll, setCaret, setFont
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
public Hyperlink(Composite parent, int style)
parent
- the control parentstyle
- the widget styleprotected void initAccessible()
public void setUnderlined(boolean underlined)
underlined
- if true , a line will be drawn below the text for
each wrapped line.public boolean isUnderlined()
public Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class Composite
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
otherwiseLayout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public String getText()
getText
in class AbstractHyperlink
public void setText(String text)
text
- the hyperlink textprotected void paintHyperlink(GC gc)
paintHyperlink
in class AbstractHyperlink
gc
- graphic contextprotected void paintText(GC gc, Rectangle bounds)
gc
- graphic contextbounds
- the bounding rectangle in which to paint the textprotected Point computeTextSize(int wHint, int hHint)
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.