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.
|
String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has
not been set.
|
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 |
setToolTipText(String string)
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
void |
setUnderlined(boolean underlined)
Sets the underlined state.
|
protected String |
shortenText(GC gc,
String t,
int width) |
addHyperlinkListener, getHref, getSelection, handleActivate, handleEnter, handleExit, paint, removeHyperlinkListener, setEnabled, setHref
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
changed, checkSubclass, 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, 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, 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
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 String getToolTipText()
Control
getToolTipText
in class Control
public void setToolTipText(String string)
Control
The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
setToolTipText
in class Control
string
- the new tool tip text (or null)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)
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.