I would like to find out, in GWT, which element currently has focus. Basically i was working on virtual keyboard in our application. All keys are working fine except tab key
Short template:
public class IntBox extends com.google.gwt.user.client.ui.IntegerBox {
private boolean focused=false;
public IntBox(){
addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
focused=true;
}
});
addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
focused=false;
}
});
}
public boolean isFocused() {
return focused;
}
}