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)
BrowserListener
onLinkChange
in interface BrowserListener
public void onFavicon(BrowserEvent e)
BrowserListener
onFavicon
in interface BrowserListener
public void onURLChange(BrowserEvent e)
BrowserListener
onURLChange
in interface BrowserListener
public void onTitleChange(BrowserEvent e)
BrowserListener
onTitleChange
in interface BrowserListener
public void onBeforeNavigate(BrowserEvent e)
BrowserListener
onBeforeNavigate
in interface BrowserListener
public void onNavigationCancelled(BrowserEvent e)
BrowserListener
onNavigationCancelled
in interface BrowserListener
public void onLoadIntercept(BrowserEvent e)
BrowserListener
onLoadIntercept
in interface BrowserListener
IOptionsService.setLoadInterceptEventsEnabled(boolean)