Daniel Kurka has uploaded a new change for review.
https://gwt-review.googlesource.com/3637
Change subject: Log warning when wrongly using RootPanel
......................................................................
Log warning when wrongly using RootPanel
fixes issue 5874
Change-Id: If3b8a559edef046b4c2e9ad3e5ac5840a193428f
---
M user/src/com/google/gwt/user/client/ui/RootPanel.java
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/user/src/com/google/gwt/user/client/ui/RootPanel.java
b/user/src/com/google/gwt/user/client/ui/RootPanel.java
index c4929c6..5ec980d 100644
--- a/user/src/com/google/gwt/user/client/ui/RootPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/RootPanel.java
@@ -17,6 +17,7 @@
import com.google.gwt.core.client.impl.Disposable;
import com.google.gwt.core.client.impl.Impl;
+import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.BodyElement;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
@@ -301,6 +302,17 @@
onAttach();
}
+ @Override
+ public void add(Widget w) {
+ // warn about misuse of RootLayoutPanel vs. RootPanels
+ if (!GWT.isProdMode()) {
+ if (w instanceof LayoutPanel) {
+ GWT.log("Adding a LayoutPanel to RootPanel, did you mean
RootLayoutPanel instead?");
+ }
+ }
+ super.add(w);
+ }
+
/**
* Clears the rootPanel. If clearDom is true, then also remove any DOM
* elements that are not widgets.
--
To view, visit https://gwt-review.googlesource.com/3637
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If3b8a559edef046b4c2e9ad3e5ac5840a193428f
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <[email protected]>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.