org.eclipse.ecf.ui.hyperlink
Class AbstractURLHyperlinkDetector

java.lang.Object
  extended by org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
      extended by org.eclipse.ecf.ui.hyperlink.AbstractURLHyperlinkDetector
All Implemented Interfaces:
org.eclipse.jface.text.hyperlink.IHyperlinkDetector, org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension

public abstract class AbstractURLHyperlinkDetector
extends org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector

Abstract class for representing ECF URL hyperlink detectors. This class should be subclassed to detect URL hyperlink specifically for accessing ECF protocols. For example, and XMPPURLHyperlinkDetector subclass can be created to detect URLs of the form:

xmpp://foo@bar.com


Field Summary
static java.lang.String DEFAULT_DETECTABLE
           
static java.lang.String DEFAULT_ENDDELIMITERS
           
 
Constructor Summary
AbstractURLHyperlinkDetector()
           
 
Method Summary
protected abstract  org.eclipse.jface.text.hyperlink.IHyperlink[] createHyperLinksForURI(org.eclipse.jface.text.IRegion region, java.net.URI uri)
          Create hyperlinks for detected URI.
 org.eclipse.jface.text.hyperlink.IHyperlink[] detectHyperlinks(org.eclipse.jface.text.ITextViewer textViewer, org.eclipse.jface.text.IRegion region, boolean canShowMultipleHyperlinks)
           
protected  java.net.URI detectProtocol(java.lang.String uriString)
           
protected  org.eclipse.jface.text.IRegion detectSubRegion(org.eclipse.jface.text.IRegion lineInfo, java.lang.String fromLine, int offsetInLine)
           
protected  java.lang.String[] getProtocols()
           
protected  void setProtocols(java.lang.String[] protocols)
           
 
Methods inherited from class org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
dispose, getAdapter, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DETECTABLE

public static final java.lang.String DEFAULT_DETECTABLE
See Also:
Constant Field Values

DEFAULT_ENDDELIMITERS

public static final java.lang.String DEFAULT_ENDDELIMITERS
See Also:
Constant Field Values
Constructor Detail

AbstractURLHyperlinkDetector

public AbstractURLHyperlinkDetector()
Method Detail

setProtocols

protected void setProtocols(java.lang.String[] protocols)

getProtocols

protected java.lang.String[] getProtocols()

detectSubRegion

protected org.eclipse.jface.text.IRegion detectSubRegion(org.eclipse.jface.text.IRegion lineInfo,
                                                         java.lang.String fromLine,
                                                         int offsetInLine)

detectProtocol

protected java.net.URI detectProtocol(java.lang.String uriString)

createHyperLinksForURI

protected abstract org.eclipse.jface.text.hyperlink.IHyperlink[] createHyperLinksForURI(org.eclipse.jface.text.IRegion region,
                                                                                        java.net.URI uri)
Create hyperlinks for detected URI.

Parameters:
region - an IRegion to show for hyperlink. Will not be null.
uri - a URI to create a hyperlink for. Will not be null.
Returns:
IHyperlink[] of hyperlinks for given URL. Return null if no hyperlinks should be displayed for detected URI.

detectHyperlinks

public org.eclipse.jface.text.hyperlink.IHyperlink[] detectHyperlinks(org.eclipse.jface.text.ITextViewer textViewer,
                                                                      org.eclipse.jface.text.IRegion region,
                                                                      boolean canShowMultipleHyperlinks)