It’s a bit tricky to give you guidance, as I’m not sure precisely what constraints or intent you have.
I am guessing that you want the URL to govern which window you show, which is why you are overriding application#getName, and that you want to pass simple textual selections from one window to the other. In which case, you might want to use the
UriFragmentUtility on WindowB, and change WindowA to be something like
A second option is to store the information into the Application class, where WindowA can go and save it and WindowB can go and read.
A third option is to do a simple Event-Listener-Handler pattern. A bit like every listener in Vaadin does. WindowA has a addListener(SomeListener) method, WindowB implements SomeListener and the application does windowA.addListener(windowB). This way windowA can call a method defined in SomeListener for every listener that is registered and it will run code inside windowB. You can find some more info on this here:
http://download.oracle.com/javase/tutorial/uiswing/events/index.html
I have never done anything like the things you are trying to do, and because of this I have a hard time seeing any real use cases and being more specific.
I was already thinking about the
UriFragmentUtility , but in my opinion URL parameters are not the most beautiful solution in this case.
The ‘application data storage’ way could be ok. Actually, the windows are already cached by the application, so the data is too. WindowB just needs a reference to the windowA.
The listener way sounds interesting. I will try that one.
By the way, there was a small bug in the test code. The window opening call should have been something like this: