Hello Miguel,

This patch pretties up the sample for ManagedResourceStore in a
similar way to the previous patch for the ResourceStoreDemo.

- Add a margin.
- Add some spacing between the buttons.
- Toggle the enabled state of the buttons.

M      
samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemoNoGears.java
M      
samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemo.java
M      
samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo.html
M      
samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo_offline.html


-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

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

<<inline: ManagedResourceStoreDemo.png>>

M      samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemoNoGears.java
M      samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemo.java
M      samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo.html
M      samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo_offline.html

Index: samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemoNoGears.java
===================================================================
--- samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemoNoGears.java	(revision 873)
+++ samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemoNoGears.java	(working copy)
@@ -25,8 +25,7 @@
  */
 public class ManagedResourceStoreDemoNoGears implements EntryPoint {
   public void onModuleLoad() {
-    RootPanel rootPanel = RootPanel.get();
-    rootPanel.add(new HTML(
+    RootPanel.get("demo").add(new HTML(
         "<font color=\"red\">ERROR: This browser does not support Google Gears.  Please install Gears and reload the application.  Note that GWT Gears applications can only be debugged in hosted mode on Windows.</font>"));
   }
 }
Index: samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemo.java
===================================================================
--- samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemo.java	(revision 873)
+++ samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/client/ManagedResourceStoreDemo.java	(working copy)
@@ -46,7 +46,8 @@
 
   public void onModuleLoad() {
     HorizontalPanel hpanel = new HorizontalPanel();
-    RootPanel.get().add(hpanel);
+    hpanel.setSpacing(10);
+    RootPanel.get("demo").add(hpanel);
 
     hpanel.add(createManagedResourceStoreButton);
 
@@ -78,7 +79,9 @@
           LocalServer server = Factory.getInstance().createLocalServer();
           ManagedResourceStore store = Offline.getManagedResourceStore();
           server.removeManagedStore(store.getName());
-          statusLabel.setText("Removed ManagedResourceStore");
+          statusLabel.setText("Removed ManagedResourceStore.  Press Refresh to see Online version.");
+          createManagedResourceStoreButton.setEnabled(false);
+          removeManagedResourceStoreButton.setEnabled(false);
         } catch (GearsException e) {
           statusLabel.setText(e.getMessage());
         }
@@ -105,6 +108,7 @@
                 statusLabel.setText("Update to "
                     + managedResourceStore.getCurrentVersion()
                     + " was completed.  Please refresh the page to see the changes.");
+                createManagedResourceStoreButton.setEnabled(false);
               }
               break;
             case ManagedResourceStore.UPDATE_CHECKING:
Index: samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo.html
===================================================================
--- samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo.html	(revision 873)
+++ samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo.html	(working copy)
@@ -1,24 +1,31 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml";>
-<head>
-<title></title>
-</head>
-<body>
-<script type="text/javascript" language='javascript'
+  <head>
+    <title>Gears Library for GWT - ManagedResourceStoreDemo</title>
+        <style type="text/css">
+.outer-page-div {
+	margin: 15px;
+}
+    </style>
+    <script type="text/javascript" language='javascript'
 	src='com.google.gwt.gears.sample.managedresourcestore.ManagedResourceStoreDemo.nocache.js'></script>
+  </head>
+  <body>
+    <div class="outer-page-div">
+      <h1>ManagedResourceStore Demo</h1>
 
-<h1>ManagedResourceStore Demo</h1>
-
-<p>This is an example of how to use the ManagedResourceStore with a
+      <p>This is an example of how to use the ManagedResourceStore with a
 Gears manifest that was automatically created by the <code>Offline</code>
 module. By clicking on the "Go Offline" button, a ManagedResourceStore
 will be used to download the GWT module locally. When prompted, refresh
 the page and you will see that the the host page has been swapped out.</p>
-<p>This demo will only work in the hosted-mode browser if you are
+      <p>This demo will only work in the hosted-mode browser if you are
 running on Windows, Google Gears has already been installed, and a
 compile/browse cycle has been run, or by using -noserver mode). For
 other platforms, click the Compile/Browse button and visit the
 hosed-mode server with a browser that is supported by Google Gears.</p>
-</body>
+      <div id="demo"></div>
+    </div>
+  </body>
 </html>
Index: samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo_offline.html
===================================================================
--- samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo_offline.html	(revision 873)
+++ samples/managedresourcestore/src/com/google/gwt/gears/sample/managedresourcestore/public/ManagedResourceStoreDemo_offline.html	(working copy)
@@ -1,16 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml";>
-<head>
-<title></title>
-</head>
-<body>
-<script type="text/javascript" language='javascript'
+  <head>
+    <title>Gears Library for GWT - ResourceStoreDemo (Offline)</title>
+    <style type="text/css">
+.outer-page-div {
+	margin: 15px;
+}
+    </style>
+    <script type="text/javascript" language='javascript'
 	src='com.google.gwt.gears.sample.managedresourcestore.ManagedResourceStoreDemo.nocache.js'></script>
+  </head>
+  <body>
+    <div class="outer-page-div">
+      <h1>ManagedResourceStore Demo (Offline)</h1>
 
-<h1>ManagedResourceStore Demo (Offline)</h1>
-
-<p>If you can see this page, the application is now being served by
+      <p>If you can see this page, the application is now being served by
 a ManagedResourceStore.</p>
-</body>
+      <div id="demo"></div>
+    </div>
+  </body>
 </html>

Reply via email to