Flying Saucer Project Release ${app.version}

org.xhtmlrenderer.swing
Class LinkListener

java.lang.Object
  extended by org.xhtmlrenderer.swing.DefaultFSMouseListener
      extended by org.xhtmlrenderer.swing.LinkListener
All Implemented Interfaces:
FSMouseListener

public class LinkListener
extends DefaultFSMouseListener

A LinkListener is used to respond to a user clicking Box elements in a BasicPanel, in particular to handle anchors and navigation. When a Box is clicked, if it has an anchor associated with it, the panel will be requested to navigate to that URI.


Constructor Summary
LinkListener()
           
 
Method Summary
 void linkClicked(BasicPanel panel, java.lang.String uri)
          Utility method to request the panel navigate to the given URI.
 void onMouseUp(BasicPanel panel, Box box)
          Triggers the click on a box.
 
Methods inherited from class org.xhtmlrenderer.swing.DefaultFSMouseListener
onMouseDragged, onMouseOut, onMouseOver, onMousePressed, reset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkListener

public LinkListener()
Method Detail

linkClicked

public void linkClicked(BasicPanel panel,
                        java.lang.String uri)
Utility method to request the panel navigate to the given URI.

Parameters:
panel - the panel on which the listener is attached
uri - the URI to navigate to

onMouseUp

public void onMouseUp(BasicPanel panel,
                      Box box)
Triggers the click on a box. If the Box's element has an associated URI (e.g. is an anchor), notifies the panel to navigate to that URI.

Specified by:
onMouseUp in interface FSMouseListener
Overrides:
onMouseUp in class DefaultFSMouseListener
Parameters:
panel - the panel where the mouse button has been released.
box - the box on which the mouse cursor is currently located

Flying Saucer Project Release ${app.version}

Flying Saucer Project Home