com.webrenderer.event
Class BrowserAdapter

java.lang.Object
  extended bycom.webrenderer.event.BrowserAdapter
All Implemented Interfaces:
BrowserListener, java.util.EventListener
Direct Known Subclasses:
HistoryListener

public abstract class BrowserAdapter
extends java.lang.Object
implements BrowserListener

An abstract adapter class for receiving browser events. The methods in this class are empty. This exists as a convenience class for creating listener objects.

Extend this class to create a BrowserEvent listener and override the methods for the events of interest. (If you implement the BrowserListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you only have to define methods for events you require.)

Create a listener object using the extended class and then register it with a browser using the browser's addBrowserListener method. When a browser event occurs, the relevant method in the listener object is invoked and the BrowserEvent is passed to it.

An example of using a BrowserAdapter on a IBrowserCanvas called browser to listen for title change events can be achived by:


 browser.addBrowserListener( new BrowserAdapter() {
     public void onTitleChange( BrowserEvent e ) {
         System.out.println( "Title Changed to: " + e.getTitle() );
     }
 });


Constructor Summary
BrowserAdapter()
           
 
Method Summary
 void onBeforeNavigate(BrowserEvent e)
          Invoked just before a URL begins to load.
 void onContextMenu(BrowserEvent e)
          Invoked when user press right click button for context menu
 void onLinkChange(BrowserEvent e)
          Invoked when the link message changes in a browser.
 void onLoadIntercept(BrowserEvent e)
          Invoked before any load is commenced.
 void onNavigationCancelled(BrowserEvent e)
          Invoked when the loading of a URL is prematurely stopped.
 void onTitleChange(BrowserEvent e)
          Invoked when the title changes in a browser.
 void onURLChange(BrowserEvent e)
          Invoked when the URL changes in a browser.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserAdapter

public BrowserAdapter()
Method Detail

onLinkChange

public void onLinkChange(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked when the link message changes in a browser.
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onLinkChange in interface BrowserListener

onURLChange

public void onURLChange(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked when the URL changes in a browser.
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onURLChange in interface BrowserListener

onTitleChange

public void onTitleChange(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked when the title changes in a browser.
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onTitleChange in interface BrowserListener

onBeforeNavigate

public void onBeforeNavigate(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked just before a URL begins to load.
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onBeforeNavigate in interface BrowserListener

onNavigationCancelled

public void onNavigationCancelled(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked when the loading of a URL is prematurely stopped.
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onNavigationCancelled in interface BrowserListener

onLoadIntercept

public void onLoadIntercept(BrowserEvent e)
Description copied from interface: BrowserListener
Invoked before any load is commenced. Call e.blockLoad() To stop the load for current URL (e.getURL()).
Available Methods from BrowserEvent at the time this event is fired:

Specified by:
onLoadIntercept in interface BrowserListener

onContextMenu

public void onContextMenu(BrowserEvent e)
Deprecated. See com.webrenderer.event.MouseListener

Description copied from interface: BrowserListener
Invoked when user press right click button for context menu

Specified by:
onContextMenu in interface BrowserListener