|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Widget org.eclipse.swt.widgets.Control org.eclipse.ercp.swt.mobile.HyperLink
Instances of this class represent a selectable user interface object that launchs other applications when activated by the end-user.
This class represents several types of hyperlinks associated with certain functionalities. The end-user can activate the associated program determined by the style. The concrete visual effect and activation behavior vary from platform to platform.
A HyperLink instance accepts general characters as other controls do, but the
appearance is implementation and locale dependent, for example, a HyperLink
object with the PHONE style might display as follows:
(416) 123-4567
but the actual contents of the object visible to the application through the
APIs, e.g. getText()
, can be the string "4161234567".
Example
HyperLink email = new HyperLink(composite, SWT.NONE, HyperLink.EMAIL); email.setText("[email protected]"); HyperLink dialer = new HyperLink(composite, SWT.BORDER | SWT.LEFT, HyperLink.PHONE); dialer.setText("3581234567");
Note: Since the style provides hint for the implementation, there is no event that applications need to listen to.
IMPORTANT: This class is not intended to be subclassed.
Field Summary | |
static int |
EMAIL
opens the implementation-dependent e-mail client when activated. |
static int |
PHONE
shows the implementation-dependent dialer interface when activated. |
static int |
URL
launches a implementation-dependent web browser when activated. |
Constructor Summary | |
HyperLink(Composite parent,
int style,
int format)
Constructs a new instance of this class given its parent, a style value and a format value describing its behavior and appearance. |
Method Summary | |
java.lang.String |
getText()
Returns the receiver's text, which will be an empty string if it has never been set. |
void |
setText(java.lang.String string)
Sets the receiver's text. |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, 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 |
Field Detail |
public static final int URL
public static final int EMAIL
public static final int PHONE
Constructor Detail |
public HyperLink(Composite parent, int style, int format)
The style value is either one of the style constants defined in class
SWT
which is applicable to instances of this class, or
must be built by bitwise OR 'ing together (that is, using the
int
"|" operator) two or more of those SWT
style constants. The class description lists the style constants that are
applicable to the class. Style bits are also inherited from superclasses.
The format value must be one of URL, EMAIL and PHONE.
parent
- a composite control which will be the parent of the new
instance (cannot be null)style
- the style of control to constructformat
- the format value.
java.lang.IllegalArgumentException
- SWTException
- SWT.BORDER
,
SWT.CENTER
,
SWT.LEFT
,
SWT.RIGHT
,
URL
,
EMAIL
,
PHONE
Method Detail |
public java.lang.String getText()
SWTException
- setText(String)
public void setText(java.lang.String string)
This method sets the link text.
string
- the new text
java.lang.IllegalArgumentException
- SWTException
- getText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |