|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swt.text.StyledTextLinkOTron
public class StyledTextLinkOTron
Adds automatic clickable links to URL's in a styled text widget.
Note: the link colour is extracted from
JFaceColors.getHyperlinkText(org.eclipse.swt.widgets.Display)
which may not be set. To set manually use:
JFaceResources.getColorRegistry ().put (JFacePreferences.HYPERLINK_COLOR, display.getSystemColor (SWT.COLOR_BLUE).getRGB ());See
Constructor Summary | |
---|---|
StyledTextLinkOTron(org.eclipse.swt.custom.StyledText textField)
Create a new instance. |
Method Summary | |
---|---|
void |
addListener(int event,
org.eclipse.swt.widgets.Listener listener)
Add a SWT.Selection listener to listen for URL clicks (URL in Event.text). |
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
void |
handleEvent(org.eclipse.swt.widgets.Event e)
|
void |
lineGetStyle(org.eclipse.swt.custom.LineStyleEvent e)
Called by text field to get style for a line. |
boolean |
openInBrowser()
|
void |
openInBrowser(boolean newValue)
Set to true to automatically open links in the system browser (default true). |
void |
removeListener(int event,
org.eclipse.swt.widgets.Listener listener)
|
protected List<UrlScanner.UrlRange> |
scanForUrls(String text,
int offset)
|
UrlScanner.UrlRange |
urlRangeAt(org.eclipse.swt.widgets.Event e)
Find the URL range at a given mouse event. |
UrlScanner.UrlRange |
urlRangeAt(int offset)
Find the URL range for a given offset into the text. |
Set |
validSchemes()
The set of valid URL schemes that are recognised as links. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StyledTextLinkOTron(org.eclipse.swt.custom.StyledText textField)
Method Detail |
---|
public void dispose()
Disposable
dispose
in interface Disposable
public void openInBrowser(boolean newValue)
public boolean openInBrowser()
public void addListener(int event, org.eclipse.swt.widgets.Listener listener)
public void removeListener(int event, org.eclipse.swt.widgets.Listener listener)
public Set validSchemes()
public void handleEvent(org.eclipse.swt.widgets.Event e)
handleEvent
in interface org.eclipse.swt.widgets.Listener
public UrlScanner.UrlRange urlRangeAt(org.eclipse.swt.widgets.Event e)
public UrlScanner.UrlRange urlRangeAt(int offset)
public void lineGetStyle(org.eclipse.swt.custom.LineStyleEvent e)
lineGetStyle
in interface org.eclipse.swt.custom.LineStyleListener
protected List<UrlScanner.UrlRange> scanForUrls(String text, int offset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |