/** Utility to lazily set up the autohider (but not register it). */
private void maybeCreateAutoHider() {
if (autoHide == null) {
if (isMaskEnabled) {
autoHide = new AutoHider(this, false, false, false, KeyBehavior.DO_NOT_HIDE_ON_ANY_KEY);
autoHide.ignoreHideClickFor(maskDiv);
} else {
autoHide = new AutoHider(this, true, true, true, KeyBehavior.HIDE_ON_ESCAPE);
}
autoHide.ignoreHideClickFor(getElement()); // your own element is inside
}
}