Revision: 6359 Author: [email protected] Date: Tue Oct 13 12:43:03 2009 Log: Final changes from review feedback.
Patch by: jat Review by: rdayal, jlabanca http://code.google.com/p/google-web-toolkit/source/detail?r=6359 Modified: /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/CloseModuleCallback.java /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/DevModeUI.java /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/UiEvent.java /changes/jat/abstractui/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java Tue Oct 13 11:08:52 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/HostedModeBase.java Tue Oct 13 12:43:03 2009 @@ -108,6 +108,7 @@ String remoteSocket = serverChannel.getRemoteEndpoint(); ModuleHandle module = ui.loadModule(userAgent, remoteSocket, url, tabKey, moduleName, sessionKey, agentTag, userAgentIcon, maxLevel); + // TODO(jat): add support for closing an active module logger = module.getLogger(); try { // Try to find an existing loaded version of the module def. @@ -627,7 +628,7 @@ } /** - * Callback for the UI to indicate it is down. + * Callback for the UI to indicate it is done. */ public void onDone() { setDone(); ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java Tue Oct 13 11:08:52 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/SwingUI.java Tue Oct 13 12:43:03 2009 @@ -210,6 +210,7 @@ public ModuleHandle loadModule(String userAgent, String remoteSocket, String url, String tabKey, String moduleName, String sessionKey, String agentTag, byte[] agentIcon, TreeLogger.Type logLevel) { + // TODO(jat): add support for closing an active module ModuleTabPanel tabPanel = null; ModulePanel tab = null; tabPanel = findModuleTab(userAgent, remoteSocket, url, tabKey, ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/CloseModuleCallback.java Tue Oct 13 11:08:52 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/CloseModuleCallback.java Tue Oct 13 12:43:03 2009 @@ -23,7 +23,7 @@ public interface CloseModuleCallback extends UiCallback { /** - * The user has requested the a module should be closed. In the event the + * The user has requested that a module should be closed. In the event the * user closes multiple modules at once (such as closing one window or tab in * the UI), there will be separate calls for each one. * ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/DevModeUI.java Tue Oct 13 11:08:52 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/DevModeUI.java Tue Oct 13 12:43:03 2009 @@ -44,8 +44,8 @@ /** * Map of callbacks. */ - private final Map<UiEvent.Type<?>, UiCallback> callbacks = new HashMap< - UiEvent.Type<?>, UiCallback>(); + private final Map<UiEvent.Type<? extends UiCallback>, UiCallback> callbacks + = new HashMap<UiEvent.Type<? extends UiCallback>, UiCallback>(); /** * A lazily-initialized console logger - see {...@link #getConsoleLogger()}. @@ -99,6 +99,10 @@ /** * Show that a module is loaded in the UI. * + * <p>Note that the {...@link CloseModuleEvent} should already have a callback + * registered when this is called if needed -- the UI is not required to + * change the UI if it is registered later. + * * @param userAgent full user agent name * @param remoteSocket name of remote socket endpoint in host:port format * @param url URL of top-level window @@ -174,7 +178,8 @@ * @param eventType type of event * @return true if a callback has been registered for event */ - protected final boolean hasCallback(UiEvent.Type<?> eventType) { + protected final boolean hasCallback( + UiEvent.Type<? extends UiCallback> eventType) { return callbacks.get(eventType) != null; } } ======================================= --- /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/UiEvent.java Tue Oct 13 11:08:52 2009 +++ /changes/jat/abstractui/dev/core/src/com/google/gwt/dev/ui/UiEvent.java Tue Oct 13 12:43:03 2009 @@ -32,27 +32,11 @@ */ public static class Type<C> { - private static int nextId = 0; - - private final int id; private final String name; protected Type(String name) { - id = nextId++; this.name = name; } - - @Override - public boolean equals(Object obj) { - // Since we require only one instance of each type object to be created, - // identity is safe here. - return this == obj; - } - - @Override - public int hashCode() { - return id; - } @Override public String toString() { ======================================= --- /changes/jat/abstractui/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java Thu Oct 8 14:16:26 2009 +++ /changes/jat/abstractui/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java Tue Oct 13 12:43:03 2009 @@ -195,18 +195,14 @@ for (String browserName : args.split(",")) { BrowserVersion browser = BROWSER_MAP.get(browserName); if (browser == null) { - getLogger().log(TreeLogger.WARN, "RunStyleHtmlUnit: Ignoring unknown " - + "browser name " + browserName + ", expected browser name: one of " + getLogger().log(TreeLogger.ERROR, "RunStyleHtmlUnit: Unknown browser " + + "name " + browserName + ", expected browser name: one of " + BROWSER_MAP.keySet()); + return false; } else { browserSet.add(browser); } } - if (browserSet.isEmpty()) { - getLogger().log(TreeLogger.WARN, - "RunStyleHtmlUnit: No valid browser names, using FF3"); - browserSet.add(BrowserVersion.FIREFOX_3); - } browsers = Collections.unmodifiableSet(browserSet); return true; } --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
