--- /dev/null
+package com.example.dialogtest;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.Window;\r
+\r
+public class SubwindowInvalidLayout extends TestBase {\r
+\r
+ @Override\r
+ protected String getDescription() {\r
+ return "The subwindow contains an invalid layout, which analyze layouts should detect.";\r
+ }\r
+\r
+ @Override\r
+ protected Integer getTicketNumber() {\r
+ return 3096;\r
+ }\r
+\r
+ @Override\r
+ protected void setup() {\r
+ Window window = new Window("Sub window");\r
+ window.center();\r
+\r
+ VerticalLayout vl = new VerticalLayout();\r
+ vl.setWidth(null);\r
+ Button b = new Button("A 100% wide button, invalid");\r
+ b.setWidth("100%");\r
+ vl.addComponent(b);\r
+ window.addComponent(vl);\r
+\r
+ getMainWindow().addWindow(window);\r
+ }\r
+\r
+}\r
paintablePainted(p);
if (analyzeLayouts) {
+ Window w = (Window) p;
invalidComponentRelativeSizes = ComponentSizeValidator
- .validateComponentRelativeSizes(((Window) p)
- .getContent(), null, null);
+ .validateComponentRelativeSizes(w.getContent(),
+ null, null);
+
+ // Also check any existing subwindows
+ if (w.getChildWindows() != null) {
+ for (Window subWindow : (Set<Window>) w
+ .getChildWindows()) {
+ invalidComponentRelativeSizes = ComponentSizeValidator
+ .validateComponentRelativeSizes(
+ subWindow.getContent(),
+ invalidComponentRelativeSizes,
+ null);
+ }
+ }
}
}
}