Re: How to detect if a Popup is showing

2011-07-13 Thread Thomas Broyer
Oh right, sorry, missed the 'protected' keyword in the javadoc. Note however that HasWidgets extends Iterable (hence the existence of RootPanel.get().iterator()) so you could write "for (Widget w : RootPanel.get()) { ... }" (not sure I like it though) -- You received this message because you a

Re: How to detect if a Popup is showing

2011-07-13 Thread Craig Mitchell
Sorry, getChildren() does exist, however, it's a protected method. -- 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/-/EJo_4b9Lj6oJ. To post to this

Re: How to detect if a Popup is showing

2011-07-13 Thread Craig Mitchell
getChildren() doesn't exist (in GWT 2.2.0). However, I could have used RootPanel.get().iterator(). I would have thought when GWT compiled the widgets, they would turn into a or something similar, and their type would be lost, however, I'm clearly wrong, as it works a treat! -- You received

Re: How to detect if a Popup is showing

2011-07-13 Thread Thomas Broyer
Any reason you don't use an "enhanced for loop"? for (Widget widget : RootPanel.get().getChildren()) { ... } It works because it's looping on widgets, not elements (look at the code, there's an ArrayList to store the child widgets; there's no magic) -- You received this message because you are

Re: How to detect if a Popup is showing

2011-07-12 Thread Craig Mitchell
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; ihttps://groups.google.com/d/msg/google-web-toolkit/-/Zbhl1FMbOXsJ. To post to this group, send email to google

Re: How to detect if a Popup is showing

2011-07-12 Thread Craig Mitchell
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; ihttps://groups.google.com/d/msg/google-web-toolkit/-/aS7a8ASVEIEJ. To post to this group, send email to google

Re: How to detect if a Popup is showing

2011-07-12 Thread Thomas Broyer
PopupPanels append themselves to RootPanel.get(), so you can loop over RootPanel.get().getChildren() and whenever you see a PopupPanel you can ask if it isShowing(). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion

Re: How to detect if a Popup is showing

2011-07-11 Thread dreamer
Not sure, if there is a automatic way of detecting all child windows to a parent window on demand, but certainly you can main maintain, global array list and every popup window that you open, and call close on each of those. You can lot of examples in javascript - "closing child windows to idea".

Re: How to detect if a Popup is showing

2011-07-11 Thread Craig Mitchell
Thanks Ashwin. Yes, sorry, should have been a little more clear, I wanted to detect if a popup is showing, "which I didn't already have the reference to". Apologies for not being more clear. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" gro

Re: How to detect if a Popup is showing

2011-07-11 Thread ashwin.desi...@gmail.com
Popup Panels have a isShowing() method, use that to determine if its currently displayed ~Ashwin On Tue, Jul 12, 2011 at 6:30 AM, Craig Mitchell wrote: > Hi, > > I wanted to check if a popup is showing, so I wrote this method: > > public static int getNumPopupsShowing() { > int result = 0; > No

How to detect if a Popup is showing

2011-07-11 Thread Craig Mitchell
Hi, I wanted to check if a popup is showing, so I wrote this method: public static int getNumPopupsShowing() { int result = 0; NodeList divs = Document.get().getElementsByTagName("div"); for (int i=0; ihttps://groups.google.com/d/msg/google-web-toolkit/-/Jwf77I4AUsoJ. To post to this group, send