Revision: 7715
Author: [email protected]
Date: Fri Mar 12 03:15:29 2010
Log: Changes for crawling: client-side changes to Showcase sample

Review at http://gwt-code-reviews.appspot.com/161801

http://code.google.com/p/google-web-toolkit/source/detail?r=7715

Modified:
/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java
 /trunk/samples/showcase/war/Showcase.html

=======================================
--- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java Wed Nov 18 11:30:09 2009 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java Fri Mar 12 03:15:29 2010
@@ -79,6 +79,7 @@
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 import com.google.gwt.user.client.ui.HasVerticalAlignment;
 import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.ListBox;
 import com.google.gwt.user.client.ui.RootPanel;
@@ -214,7 +215,8 @@
         TreeItem item = event.getSelectedItem();
         ContentWidget content = itemWidgets.get(item);
         if (content != null && !content.equals(app.getContent())) {
-          History.newItem(getContentWidgetToken(content));
+ String historyToken = ((Hyperlink) item.getWidget()).getTargetHistoryToken();
+          History.newItem(historyToken);
         }
       }
     });
@@ -229,7 +231,7 @@
       app.getMainMenu().ensureSelectedItemVisible();
       displayContentWidget(itemWidgets.get(firstItem));
     }
-
+
     // Always prefetch
     Prefetcher.start();
   }
@@ -243,6 +245,7 @@
     if (content != null) {
       app.setContent(content);
       app.setContentTitle(content.getTabBar());
+      Window.setTitle("Showcase of Features: " + content.getName());
     }
   }

@@ -398,12 +401,13 @@
   private void setupMainMenuOption(TreeItem parent, ContentWidget content,
       ImageResource image) {
     // Create the TreeItem
- TreeItem option = parent.addItem(AbstractImagePrototype.create(image).getHTML()
-        + " " + content.getName());
+ Hyperlink hl = new Hyperlink(AbstractImagePrototype.create(image).getHTML() + + " " + content.getName(), true, "!" + getContentWidgetToken(content));
+    TreeItem option = parent.addItem(hl);

     // Map the item to its history token and content widget
     itemWidgets.put(option, content);
-    itemTokens.put(getContentWidgetToken(content), option);
+    itemTokens.put(hl.getTargetHistoryToken(), option);
   }

   /**
=======================================
--- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java Wed Nov 18 11:30:09 2009 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwHyperlink.java Fri Mar 12 03:15:29 2010
@@ -133,7 +133,7 @@
     className = className.substring(className.lastIndexOf('.') + 1);

     // Convert to a hyper link
-    Hyperlink link = new Hyperlink(name, className);
+    Hyperlink link = new Hyperlink(name, "!" + className);
     link.ensureDebugId("cwHyperlink-" + className);
     return link;
   }
=======================================
--- /trunk/samples/showcase/war/Showcase.html   Mon Nov 23 16:21:36 2009
+++ /trunk/samples/showcase/war/Showcase.html   Fri Mar 12 03:15:29 2010
@@ -1,6 +1,6 @@
 <HTML>
   <head>
-    <title>Showcase of GWT Features</title>
+    <meta name="fragment" content="!">
     <script language='javascript'>
       // Used in the Dictionary Example
       var userInfo = {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to