Revision: 6433 Author: [email protected] Date: Tue Oct 20 20:00:53 2009 Log: Cherrypick tr...@6432 was merged into this branch, Merge branch 'remote-ui-communication' at r6431 into trunk. svn merge --ignore_ancestry -c 6432 https://google-web-toolkit.googlecode.com/svn/trunk .
http://code.google.com/p/google-web-toolkit/source/detail?r=6433 Added: /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui /releases/2.0/dev/core/test/com/google/gwt/dev/shell/remoteui Modified: /releases/2.0/branch-info.txt /releases/2.0/dev/build.xml /releases/2.0/dev/core/src/com/google/gwt/dev/DevModeBase.java /releases/2.0/distro-source/core/src/COPYING /releases/2.0/distro-source/core/src/COPYING.html /releases/2.0/distro-source/core/src/about.html /releases/2.0/distro-source/core/src/about.txt /releases/2.0/eclipse/dev/.classpath Replaced: /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/DevModeServiceRequestProcessor.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/MessageTransport.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RemoteMessageProto.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RemoteUI.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/RequestProcessor.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/ViewerServiceClient.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/ViewerServiceTreeLogger.java /releases/2.0/dev/core/src/com/google/gwt/dev/shell/remoteui/remotemessage.proto /releases/2.0/dev/core/test/com/google/gwt/dev/shell/remoteui/MessageTransportTest.java ======================================= --- /releases/2.0/branch-info.txt Tue Oct 20 16:10:57 2009 +++ /releases/2.0/branch-info.txt Tue Oct 20 20:00:53 2009 @@ -12,3 +12,7 @@ tr...@6429 was merged into this branch, Bugfix when rewriting static calls with JMultiExpr qualifiers svn merge --ignore_ancestry -c 6429 https://google-web-toolkit.googlecode.com/svn/trunk . + +tr...@6432 was merged into this branch, Merge branch 'remote-ui-communication' at r6431 into trunk. + svn merge --ignore_ancestry -c 6432 https://google-web-toolkit.googlecode.com/svn/trunk . + ======================================= --- /releases/2.0/dev/build.xml Fri Oct 16 22:24:33 2009 +++ /releases/2.0/dev/build.xml Tue Oct 20 20:00:53 2009 @@ -38,6 +38,7 @@ <include name="apache/ant-1.6.5.jar" /> <include name="eclipse/jdt-3.4.2.jar" /> <include name="jetty/jetty-6.1.11.jar" /> + <include name="protobuf/protobuf-2.2.0/protobuf-java-2.2.0.jar" /> <include name="tomcat/ant-launcher-1.6.5.jar" /> <include name="tomcat/catalina-1.0.jar" /> <include name="tomcat/catalina-optional-1.0.jar" /> @@ -93,6 +94,7 @@ <zipfileset src="${gwt.tools.lib}/apache/ant-1.6.5.jar" /> <zipfileset src="${gwt.tools.lib}/eclipse/jdt-3.4.2.jar" /> <zipfileset src="${gwt.tools.lib}/jetty/jetty-6.1.11.jar" /> + <zipfileset src="${gwt.tools.lib}/protobuf/protobuf-2.2.0/protobuf-java-2.2.0.jar" /> <zipfileset src="${gwt.tools.lib}/tomcat/ant-launcher-1.6.5.jar" /> <zipfileset src="${gwt.tools.lib}/tomcat/catalina-1.0.jar" /> <zipfileset src="${gwt.tools.lib}/tomcat/catalina-optional-1.0.jar" /> ======================================= --- /releases/2.0/dev/core/src/com/google/gwt/dev/DevModeBase.java Fri Oct 16 20:22:17 2009 +++ /releases/2.0/dev/core/src/com/google/gwt/dev/DevModeBase.java Tue Oct 20 20:00:53 2009 @@ -31,6 +31,7 @@ import com.google.gwt.dev.shell.ModuleSpaceHost; import com.google.gwt.dev.shell.OophmSessionHandler; import com.google.gwt.dev.shell.ShellModuleSpaceHost; +import com.google.gwt.dev.shell.remoteui.RemoteUI; import com.google.gwt.dev.ui.DevModeUI; import com.google.gwt.dev.ui.DoneCallback; import com.google.gwt.dev.ui.DoneEvent; @@ -200,6 +201,7 @@ public String getTag() { return "-logdir"; } + @Override public String[] getTagArgs() { return new String[] {"directory"}; @@ -332,6 +334,54 @@ return true; } } + + protected static class ArgHandlerRemoteUI extends ArgHandlerString { + + private final OptionUI options; + + public ArgHandlerRemoteUI(OptionUI options) { + this.options = options; + } + + @Override + public String getPurpose() { + return "Sends Development Mode UI event information to the specified host and port."; + } + + @Override + public String getTag() { + return "-remoteUI"; + } + + @Override + public String[] getTagArgs() { + return new String[] {"port-number | host-string:port-number"}; + } + + @Override + public boolean setString(String str) { + String[] split = str.split(":"); + String hostStr = "localhost"; + String portStr = null; + + if (split.length > 1) { + hostStr = split[0]; + portStr = split[1]; + } else { + portStr = split[0]; + } + + try { + RemoteUI remoteUI = new RemoteUI(hostStr, Integer.parseInt(portStr)); + options.setUI(remoteUI); + } catch (NumberFormatException nfe) { + System.err.println("A port must be an integer"); + return false; + } + + return true; + } + } /** * Handles the -whitelist command line flag. @@ -360,13 +410,13 @@ protected interface HostedModeBaseOptions extends JJSOptions, OptionLogDir, OptionLogLevel, OptionGenDir, OptionNoServer, OptionPort, - OptionPortHosted, OptionStartupURLs { + OptionPortHosted, OptionStartupURLs, OptionUI { /** * The base shell work directory. * - * @param moduleDef - * @return working directory base + * @param moduleDef + * @return working directory base */ File getShellBaseWorkDir(ModuleDef moduleDef); } @@ -377,6 +427,7 @@ protected static class HostedModeBaseOptionsImpl extends PrecompileOptionsImpl implements HostedModeBaseOptions { + private DevModeUI ui; private boolean isNoServer; private File logDir; private int port; @@ -417,6 +468,10 @@ public List<String> getStartupURLs() { return Collections.unmodifiableList(startupURLs); } + + public DevModeUI getUI() { + return ui; + } public boolean isNoServer() { return isNoServer; @@ -437,6 +492,10 @@ public void setPortHosted(int port) { portHosted = port; } + + public void setUI(DevModeUI ui) { + this.ui = ui; + } } /** @@ -452,7 +511,6 @@ void setLogFile(String filename); } - /** * Controls whether to run a server or not. @@ -488,6 +546,15 @@ List<String> getStartupURLs(); } + + /** + * Controls the UI that should be used to display the dev mode server's data. + */ + protected interface OptionUI { + DevModeUI getUI(); + + void setUI(DevModeUI ui); + } abstract static class ArgProcessor extends ArgProcessorBase { public ArgProcessor(HostedModeBaseOptions options, boolean forceServer) { @@ -507,8 +574,7 @@ registerHandler(new ArgHandlerDisableCastChecking(options)); registerHandler(new ArgHandlerDraftCompile(options)); registerHandler(new ArgHandlerPortHosted(options)); - // TODO(rdayal): implement - // registerHandler(new ArgHandlerRemoteUI(options)); + registerHandler(new ArgHandlerRemoteUI(options)); } } @@ -538,12 +604,14 @@ /** * Produce a random string that has low probability of collisions. * - * <p>In this case, we use 16 characters, each drawn from a pool of 94, - * so the number of possible values is 94^16, leading to an expected number - * of values used before a collision occurs as sqrt(pi/2) * 94^8 (treated the - * same as a birthday attack), or a little under 10^16. + * <p> + * In this case, we use 16 characters, each drawn from a pool of 94, so the + * number of possible values is 94^16, leading to an expected number of values + * used before a collision occurs as sqrt(pi/2) * 94^8 (treated the same as a + * birthday attack), or a little under 10^16. * - * <p>This algorithm is also implemented in hosted.html, though it is not + * <p> + * This algorithm is also implemented in hosted.html, though it is not * technically important that they match. * * @return a random string @@ -602,11 +670,11 @@ public TreeLogger getTopLogger() { return topLogger; } - + /** * Launch the arguments as Urls in separate windows. * - * @param logger TreeLogger instance to use + * @param logger TreeLogger instance to use */ public void launchStartupUrls(final TreeLogger logger) { ensureCodeServerListener(); @@ -626,7 +694,7 @@ public final String normalizeURL(String unknownUrlText) { return normalizeURL(unknownUrlText, getPort(), getHost()); } - + /** * Callback for the UI to indicate it is done. */ @@ -715,8 +783,9 @@ * Perform any startup tasks, including initializing the UI (if any) and the * logger, updates checker, and the development mode code server. * - * <p>Subclasses that override this method should be careful what facilities - * are used before the super implementation is called. + * <p> + * Subclasses that override this method should be careful what facilities are + * used before the super implementation is called. * * @return true if startup was successful */ @@ -727,11 +796,10 @@ // Set done callback ui.setCallback(DoneEvent.getType(), this); - + // Check for updates final TreeLogger logger = getTopLogger(); - final CheckForUpdates updateChecker - = CheckForUpdates.createUpdateChecker(logger); + final CheckForUpdates updateChecker = CheckForUpdates.createUpdateChecker(logger); if (updateChecker != null) { Thread checkerThread = new Thread("GWT Update Checker") { @Override @@ -810,7 +878,7 @@ String path = parsedUrl.getPath(); String query = parsedUrl.getQuery(); String hash = parsedUrl.getRef(); - String hostedParam = "gwt.hosted=" + listener.getEndpointIdentifier(); + String hostedParam = "gwt.hosted=" + listener.getEndpointIdentifier(); if (query == null) { query = hostedParam; } else { @@ -826,8 +894,7 @@ getTopLogger().log(TreeLogger.ERROR, "Invalid URL " + url, e); throw new UnableToCompleteException(); } - System.err.println( - "Using a browser with the GWT Development Plugin, please browse to"); + System.err.println("Using a browser with the GWT Development Plugin, please browse to"); System.err.println("the following URL:"); System.err.println(" " + url); getTopLogger().log(TreeLogger.INFO, @@ -872,6 +939,9 @@ if (started) { throw new IllegalStateException("Startup code has already been run"); } + + // See if there was a UI specified by command-line args + ui = options.getUI(); // If no UI was specified by command-line args, then create one. if (ui == null) { @@ -894,8 +964,8 @@ return false; } options.setPort(resultPort); - getTopLogger().log(TreeLogger.INFO, "Started web server on port " - + resultPort); + getTopLogger().log(TreeLogger.INFO, + "Started web server on port " + resultPort); } return true; ======================================= --- /releases/2.0/distro-source/core/src/COPYING Tue May 19 08:35:33 2009 +++ /releases/2.0/distro-source/core/src/COPYING Tue Oct 20 20:00:53 2009 @@ -246,3 +246,10 @@ Source code availability: http://developer.mozilla.org/en/docs/Download_Mozilla_Source_Code +* Protobuf + License: New BSD License + http://www.opensource.org/licenses/bsd-license.php + Source code availablility: + http://code.google.com/p/protobuf/source/checkout + + ======================================= --- /releases/2.0/distro-source/core/src/COPYING.html Tue May 19 08:35:33 2009 +++ /releases/2.0/distro-source/core/src/COPYING.html Tue Oct 20 20:00:53 2009 @@ -333,6 +333,11 @@ <td class="license"><a href="http://www.mozilla.org/MPL/MPL-1.1.txt">Mozilla Public License v. 1.1</a></td> <td class="location"><a href="http://developer.mozilla.org/en/docs/Download_Mozilla_Source_Code">mozilla.org</a></td> </tr> + <tr> + <td class="package">Protobuf</td> + <td class="license"><a href="http://www.opensource.org/licenses/bsd-license.php">New BSD License</a></td> + <td class="location"><a href="http://code.google.com/p/protobuf/source/checkout">code.google.com/p/protobuf</a></td> + </tr> </tbody></table> </div> ======================================= --- /releases/2.0/distro-source/core/src/about.html Tue May 19 08:35:33 2009 +++ /releases/2.0/distro-source/core/src/about.html Tue Oct 20 20:00:53 2009 @@ -95,6 +95,7 @@ <li><a href="http://selenium-rc.openqa.org/">Selenium-RC</a> </li> </ul> </li> + <li>The <a href="http://code.google.com/p/protobuf/">Protobuf Project</a></li> </ul> For source availability and license information see COPYING.html. ======================================= --- /releases/2.0/distro-source/core/src/about.txt Tue May 19 08:35:33 2009 +++ /releases/2.0/distro-source/core/src/about.txt Tue Oct 20 20:00:53 2009 @@ -20,5 +20,6 @@ - ASM (http://asm.objectweb.org/) with modifications - The OpenQA Project (http://openqa.org/) - Selenium-RC (http://selenium-rc.openqa.org/) + - The Protobuf Project (http://code.google.com/p/protobuf/) For source availability and license information see COPYING. ======================================= --- /releases/2.0/eclipse/dev/.classpath Fri Oct 16 22:24:33 2009 +++ /releases/2.0/eclipse/dev/.classpath Tue Oct 20 20:00:53 2009 @@ -39,5 +39,6 @@ <classpathentry kind="var" path="GWT_TOOLS/lib/sun/swingworker/swing-worker-1.1.jar"/> <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070-sources.jar"/> <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5070-sources.jar"/> + <classpathentry kind="var" path="GWT_TOOLS/lib/protobuf/protobuf-2.2.0/protobuf-java-2.2.0.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
