Thanks Thomas. Much cleaner that way!
New code:
/**
* @return the number of modal popups currently showing
*/
public static int getNumPopupsShowing() {
int result = 0;
for (int i=0; i<RootPanel.get().getWidgetCount(); i++) {
Widget widget = RootPanel.get().getWidget(i);
if (widget instanceof PopupPanel) {
if (((PopupPanel)widget).isShowing() && ((PopupPanel)widget).isModal()) {
result++;
}
}
}
return result;
}
I actually thought this wouldn't work when compiled, because I didn't know
how it would tell which div was a popup panel, but somehow it does! Go GWT!
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/aS7a8ASVEIEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.