public abstract class BrowserAdapter extends Object implements BrowserListener
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 achieved by:
browser.addBrowserListener( new BrowserAdapter() {
public void onTitleChange( BrowserEvent e ) {
System.out.println( "Title Changed to: " + e.getTitle() );
}
});| Constructor and Description |
|---|
BrowserAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onBeforeNavigate(BrowserEvent e)
Invoked just before a URL begins to load.
|
void |
onFavicon(BrowserEvent e)
Invoked when the favicon for a page becomes available.
|
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.
|
public void onLinkChange(BrowserEvent e)
BrowserListeneronLinkChange in interface BrowserListenerpublic void onFavicon(BrowserEvent e)
BrowserListeneronFavicon in interface BrowserListenerpublic void onURLChange(BrowserEvent e)
BrowserListeneronURLChange in interface BrowserListenerpublic void onTitleChange(BrowserEvent e)
BrowserListeneronTitleChange in interface BrowserListenerpublic void onBeforeNavigate(BrowserEvent e)
BrowserListeneronBeforeNavigate in interface BrowserListenerpublic void onNavigationCancelled(BrowserEvent e)
BrowserListeneronNavigationCancelled in interface BrowserListenerpublic void onLoadIntercept(BrowserEvent e)
BrowserListeneronLoadIntercept in interface BrowserListenerIOptionsService.setLoadInterceptEventsEnabled(boolean)