aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarko Grönroos <magi@iki.fi>2008-08-29 11:09:13 +0000
committerMarko Grönroos <magi@iki.fi>2008-08-29 11:09:13 +0000
commit53581fe5a7620a6f1add3c0781f3a6477c5c1ab1 (patch)
treeae14a3fc3098229897c5f6a7acd8cab531b56d39
parent54d02496975d3fcee7b182cf7534e8f5b0fbc8c2 (diff)
downloadvaadin-framework-53581fe5a7620a6f1add3c0781f3a6477c5c1ab1.tar.gz
vaadin-framework-53581fe5a7620a6f1add3c0781f3a6477c5c1ab1.zip
Updated manual example code. Corrected formatting in window test application.
svn changeset:5303/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/tests/book/WindowTestApplication.java39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/com/itmill/toolkit/tests/book/WindowTestApplication.java b/src/com/itmill/toolkit/tests/book/WindowTestApplication.java
index 0458298ce3..0affc7a4f6 100644
--- a/src/com/itmill/toolkit/tests/book/WindowTestApplication.java
+++ b/src/com/itmill/toolkit/tests/book/WindowTestApplication.java
@@ -11,8 +11,8 @@ import com.itmill.toolkit.ui.Window;
import com.itmill.toolkit.ui.Button.ClickEvent;
public class WindowTestApplication extends Application {
- Window anotherpage = null;
- HashMap windows = new HashMap();
+ Window anotherpage = null;
+ HashMap windows = new HashMap();
public void init() {
final Window main = new Window("Window Test Application");
@@ -36,39 +36,37 @@ public class WindowTestApplication extends Application {
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
// Open the window.
- main.open(new ExternalResource(mywindow.getURL()),
- "_new");
+ main.open(new ExternalResource(mywindow.getURL()), "_new");
}
}));
/* Add a link to the second window. */
Link link = new Link("Click to open second window",
- new ExternalResource(mywindow.getURL()));
+ new ExternalResource(mywindow.getURL()));
link.setTargetName("_new");
main.addComponent(link);
// Add the link manually inside a Label.
- main.addComponent(new Label("Second window: <a href='"
- + mywindow.getURL() + "' target='_new'>click to open</a>",
- Label.CONTENT_XHTML));
- main.addComponent(new Label(
- "The second window can be accessed through URL: "
- + mywindow.getURL()));
+ main.addComponent(new Label("Second window: <a href='" + mywindow.getURL()
+ + "' target='_new'>click to open</a>",
+ Label.CONTENT_XHTML));
+ main.addComponent(new Label("The second window can be accessed through URL: "
+ + mywindow.getURL()));
// Add links to windows that do not yet exist, but are created
- // dynamically
- // when the URL is called.
+ // dynamically when the URL is called.
main.addComponent(new Label("URLs to open item windows:"));
final String[] items = new String[] { "mercury", "venus", "earth",
"mars", "jupiter", "saturn", "uranus", "neptune" };
+
for (int inx = 0; inx < items.length; inx++) {
String item = items[inx];
- // We do not create window objects here, but just links to the
- // windows
+
+ // We do not create window objects here, but just links to the windows
String windowUrl = getURL() + "planet-" + item;
- main.addComponent(new Label("A window about '" + item
- + "': <a href='" + windowUrl + "' target='_new'>"
- + windowUrl + "</a>", Label.CONTENT_XHTML));
+ main.addComponent(new Label("A window about '" + item + "': <a href='" +
+ windowUrl + "' target='_new'>" + windowUrl +
+ "</a>", Label.CONTENT_XHTML));
}
}
@@ -78,9 +76,8 @@ public class WindowTestApplication extends Application {
if (!windows.containsKey(planetName)) {
// Create the window object on the fly.
Window newWindow = new Window("Yet Another Page");
- newWindow.addComponent(new Label(
- "This window contains details about " + planetName
- + "."));
+ newWindow.addComponent(new Label("This window contains details about " +
+ planetName + "."));
windows.put(planetName, newWindow);
// We must add the window to the application, it is not done