import com.vaadin.ui.Button;\r
import com.vaadin.ui.Button.ClickEvent;\r
import com.vaadin.ui.Button.ClickListener;\r
-import com.vaadin.ui.Component;\r
import com.vaadin.ui.Label;\r
import com.vaadin.ui.Window;\r
\r
log(this);\r
super.attach();\r
}\r
-\r
- @Override\r
- public void addWindow(Window w) {\r
- log.log("Adding sub window");\r
- super.addWindow(w);\r
- log.log("Sub window added");\r
-\r
- }\r
};\r
- mainWindow.setCaption("Main window");\r
mainWindow.addComponent(log);\r
mainWindow.getContent().setSizeFull();\r
Label label = new Label("This is the main app") {\r
Window loginWindow = createSubWindow();\r
if (addSubWindowBeforeMainWindow) {\r
mainWindow.addWindow(loginWindow);\r
+ log.log("Sub window added to application");\r
}\r
\r
- log.log("Setting main window");\r
setMainWindow(mainWindow); // At this point\r
log.log("Main window set");\r
\r
if (!addSubWindowBeforeMainWindow) {\r
mainWindow.addWindow(loginWindow);\r
+ log.log("Sub window added to application");\r
}\r
}\r
\r
return w;\r
}\r
\r
- public void log(Component c) {\r
- Class<?> cls = c.getClass();\r
+ public void log(Object o) {\r
+ Class cls = o.getClass();\r
if (cls.isAnonymousClass()) {\r
cls = cls.getSuperclass();\r
}\r
- log.log(cls.getName() + " '" + c.getCaption()\r
- + "' attached to application");\r
+ log.log(cls.getName() + " attached to application");\r
}\r
\r
@Override\r