org.springframework.richclient.text
Class DefaultHyperlinkActivationHandler

java.lang.Object
  extended by org.springframework.richclient.text.DefaultHyperlinkActivationHandler
All Implemented Interfaces:
EventListener, HyperlinkListener

public class DefaultHyperlinkActivationHandler
extends Object
implements HyperlinkListener

An implementation of HyperlinkListener that will open a web browser when a URL is activated or, when an anchor link is activated scoll the pane to display the anchor location.

Author:
Oliver Hutchison

Constructor Summary
DefaultHyperlinkActivationHandler()
           
 
Method Summary
protected  void handleAnchorActivated(HyperlinkEvent e, String anchor)
          Called when the user clicks on an anchor e.g.
protected  void handleOtheActivated(HyperlinkEvent e)
          Called when the user clicks on a link that is neither an anchor or URL.
protected  void handleUrlActivated(HyperlinkEvent e, URL url)
          Called when the user clicks on a URL link e.g.
 void hyperlinkUpdate(HyperlinkEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHyperlinkActivationHandler

public DefaultHyperlinkActivationHandler()
Method Detail

handleAnchorActivated

protected void handleAnchorActivated(HyperlinkEvent e,
                                     String anchor)
Called when the user clicks on an anchor e.g.
<a href="#top">Go to Top</a>.

This default implementation will scroll the source pane so that the anchor target becomes visible.


handleUrlActivated

protected void handleUrlActivated(HyperlinkEvent e,
                                  URL url)
Called when the user clicks on a URL link e.g.
<a href="http://some.site">Go to Some Site</a>.

This default implementation attempt to open the link in the systems default browser.


handleOtheActivated

protected void handleOtheActivated(HyperlinkEvent e)
Called when the user clicks on a link that is neither an anchor or URL. e.g
<a href="whatever">what ever</a>.

This default implementation does nothing.


hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent e)
Specified by:
hyperlinkUpdate in interface HyperlinkListener


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.