use of net.rim.device.api.browser.field2.BrowserFieldListener in project CodenameOne by codenameone.
the class BlackBerryOS5Implementation method createBrowserComponent.
public PeerComponent createBrowserComponent(Object browserComponent) {
synchronized (UiApplication.getEventLock()) {
BrowserField bff = new BrowserField();
final BrowserComponent cmp = (BrowserComponent) browserComponent;
bff.addListener(new BrowserFieldListener() {
public void documentError(BrowserField browserField, Document document) throws Exception {
cmp.fireWebEvent("onError", new ActionEvent(document.getDocumentURI()));
super.documentError(browserField, document);
}
public void documentCreated(BrowserField browserField, ScriptEngine scriptEngine, Document document) throws Exception {
cmp.fireWebEvent("onStart", new ActionEvent(document.getDocumentURI()));
super.documentCreated(browserField, scriptEngine, document);
}
public void documentLoaded(BrowserField browserField, Document document) throws Exception {
cmp.fireWebEvent("onLoad", new ActionEvent(document.getDocumentURI()));
super.documentLoaded(browserField, document);
}
});
return PeerComponent.create(bff);
}
}
Aggregations