if (selection == null) {
return;
}
InfoWindowContent content;
if (selection.equals(TEST_MAX_CONTENT)) {
// Demonstrate the use of the maxTitle and maxContent properties
HTML htmlWidget = new HTML("<h1>ATTENTION PLEASE</h1>"
+ "<p> I have a few things to say to you (click maximize.)</p>");
content = new InfoWindowContent(htmlWidget);
content.setMaxContent("<p>Lorem ipsum dolor sit amet, consetetur "
+ "sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut "
+ "labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos "
+ "et accusam et justo duo dolores et ea rebum. Stet clita kasd "
+ "gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. "
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
+ "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
+ "erat, sed diam voluptua. At vero eos et accusam et justo duo dolores "
+ "et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est "
+ "Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur "
+ "sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore "
+ "et dolore magna aliquyam erat, sed diam voluptua. At vero eos et "
+ "accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, "
+ "no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>"
+ "<p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit "
+ "esse molestie consequat, vel illum dolore eu feugiat nulla facilisis "
+ "at vero eros et accumsan et iusto odio dignissim qui blandit "
+ "praesent luptatum zzril delenit augue duis dolore te feugait nulla "
+ "facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, "
+ "sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna "
+ "aliquam erat volutpat.</p>");
content.setMaxTitle("Lorem Ipsum");
} else if (selection.equals(TEST_IMAGE)) {
// An image that isn't loaded yet doesn't work well sometimes
// Specify the width and height to work around this.
HTML htmlWidget = new HTML(
"<img src=\"boot.jpg\" width=\"235\" height=\"287\">");
content = new InfoWindowContent(htmlWidget);
} else if (selection.equals(TEST_NO_CLICK)) {
// Demonstrates setting the info window to stay "sticky" and not
// automatically close when the user clicks on the maps window.
HTML htmlWidget = new HTML("<h1>STICKY INFO WINDOW</h1>"
+ "<p> Click if you must, you won't get rid of me that easily.</p>");
content = new InfoWindowContent(htmlWidget);
content.setNoCloseOnClick(true);
} else if (selection.equals(TEST_TABS)) {
// Display tabs in the InfoWindow
content = displayInfoWindowTabs();
} else if (selection.equals(TEST_MAX_TITLE_CONTENT_WIDGET)) {
// Display the maximized content using widgets instead of strings.
content = displayInfoWindowMaxWidget();
} else if (selection.equals(TEST_MAP_BLOWUP)) {
// Display a Map Blowup Window
content = new InfoWindowContent.MapBlowupContent();
} else {
// The default case
Tree tree = new Tree();
TreeItem foo = new TreeItem("Foo");
tree.addItem(foo);
TreeItem bar = new TreeItem("bar");
foo.addItem(bar);
bar.addItem("baz");
bar.addItem("gwt");
// max-height must be set in advance so info window is sized appropriately
tree.setSize("217px", "104px");
content = new InfoWindowContent(tree);
}
info.open(map.getCenter(), content);
}