Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.forms.widgets
Class Hyperlink

java.lang.Object
  extended by 

org.eclipse.swt.widgets.Widget
      extended by 

org.eclipse.swt.widgets.Control
          extended by 

org.eclipse.swt.widgets.Scrollable
              extended by 

org.eclipse.swt.widgets.Composite
                  extended by 

org.eclipse.swt.widgets.Canvas
                      extended by 

org.eclipse.ui.forms.widgets.AbstractHyperlink
                          extended by 
org.eclipse.ui.forms.widgets.Hyperlink
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
ImageHyperlink

public class Hyperlink
extends AbstractHyperlink

Hyperlink is a concrete implementation of the abstract base class that draws text in the client area. Text can be wrapped and underlined. Hyperlink is typically added to the hyperlink group so that certain properties are managed for all the hyperlinks that belong to it.

Hyperlink can be extended.

Styles:
SWT.WRAP

Since:
3.0
See Also:
HyperlinkGroup

Field Summary
 
Fields inherited from class org.eclipse.ui.forms.widgets. AbstractHyperlink
marginHeight, marginWidth
 
Fields inherited from class org.eclipse.swt.widgets. Control
handle
 
Constructor Summary
Hyperlink ( Composite parent, int style)
          Creates a new hyperlink control in the provided parent.
 
Method Summary
  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)
           
 
Methods inherited from class org.eclipse.ui.forms.widgets. AbstractHyperlink
addHyperlinkListener, getHref, getSelection, handleActivate, handleEnter, handleExit, paint, removeHyperlinkListener, setEnabled, setHref
 
Methods inherited from class org.eclipse.swt.widgets. Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
 
Methods inherited from class org.eclipse.swt.widgets. Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets. Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets. Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets. Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hyperlink

public Hyperlink(
Composite parent,
                 int style)
Creates a new hyperlink control in the provided parent.

Parameters:
parent - the control parent
style - the widget style
Method Detail

initAccessible

protected void initAccessible()

setUnderlined

public void setUnderlined(boolean underlined)
Sets the underlined state. It is not necessary to call this method when in a hyperlink group.

Parameters:
underlined - if true , a line will be drawn below the text for each wrapped line.

isUnderlined

public boolean isUnderlined()
Returns the underline state of the hyperlink.

Returns:
true if text is underlined, false otherwise.

computeSize

public 
Point computeSize(int wHint,
                         int hHint,
                         boolean changed)
Overrides the parent by incorporating the margin.

Overrides:
computeSize in class Composite
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"

getText

public 
String getText()
Returns the current hyperlink text.

Overrides:
getText in class AbstractHyperlink
Returns:
hyperlink text

getToolTipText

public 
String getToolTipText()
Description copied from class: Control
Returns the receiver's tool tip text, or null if it has not been set.

Overrides:
getToolTipText in class Control
Returns:
the receiver's tool tip text

setToolTipText

public void setToolTipText(
String string)
Description copied from class: Control
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. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.

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.

Overrides:
setToolTipText in class Control
Parameters:
string - the new tool tip text (or null)

setText

public void setText(
String text)
Sets the text of this hyperlink.

Parameters:
text - the hyperlink text

paintHyperlink

protected void paintHyperlink(
GC gc)
Paints the hyperlink text.

Specified by:
paintHyperlink in class AbstractHyperlink
Parameters:
gc - graphic context

paintText

protected void paintText(
GC gc,
                         
Rectangle bounds)
Paints the hyperlink text in provided bounding rectangle.

Parameters:
gc - graphic context
bounds - the bounding rectangle in which to paint the text

shortenText

protected 
String shortenText(
GC gc,
                             
String t,
                             int width)

computeTextSize

protected 
Point computeTextSize(int wHint,
                                int hHint)

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire