aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2009-01-09 17:24:33 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2009-01-09 17:24:33 +0000
commit1355dd0fc925a79ba4cf53de76d85155e820c89e (patch)
treee60ae563a736777161e14b70355e7c8987b3b7d4
parentb1e19ce20861282ed728971f2ee7ad428646001f (diff)
downloadvaadin-framework-1355dd0fc925a79ba4cf53de76d85155e820c89e.tar.gz
vaadin-framework-1355dd0fc925a79ba4cf53de76d85155e820c89e.zip
improving windowing javadocs
svn changeset:6485/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/Application.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/Application.java b/src/com/itmill/toolkit/Application.java
index a1ce33531c..fa4f5e9a9d 100644
--- a/src/com/itmill/toolkit/Application.java
+++ b/src/com/itmill/toolkit/Application.java
@@ -211,18 +211,27 @@ public abstract class Application implements URIHandler, Terminal.ErrorListener
* method can be left as is. In case browser-level windows are needed, it is
* recommended to create new window-objects on this method from their names
* if the super.getWindow() does not find existing windows. See below for
- * implementation example:
- * <code> // If we already have the requested window, use it
+ * implementation example: <code><pre>
+ // If we already have the requested window, use it
Window w = super.getWindow(name);
if (w == null) {
-
// If no window found, create it
- w = createNewWindow(name);
- }
- return w;</code>
+ w = new Window(name);
+ // set windows name to the one requested
+ w.setName(name);
+ // add it to this application
+ addWindow(w);
+ // add some content
+ w.addComponent(new Label("Test window"));
+ }
+ return w;</pre></code>
* </p>
*
* <p>
+ * <strong>Note</strong> that all returned Window objects must be added to
+ * this application instance.
+ *
+ * <p>
* The method should return null if the window does not exists (and is not
* created as a side-effect) or if the application is not running anymore.
* </p>