@Override
@Hide
public void innerInitialize(final BA ba, final String eventName, boolean keepOldObject) {
if (!keepOldObject)
setObject(new WebView());
super.innerInitialize(ba, eventName, true);
if (ba.subExists(eventName + "_locationchanged")) {
getObject().getEngine().locationProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> arg0,
String arg1, String arg2) {
ba.raiseEventFromUI(getObject(), eventName + "_locationchanged", arg2);
}
});
}
if (ba.subExists(eventName + "_pagefinished")) {
getObject().getEngine().getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
@Override
public void changed(ObservableValue<? extends State> arg0,
State arg1, State arg2) {
if (arg2 == State.SUCCEEDED) {
ba.raiseEventFromUI(getObject(), eventName + "_pagefinished", getObject().getEngine().getLocation());
}
}
});
}
}