Merge from releases/1.6:r4198:4268,4269:4297,4299:4320:4321:4366 into trunk
svn merge -r4198:4269 https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
svn merge -r4269:4297 https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
svn merge -r4299:4320 https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
svn merge -r4321:4366 https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@4367 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build.xml b/build.xml
index 75f1936..f37a84e 100755
--- a/build.xml
+++ b/build.xml
@@ -9,7 +9,7 @@
<property name="gwt.apicheck.config"
location="tools/api-checker/config/gwt15_16userApi.conf"/>
<property name="gwt.apicheck.oldroot"
- location="../gwt-1.5"/>
+ value="../gwt-1.5"/>
<target name="buildonly" depends="dev, user, servlet, jni" description="Build without docs/samples">
<gwt.ant dir="distro-source" />
@@ -87,6 +87,8 @@
</copy>
<java failonerror="true" fork="true"
classname="com.google.gwt.tools.apichecker.ApiCompatibilityChecker">
+ <jvmarg line="-Xmx512m" />
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
<classpath>
<pathelement location="${gwt.build.out}/tools/api-checker/bin"/>
<pathelement location="${gwt.build.out}/dev/core/bin"/>
@@ -94,6 +96,7 @@
<pathelement location="${gwt.tools.lib}/eclipse/jdt-3.3.1.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
+ <arg value="-configFile"/>
<arg file="${gwt.build.out}/userApi.conf"/>
</java>
</target>
diff --git a/dev/core/build.xml b/dev/core/build.xml
index e5090e6..2ca8b9a 100755
--- a/dev/core/build.xml
+++ b/dev/core/build.xml
@@ -25,7 +25,7 @@
<gwt.jar destfile="${alldeps.jar}">
<zipfileset src="${gwt.tools.lib}/apache/tapestry-util-text-4.0.2.jar" />
<zipfileset src="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
- <zipfileset src="${gwt.tools.lib}/eclipse/jdt-3.3.1.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}/tomcat/ant-launcher-1.6.5.jar" />
<zipfileset src="${gwt.tools.lib}/tomcat/catalina-1.0.jar" />
diff --git a/dev/core/src/com/google/gwt/core/ext/LinkerContext.java b/dev/core/src/com/google/gwt/core/ext/LinkerContext.java
index 120de31..7f1d37f 100644
--- a/dev/core/src/com/google/gwt/core/ext/LinkerContext.java
+++ b/dev/core/src/com/google/gwt/core/ext/LinkerContext.java
@@ -40,6 +40,13 @@
String getModuleFunctionName();
/**
+ * Returns the time at which the module being compiled was last modified. Can
+ * be used to set an appropriate timestamp on artifacts which depend solely on
+ * the module definition.
+ */
+ long getModuleLastModified();
+
+ /**
* Returns the name of the module being compiled.
*/
String getModuleName();
diff --git a/dev/core/src/com/google/gwt/dev/shell/ServletContainer.java b/dev/core/src/com/google/gwt/core/ext/ServletContainer.java
similarity index 67%
rename from dev/core/src/com/google/gwt/dev/shell/ServletContainer.java
rename to dev/core/src/com/google/gwt/core/ext/ServletContainer.java
index 732998a..acd2a25 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ServletContainer.java
+++ b/dev/core/src/com/google/gwt/core/ext/ServletContainer.java
@@ -13,23 +13,28 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.dev.shell;
-
-import com.google.gwt.core.ext.UnableToCompleteException;
+package com.google.gwt.core.ext;
/**
* An instance of a servlet container that can be used by the shell. It is
- * assumed that this servlet container serves a web app from the root directory
- * specified by a call to
- * {@link ServletContainerLauncher#setAppRootDir(java.io.File)}.
+ * assumed that this servlet container serves a web app from the directory
+ * specified when this servlet container was created.
*/
-public interface ServletContainer {
+public abstract class ServletContainer {
/**
- * Provides the port on which the server is actually running, which can be
- * useful when automatic port selection was requested.
+ * Returns the host on which the servlet container is running. Defaults to
+ * "localhost". Used to construct a URL to reach the servlet container.
*/
- int getPort();
+ public String getHost() {
+ return "localhost";
+ }
+
+ /**
+ * Returns the port on which the server is running.Used to construct a URL to
+ * reach the servlet container.
+ */
+ public abstract int getPort();
/**
* Causes the web app to pick up changes made within the app root dir while
@@ -42,12 +47,12 @@
*
* @throws UnableToCompleteException
*/
- void refresh() throws UnableToCompleteException;
+ public abstract void refresh() throws UnableToCompleteException;
/**
* Stops the running servlet container. It cannot be restarted after this.
*
* @throws UnableToCompleteException
*/
- void stop() throws UnableToCompleteException;
+ public abstract void stop() throws UnableToCompleteException;
}
diff --git a/dev/core/src/com/google/gwt/dev/shell/ServletContainerLauncher.java b/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java
similarity index 64%
rename from dev/core/src/com/google/gwt/dev/shell/ServletContainerLauncher.java
rename to dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java
index d9ef731..0785fb1 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ServletContainerLauncher.java
+++ b/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java
@@ -13,33 +13,28 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.dev.shell;
-
-import com.google.gwt.core.ext.TreeLogger;
+package com.google.gwt.core.ext;
import java.io.File;
import java.net.BindException;
-import javax.servlet.Filter;
-
/**
* Defines the service provider interface for launching servlet containers that
- * can be used by the shell.
+ * can be used by the GWT hosted mode.
*/
-public interface ServletContainerLauncher {
+public abstract class ServletContainerLauncher {
/**
- * Start an embedded HTTP server.
+ * Start an embedded HTTP servlet container.
*
* @param logger the server logger
- * @param port the TCP port to serve on
+ * @param port the TCP port to serve on; if 0 is requested, a port should be
+ * automatically selected
* @param appRootDir the base WAR directory
- * @param filter a servlet filter that must be installed on the root path to
- * serve generated files
- * @return the launch servlet contained
+ * @return the launched servlet container
* @throws BindException if the requested port is already in use
* @throws Exception if the server fails to start for any other reason
*/
- ServletContainer start(TreeLogger logger, int port, File appRootDir,
- Filter filter) throws BindException, Exception;
+ public abstract ServletContainer start(TreeLogger logger, int port,
+ File appRootDir) throws BindException, Exception;
}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/AbstractLinker.java b/dev/core/src/com/google/gwt/core/ext/linker/AbstractLinker.java
index a45e34c..06b9549 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/AbstractLinker.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/AbstractLinker.java
@@ -42,6 +42,21 @@
}
/**
+ * A helper method to create an artifact from an array of bytes.
+ *
+ * @param logger a TreeLogger
+ * @param what the data to emit
+ * @param partialPath the partial path of the resource
+ * @return an artifact that contains the given data
+ * @param lastModified the last modified time of the new artifact
+ * @throws UnableToCompleteException
+ */
+ protected final SyntheticArtifact emitBytes(TreeLogger logger, byte[] what,
+ String partialPath, long lastModified) throws UnableToCompleteException {
+ return new SyntheticArtifact(logger, getClass(), partialPath, what, lastModified);
+ }
+
+ /**
* A helper method to create an artifact to emit the contents of an
* InputStream.
*
@@ -54,8 +69,25 @@
InputStream what, String partialPath) throws UnableToCompleteException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
Util.copy(logger, what, out);
- return new SyntheticArtifact(logger, getClass(), partialPath,
- out.toByteArray());
+ return emitBytes(logger, out.toByteArray(), partialPath);
+ }
+
+ /**
+ * A helper method to create an artifact to emit the contents of an
+ * InputStream.
+ *
+ * @param logger a TreeLogger
+ * @param what the source InputStream
+ * @param partialPath the partial path of the emitted resource
+ * @param lastModified the last modified time of the new artifact
+ * @return an artifact that contains the contents of the InputStream
+ */
+ protected final SyntheticArtifact emitInputStream(TreeLogger logger,
+ InputStream what, String partialPath, long lastModified)
+ throws UnableToCompleteException {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ Util.copy(logger, what, out);
+ return emitBytes(logger, out.toByteArray(), partialPath, lastModified);
}
/**
@@ -72,6 +104,20 @@
}
/**
+ * A helper method to create an artifact to emit a String.
+ *
+ * @param logger a TreeLogger
+ * @param what the contents of the Artifact to emit
+ * @param partialPath the partial path of the emitted resource
+ * @param lastModified the last modified time of the new artifact
+ * @return an artifact that contains the contents of the given String
+ */
+ protected final SyntheticArtifact emitString(TreeLogger logger, String what,
+ String partialPath, long lastModified) throws UnableToCompleteException {
+ return emitBytes(logger, Util.getBytes(what), partialPath, lastModified);
+ }
+
+ /**
* A helper method to create an artifact from an array of bytes with a strong
* name.
*
@@ -89,4 +135,24 @@
String strongName = prefix + Util.computeStrongName(what) + suffix;
return emitBytes(logger, what, strongName);
}
+
+ /**
+ * A helper method to create an artifact from an array of bytes with a strong
+ * name.
+ *
+ * @param logger a TreeLogger
+ * @param what the data to emit
+ * @param prefix a non-null string to prepend to the hash to determine the
+ * Artifact's partial path
+ * @param suffix a non-null string to append to the hash to determine the
+ * Artifact's partial path
+ * @param lastModified the last modified time of the new artifact
+ * @return an artifact that contains the given data
+ */
+ protected final SyntheticArtifact emitWithStrongName(TreeLogger logger,
+ byte[] what, String prefix, String suffix, long lastModified)
+ throws UnableToCompleteException {
+ String strongName = prefix + Util.computeStrongName(what) + suffix;
+ return emitBytes(logger, what, strongName, lastModified);
+ }
}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java b/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
index 96bc46b..6dc780f 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
@@ -53,6 +53,20 @@
throws UnableToCompleteException;
/**
+ * Returns the time, measured in milliseconds from the epoch, at which the
+ * Artifact was last modified. This will be used to set the last-modified
+ * timestamp on the files written to disk.
+ * <p>
+ * The default implementation always returns the current time. Subclasses
+ * should override this method to provide a type-appropriate value.
+ *
+ * @return the time at which the Artifact was last modified
+ */
+ public long getLastModified() {
+ return System.currentTimeMillis();
+ }
+
+ /**
* Returns the partial path within the output directory of the
* EmittedArtifact.
*/
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java b/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
index eed6c6a..f46c7c2 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
@@ -30,9 +30,15 @@
*/
public class SyntheticArtifact extends EmittedArtifact {
private final File backing;
+ private final long lastModified;
SyntheticArtifact(TreeLogger logger, Class<? extends Linker> linkerType,
String partialPath, byte[] data) throws UnableToCompleteException {
+ this(logger, linkerType, partialPath, data, System.currentTimeMillis());
+ }
+
+ SyntheticArtifact(TreeLogger logger, Class<? extends Linker> linkerType, String partialPath,
+ byte[] data, long lastModified) throws UnableToCompleteException {
super(linkerType, partialPath);
assert data != null;
@@ -45,6 +51,7 @@
+ partialPath, e);
throw new UnableToCompleteException();
}
+ this.lastModified = lastModified;
}
@Override
@@ -58,4 +65,9 @@
throw new UnableToCompleteException();
}
}
-}
\ No newline at end of file
+
+ @Override
+ public long getLastModified() {
+ return lastModified;
+ }
+}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
index a527c56..c7e3a69 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java
@@ -140,10 +140,23 @@
LinkerContext context, ArtifactSet artifacts)
throws UnableToCompleteException {
String selectionScript = generateSelectionScript(logger, context, artifacts);
- byte[] selectionScriptBytes = Util.getBytes(context.optimizeJavaScript(
- logger, selectionScript));
- return emitBytes(logger, selectionScriptBytes, context.getModuleName()
- + ".nocache.js");
+ selectionScript = context.optimizeJavaScript(logger, selectionScript);
+
+ /*
+ * Last modified is important to keep hosted mode refreses from clobbering
+ * web mode compiles. We set the timestamp on the hosted mode selection
+ * script to the same mod time as the module (to allow updates). For web
+ * mode, we just set it to now.
+ */
+ long lastModified;
+ if (artifacts.find(CompilationResult.class).size() == 0) {
+ lastModified = context.getModuleLastModified();
+ } else {
+ lastModified = System.currentTimeMillis();
+ }
+
+ return emitString(logger, selectionScript, context.getModuleName()
+ + ".nocache.js", lastModified);
}
protected String generatePropertyProvider(SelectionProperty prop) {
@@ -246,9 +259,12 @@
if (startPos != -1) {
StringBuffer text = new StringBuffer();
if (compilations.size() == 0) {
- // We'll see this when running in Hosted Mode. The way the selection
- // templates are structured is such that this line won't be executed
- text.append("strongName = null;");
+ // Hosted mode link.
+ text.append("alert(\"GWT module '"
+ + context.getModuleName()
+ + "' needs to be (re)compiled, "
+ + "please run a compile or use the Compile/Browse button in hosted mode\");");
+ text.append("return;");
} else if (compilations.size() == 1) {
// Just one distinct compilation; no need to evaluate properties
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
index d520f33..c27a7af 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
@@ -20,30 +20,36 @@
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.GeneratedResource;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
/**
* The standard implementation of {@link GeneratedResource}.
*/
public class StandardGeneratedResource extends GeneratedResource {
- private final URL url;
+ private final File file;
public StandardGeneratedResource(Class<? extends Generator> generatorType,
- String partialPath, URL url) {
+ String partialPath, File file) {
super(StandardLinkerContext.class, generatorType, partialPath);
- this.url = url;
+ this.file = file;
}
@Override
public InputStream getContents(TreeLogger logger)
throws UnableToCompleteException {
try {
- return url.openStream();
+ return new FileInputStream(file);
} catch (IOException e) {
logger.log(TreeLogger.ERROR, "Unable to open file", e);
throw new UnableToCompleteException();
}
}
+
+ @Override
+ public long getLastModified() {
+ return file.lastModified();
+ }
}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
index 1a4e649..454f648 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
@@ -117,6 +117,7 @@
private final Map<Class<? extends Linker>, String> linkerShortNames = new HashMap<Class<? extends Linker>, String>();
private final String moduleFunctionName;
+ private final long moduleLastModified;
private final String moduleName;
private final Map<String, StandardSelectionProperty> propertiesByName = new HashMap<String, StandardSelectionProperty>();
@@ -133,6 +134,7 @@
this.jjsOptions = jjsOptions;
this.moduleFunctionName = module.getFunctionName();
this.moduleName = module.getName();
+ this.moduleLastModified = module.lastModified();
// Sort the linkers into the order they should actually run.
List<Class<? extends Linker>> sortedLinkers = new ArrayList<Class<? extends Linker>>();
@@ -302,6 +304,10 @@
return moduleFunctionName;
}
+ public long getModuleLastModified() {
+ return moduleLastModified;
+ }
+
public String getModuleName() {
return moduleName;
}
@@ -452,10 +458,11 @@
outFile = new File(outputPath, artifact.getPartialPath());
}
- // TODO(scottb): figure out how to do a clean.
- // assert !outFile.exists() : "Attempted to overwrite " +
- // outFile.getPath();
- Util.copy(artifactLogger, artifact.getContents(artifactLogger), outFile);
+ if (!outFile.exists()
+ || (outFile.lastModified() <= artifact.getLastModified())) {
+ Util.copy(artifactLogger, artifact.getContents(artifactLogger), outFile);
+ outFile.setLastModified(artifact.getLastModified());
+ }
}
}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardPublicResource.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardPublicResource.java
index 2a1a0bd..78431c3 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardPublicResource.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardPublicResource.java
@@ -37,10 +37,13 @@
*/
private static final class SerializedPublicResource extends PublicResource {
private final byte[] data;
+ private final long lastModified;
- protected SerializedPublicResource(String partialPath, byte[] data) {
+ protected SerializedPublicResource(String partialPath, byte[] data,
+ long lastModified) {
super(StandardLinkerContext.class, partialPath);
this.data = data;
+ this.lastModified = lastModified;
}
@Override
@@ -48,6 +51,11 @@
throws UnableToCompleteException {
return new ByteArrayInputStream(data);
}
+
+ @Override
+ public long getLastModified() {
+ return lastModified;
+ }
}
private final Resource resource;
@@ -63,6 +71,11 @@
return resource.openContents();
}
+ @Override
+ public long getLastModified() {
+ return resource.getLastModified();
+ }
+
private Object writeReplace() {
if (resource instanceof Serializable) {
return this;
@@ -71,7 +84,8 @@
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Util.copy(resource.openContents(), baos);
- return new SerializedPublicResource(getPartialPath(), baos.toByteArray());
+ return new SerializedPublicResource(getPartialPath(), baos.toByteArray(),
+ getLastModified());
} catch (IOException e) {
throw new RuntimeException(e);
}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html b/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html
index d02be07..aeec95e 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html
@@ -17,7 +17,7 @@
function gwtOnLoad(errFn, modName, modBase){
$moduleName = modName;
$moduleBase = modBase;
- if (!external.gwtOnLoad(window, modName, "1.5")) {
+ if (!external.gwtOnLoad(window, modName, "1.6")) {
if (errFn) {
errFn(modName);
}
@@ -29,7 +29,7 @@
};
window.onunload = function() {
- external.gwtOnLoad(window, null, "1.5");
+ external.gwtOnLoad(window, null, "1.6");
};
window.__gwt_module_id = 0;
diff --git a/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java b/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
index 8e54d8f..f5787fc 100644
--- a/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
+++ b/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
@@ -19,15 +19,18 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.ArtifactSet;
+import com.google.gwt.core.ext.linker.EmittedArtifact;
import com.google.gwt.core.ext.linker.LinkerOrder;
import com.google.gwt.core.ext.linker.LinkerOrder.Order;
+import com.google.gwt.core.ext.linker.impl.HostedModeLinker;
import com.google.gwt.core.ext.linker.impl.SelectionScriptLinker;
import com.google.gwt.dev.About;
import com.google.gwt.dev.util.DefaultTextOutput;
-import com.google.gwt.dev.util.Util;
-import com.google.gwt.util.tools.Utility;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
/**
* Implements the canonical GWT bootstrap sequence that loads the GWT module in
@@ -48,8 +51,34 @@
try {
// Add hosted mode iframe contents
// TODO move this into own impl package if HostedModeLinker goes away
- String hostedHtml = Utility.getFileFromClassPath("com/google/gwt/core/ext/linker/impl/hosted.html");
- toReturn.add(emitBytes(logger, Util.getBytes(hostedHtml), "hosted.html"));
+ URL resource = HostedModeLinker.class.getResource("hosted.html");
+ if (resource == null) {
+ logger.log(TreeLogger.ERROR,
+ "Unable to find support resource 'hosted.html'");
+ throw new UnableToCompleteException();
+ }
+
+ final URLConnection connection = resource.openConnection();
+ // TODO: extract URLArtifact class?
+ EmittedArtifact hostedHtml = new EmittedArtifact(IFrameLinker.class,
+ "hosted.html") {
+ @Override
+ public InputStream getContents(TreeLogger logger)
+ throws UnableToCompleteException {
+ try {
+ return connection.getInputStream();
+ } catch (IOException e) {
+ logger.log(TreeLogger.ERROR, "Unable to copy support resource", e);
+ throw new UnableToCompleteException();
+ }
+ }
+
+ @Override
+ public long getLastModified() {
+ return connection.getLastModified();
+ }
+ };
+ toReturn.add(hostedHtml);
} catch (IOException e) {
logger.log(TreeLogger.ERROR, "Unable to copy support resource", e);
throw new UnableToCompleteException();
diff --git a/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js b/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
index 2a2b937..6ce0131 100644
--- a/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
+++ b/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
@@ -65,6 +65,7 @@
// --------------- INTERNAL FUNCTIONS ---------------
function isHostedMode() {
+ var result = false;
try {
var query = $wnd.location.search;
return (query.indexOf('gwt.hosted=') != -1
@@ -73,8 +74,9 @@
} catch (e) {
// Defensive: some versions of IE7 reportedly can throw an exception
// evaluating "external.gwtOnLoad".
- return false;
}
+ isHostedMode = function() { return result; };
+ return result;
}
// Called by onScriptLoad(), onInjectionDone(), and onload(). It causes
@@ -340,6 +342,19 @@
// do it early for compile/browse rebasing
computeScriptBase();
+
+ var strongName;
+ var initialHtml;
+ if (isHostedMode()) {
+ if ($wnd.external.initModule && $wnd.external.initModule('__MODULE_NAME__')) {
+ // Refresh the page to update this selection script!
+ $wnd.location.reload();
+ return;
+ }
+ initialHtml = "hosted.html?__MODULE_FUNC__";
+ strongName = "";
+ }
+
processMetas();
// --------------- WINDOW ONLOAD HOOK ---------------
@@ -352,12 +367,7 @@
type: 'selectingPermutation'
});
- var strongName;
- var initialHtml;
- if (isHostedMode()) {
- initialHtml = "hosted.html?__MODULE_FUNC__";
- strongName = "";
- } else {
+ if (!isHostedMode()) {
try {
// __PERMUTATIONS_BEGIN__
// Permutation logic
diff --git a/dev/core/src/com/google/gwt/dev/ShellOptions.java b/dev/core/src/com/google/gwt/dev/ArgProcessorBase.java
similarity index 60%
copy from dev/core/src/com/google/gwt/dev/ShellOptions.java
copy to dev/core/src/com/google/gwt/dev/ArgProcessorBase.java
index 71ea4e8..3f38920 100644
--- a/dev/core/src/com/google/gwt/dev/ShellOptions.java
+++ b/dev/core/src/com/google/gwt/dev/ArgProcessorBase.java
@@ -15,15 +15,23 @@
*/
package com.google.gwt.dev;
-import com.google.gwt.dev.jjs.JJSOptions;
-import com.google.gwt.dev.util.arg.OptionExtraDir;
-import com.google.gwt.dev.util.arg.OptionGenDir;
-import com.google.gwt.dev.util.arg.OptionLogLevel;
-import com.google.gwt.dev.util.arg.OptionOutDir;
+import com.google.gwt.util.tools.ToolBase;
/**
- * The complete set of options for the GWT compiler.
+ * Base class for new-style argument processors.
*/
-public interface ShellOptions extends JJSOptions, OptionLogLevel, OptionOutDir,
- OptionGenDir, OptionExtraDir {
+abstract class ArgProcessorBase extends ToolBase {
+ /*
+ * Overridden to make public.
+ */
+ @Override
+ public final boolean processArgs(String[] args) {
+ return super.processArgs(args);
+ }
+
+ /*
+ * Made abstract to force override.
+ */
+ @Override
+ protected abstract String getName();
}
diff --git a/dev/core/src/com/google/gwt/dev/CompileArgProcessor.java b/dev/core/src/com/google/gwt/dev/CompileArgProcessor.java
index fdc5e99..56eb33c 100644
--- a/dev/core/src/com/google/gwt/dev/CompileArgProcessor.java
+++ b/dev/core/src/com/google/gwt/dev/CompileArgProcessor.java
@@ -19,24 +19,12 @@
import com.google.gwt.dev.util.arg.ArgHandlerModuleName;
import com.google.gwt.dev.util.arg.ArgHandlerTreeLoggerFlag;
import com.google.gwt.dev.util.arg.ArgHandlerWorkDirRequired;
-import com.google.gwt.util.tools.ToolBase;
-abstract class CompileArgProcessor extends ToolBase {
+abstract class CompileArgProcessor extends ArgProcessorBase {
public CompileArgProcessor(CompileTaskOptions options) {
registerHandler(new ArgHandlerLogLevel(options));
registerHandler(new ArgHandlerTreeLoggerFlag(options));
registerHandler(new ArgHandlerWorkDirRequired(options));
registerHandler(new ArgHandlerModuleName(options));
}
-
- /*
- * Overridden to make public.
- */
- @Override
- public final boolean processArgs(String[] args) {
- return super.processArgs(args);
- }
-
- @Override
- protected abstract String getName();
}
diff --git a/dev/core/src/com/google/gwt/dev/CompilePerms.java b/dev/core/src/com/google/gwt/dev/CompilePerms.java
index 106c2e1..a35da85 100644
--- a/dev/core/src/com/google/gwt/dev/CompilePerms.java
+++ b/dev/core/src/com/google/gwt/dev/CompilePerms.java
@@ -191,7 +191,7 @@
/**
* Compile multiple permutations.
*/
- public static boolean compile(TreeLogger logger,
+ public static void compile(TreeLogger logger,
Precompilation precompilation, Permutation[] perms, int localWorkers,
List<FileBackedObject<PermutationResult>> resultFiles)
throws UnableToCompleteException {
@@ -200,7 +200,6 @@
PermutationWorkerFactory.compilePermutations(logger, precompilation, perms,
localWorkers, resultFiles);
branch.log(TreeLogger.INFO, "Permutation compile succeeded");
- return true;
}
public static void main(String[] args) {
@@ -253,50 +252,54 @@
}
public boolean run(TreeLogger logger) throws UnableToCompleteException {
- File precompilationFile = new File(options.getCompilerWorkDir(),
- Precompile.PRECOMPILATION_FILENAME);
- if (!precompilationFile.exists()) {
- logger.log(TreeLogger.ERROR, "File not found '"
- + precompilationFile.getAbsolutePath()
- + "'; please run Precompile first");
- return false;
- }
- Precompilation precompilation;
- try {
- /*
- * TODO: don't bother deserializing the generated artifacts.
- */
- precompilation = Util.readFileAsObject(precompilationFile,
- Precompilation.class);
- } catch (ClassNotFoundException e) {
- logger.log(TreeLogger.ERROR, "Unable to deserialize '"
- + precompilationFile.getAbsolutePath() + "'", e);
- return false;
- }
-
- Permutation[] perms = precompilation.getPermutations();
- Permutation[] subPerms;
- int[] permsToRun = options.getPermsToCompile();
- if (permsToRun.length == 0) {
- subPerms = perms;
- } else {
- int i = 0;
- subPerms = new Permutation[permsToRun.length];
- // Range check the supplied perms.
- for (int permToRun : permsToRun) {
- if (permToRun >= perms.length) {
- logger.log(TreeLogger.ERROR, "The specified perm number '"
- + permToRun + "' is too big; the maximum value is "
- + (perms.length - 1) + "'");
- return false;
- }
- subPerms[i++] = perms[permToRun];
+ for (String moduleName : options.getModuleNames()) {
+ File compilerWorkDir = options.getCompilerWorkDir(moduleName);
+ File precompilationFile = new File(compilerWorkDir,
+ Precompile.PRECOMPILATION_FILENAME);
+ if (!precompilationFile.exists()) {
+ logger.log(TreeLogger.ERROR, "File not found '"
+ + precompilationFile.getAbsolutePath()
+ + "'; please run Precompile first");
+ return false;
}
- }
+ Precompilation precompilation;
+ try {
+ /*
+ * TODO: don't bother deserializing the generated artifacts.
+ */
+ precompilation = Util.readFileAsObject(precompilationFile,
+ Precompilation.class);
+ } catch (ClassNotFoundException e) {
+ logger.log(TreeLogger.ERROR, "Unable to deserialize '"
+ + precompilationFile.getAbsolutePath() + "'", e);
+ return false;
+ }
- List<FileBackedObject<PermutationResult>> resultFiles = makeResultFiles(
- options.getCompilerWorkDir(), perms);
- return compile(logger, precompilation, subPerms, options.getLocalWorkers(),
- resultFiles);
+ Permutation[] perms = precompilation.getPermutations();
+ Permutation[] subPerms;
+ int[] permsToRun = options.getPermsToCompile();
+ if (permsToRun.length == 0) {
+ subPerms = perms;
+ } else {
+ int i = 0;
+ subPerms = new Permutation[permsToRun.length];
+ // Range check the supplied perms.
+ for (int permToRun : permsToRun) {
+ if (permToRun >= perms.length) {
+ logger.log(TreeLogger.ERROR, "The specified perm number '"
+ + permToRun + "' is too big; the maximum value is "
+ + (perms.length - 1) + "'");
+ return false;
+ }
+ subPerms[i++] = perms[permToRun];
+ }
+ }
+
+ List<FileBackedObject<PermutationResult>> resultFiles = makeResultFiles(
+ compilerWorkDir, subPerms);
+ compile(logger, precompilation, subPerms, options.getLocalWorkers(),
+ resultFiles);
+ }
+ return true;
}
}
diff --git a/dev/core/src/com/google/gwt/dev/CompilePermsServer.java b/dev/core/src/com/google/gwt/dev/CompilePermsServer.java
index df14e98..3971ef7 100644
--- a/dev/core/src/com/google/gwt/dev/CompilePermsServer.java
+++ b/dev/core/src/com/google/gwt/dev/CompilePermsServer.java
@@ -24,7 +24,6 @@
import com.google.gwt.dev.util.arg.OptionLogLevel;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
import com.google.gwt.util.tools.ArgHandlerString;
-import com.google.gwt.util.tools.ToolBase;
import java.io.File;
import java.io.FileInputStream;
@@ -164,7 +163,7 @@
}
}
- static class ArgProcessor extends ToolBase {
+ static class ArgProcessor extends ArgProcessorBase {
public ArgProcessor(CompileServerOptions options) {
registerHandler(new ArgHandlerLogLevel(options));
registerHandler(new ArgHandlerCompileHost(options));
@@ -172,14 +171,6 @@
registerHandler(new ArgHandlerCookie(options));
}
- /*
- * Overridden to make public.
- */
- @Override
- public final boolean processArgs(String[] args) {
- return super.processArgs(args);
- }
-
@Override
protected String getName() {
return CompilePermsServer.class.getName();
diff --git a/dev/core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java b/dev/core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java
index e92d1c8..cabbc4f 100644
--- a/dev/core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java
+++ b/dev/core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java
@@ -18,6 +18,8 @@
import com.google.gwt.core.ext.TreeLogger.Type;
import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
/**
* Concrete class to implement compiler task options.
@@ -25,7 +27,7 @@
class CompileTaskOptionsImpl implements CompileTaskOptions {
private Type logLevel;
- private String moduleName;
+ private final List<String> moduleNames = new ArrayList<String>();
private boolean useGuiLogger;
private File workDir;
@@ -36,23 +38,27 @@
copyFrom(other);
}
+ public void addModuleName(String moduleName) {
+ moduleNames.add(moduleName);
+ }
+
public void copyFrom(CompileTaskOptions other) {
setLogLevel(other.getLogLevel());
- setModuleName(other.getModuleName());
+ setModuleNames(other.getModuleNames());
setUseGuiLogger(other.isUseGuiLogger());
setWorkDir(other.getWorkDir());
}
- public File getCompilerWorkDir() {
- return new File(new File(getWorkDir(), getModuleName()), "compiler");
+ public File getCompilerWorkDir(String moduleName) {
+ return new File(new File(getWorkDir(), moduleName), "compiler");
}
public Type getLogLevel() {
return logLevel;
}
- public String getModuleName() {
- return moduleName;
+ public List<String> getModuleNames() {
+ return new ArrayList<String>(moduleNames);
}
public File getWorkDir() {
@@ -67,8 +73,9 @@
this.logLevel = logLevel;
}
- public void setModuleName(String moduleName) {
- this.moduleName = moduleName;
+ public void setModuleNames(List<String> moduleNames) {
+ this.moduleNames.clear();
+ this.moduleNames.addAll(moduleNames);
}
public void setUseGuiLogger(boolean useGuiLogger) {
diff --git a/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java b/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java
index 747e7e0..5c11394 100644
--- a/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java
+++ b/dev/core/src/com/google/gwt/dev/CompileTaskRunner.java
@@ -46,7 +46,7 @@
if (options.isUseGuiLogger()) {
// Initialize a tree logger window.
DetachedTreeLoggerWindow loggerWindow = DetachedTreeLoggerWindow.getInstance(
- "Build Output for " + options.getModuleName(), 800, 600, true);
+ "Build Output for " + options.getModuleNames(), 800, 600, true);
// Eager AWT initialization for OS X to ensure safe coexistence with SWT.
BootStrapPlatform.initGui();
diff --git a/dev/core/src/com/google/gwt/dev/Compiler.java b/dev/core/src/com/google/gwt/dev/Compiler.java
new file mode 100644
index 0000000..c044d22
--- /dev/null
+++ b/dev/core/src/com/google/gwt/dev/Compiler.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.dev.CompileTaskRunner.CompileTask;
+import com.google.gwt.dev.Link.LinkOptionsImpl;
+import com.google.gwt.dev.Precompile.PrecompileOptionsImpl;
+import com.google.gwt.dev.cfg.ModuleDef;
+import com.google.gwt.dev.cfg.ModuleDefLoader;
+import com.google.gwt.dev.util.FileBackedObject;
+import com.google.gwt.dev.util.PerfLogger;
+import com.google.gwt.dev.util.Util;
+import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
+import com.google.gwt.dev.util.arg.ArgHandlerLocalWorkers;
+import com.google.gwt.dev.util.arg.ArgHandlerWarDir;
+import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional;
+import com.google.gwt.util.tools.Utility;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The main executable entry point for the GWT Java to JavaScript compiler.
+ */
+public class Compiler {
+
+ static class ArgProcessor extends Precompile.ArgProcessor {
+ public ArgProcessor(CompilerOptions options) {
+ super(options);
+
+ registerHandler(new ArgHandlerLocalWorkers(options));
+
+ // Override the ArgHandlerWorkDirRequired in the super class.
+ registerHandler(new ArgHandlerWorkDirOptional(options));
+
+ registerHandler(new ArgHandlerWarDir(options));
+ registerHandler(new ArgHandlerExtraDir(options));
+ }
+
+ @Override
+ protected String getName() {
+ return Compiler.class.getName();
+ }
+ }
+
+ static class CompilerOptionsImpl extends PrecompileOptionsImpl implements
+ CompilerOptions {
+
+ private LinkOptionsImpl linkOptions = new LinkOptionsImpl();
+ private int localWorkers;
+
+ public CompilerOptionsImpl() {
+ }
+
+ public CompilerOptionsImpl(CompilerOptions other) {
+ copyFrom(other);
+ }
+
+ public void copyFrom(CompilerOptions other) {
+ super.copyFrom(other);
+ linkOptions.copyFrom(other);
+ localWorkers = other.getLocalWorkers();
+ }
+
+ public File getExtraDir() {
+ return linkOptions.getExtraDir();
+ }
+
+ public int getLocalWorkers() {
+ return localWorkers;
+ }
+
+ public File getWarDir() {
+ return linkOptions.getWarDir();
+ }
+
+ public void setExtraDir(File extraDir) {
+ linkOptions.setExtraDir(extraDir);
+ }
+
+ public void setLocalWorkers(int localWorkers) {
+ this.localWorkers = localWorkers;
+ }
+
+ public void setWarDir(File outDir) {
+ linkOptions.setWarDir(outDir);
+ }
+ }
+
+ public static void main(String[] args) {
+ /*
+ * NOTE: main always exits with a call to System.exit to terminate any
+ * non-daemon threads that were started in Generators. Typically, this is to
+ * shutdown AWT related threads, since the contract for their termination is
+ * still implementation-dependent.
+ */
+ final CompilerOptions options = new CompilerOptionsImpl();
+ if (new ArgProcessor(options).processArgs(args)) {
+ CompileTask task = new CompileTask() {
+ public boolean run(TreeLogger logger) throws UnableToCompleteException {
+ return new Compiler(options).run(logger);
+ }
+ };
+ if (CompileTaskRunner.runWithAppropriateLogger(options, task)) {
+ // Exit w/ success code.
+ System.exit(0);
+ }
+ }
+ // Exit w/ non-success code.
+ System.exit(1);
+ }
+
+ private final CompilerOptionsImpl options;
+
+ public Compiler(CompilerOptions options) {
+ this.options = new CompilerOptionsImpl(options);
+ }
+
+ public boolean run(TreeLogger logger) throws UnableToCompleteException {
+ PerfLogger.start("compile");
+ boolean tempWorkDir = false;
+ try {
+ if (options.getWorkDir() == null) {
+ options.setWorkDir(Utility.makeTemporaryDirectory(null, "gwtc"));
+ tempWorkDir = true;
+ }
+
+ for (String moduleName : options.getModuleNames()) {
+ ModuleDef module = ModuleDefLoader.loadFromClassPath(logger, moduleName);
+ File compilerWorkDir = options.getCompilerWorkDir(moduleName);
+
+ if (options.isValidateOnly()) {
+ if (!Precompile.validate(logger, options, module,
+ options.getGenDir(), compilerWorkDir)) {
+ return false;
+ }
+ } else {
+ long compileStart = System.currentTimeMillis();
+ logger = logger.branch(TreeLogger.INFO, "Compiling module "
+ + moduleName);
+
+ Precompilation precompilation = Precompile.precompile(logger,
+ options, module, options.getGenDir(), compilerWorkDir);
+
+ if (precompilation == null) {
+ return false;
+ }
+
+ Permutation[] allPerms = precompilation.getPermutations();
+ List<FileBackedObject<PermutationResult>> resultFiles
+ = CompilePerms.makeResultFiles(
+ options.getCompilerWorkDir(moduleName), allPerms);
+ CompilePerms.compile(logger, precompilation, allPerms, options.getLocalWorkers(),
+ resultFiles);
+
+ Link.link(logger.branch(TreeLogger.INFO, "Linking into "
+ + options.getWarDir().getPath()), module, precompilation,
+ resultFiles, options.getWarDir(), options.getExtraDir());
+
+ long compileDone = System.currentTimeMillis();
+ long delta = compileDone - compileStart;
+ logger.log(TreeLogger.INFO, "Compilation succeeded -- "
+ + String.format("%.3f", delta / 1000d) + "s");
+ }
+ }
+
+ } catch (IOException e) {
+ logger.log(TreeLogger.ERROR, "Unable to create compiler work directory",
+ e);
+ return false;
+ } finally {
+ PerfLogger.end();
+ if (tempWorkDir) {
+ Util.recursiveDelete(options.getWorkDir(), false);
+ }
+ }
+ return true;
+ }
+}
diff --git a/dev/core/src/com/google/gwt/dev/GWTCompiler.java b/dev/core/src/com/google/gwt/dev/GWTCompiler.java
index 4a74a45..ad1854f 100644
--- a/dev/core/src/com/google/gwt/dev/GWTCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/GWTCompiler.java
@@ -18,14 +18,12 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.dev.CompileTaskRunner.CompileTask;
-import com.google.gwt.dev.Link.LinkOptionsImpl;
import com.google.gwt.dev.Precompile.PrecompileOptionsImpl;
import com.google.gwt.dev.cfg.ModuleDef;
import com.google.gwt.dev.cfg.ModuleDefLoader;
import com.google.gwt.dev.util.FileBackedObject;
import com.google.gwt.dev.util.PerfLogger;
import com.google.gwt.dev.util.Util;
-import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
import com.google.gwt.dev.util.arg.ArgHandlerLocalWorkers;
import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
import com.google.gwt.dev.util.arg.ArgHandlerSoyc;
@@ -38,19 +36,22 @@
/**
* The main executable entry point for the GWT Java to JavaScript compiler.
+ *
+ * @deprecated use {@link Compiler} instead
*/
+@Deprecated
public class GWTCompiler {
static final class ArgProcessor extends Precompile.ArgProcessor {
- public ArgProcessor(CompilerOptions options) {
+ public ArgProcessor(LegacyCompilerOptions options) {
super(options);
+ registerHandler(new ArgHandlerOutDir(options));
+
// Override the ArgHandlerWorkDirRequired in the super class.
registerHandler(new ArgHandlerWorkDirOptional(options));
- registerHandler(new ArgHandlerExtraDir(options));
registerHandler(new ArgHandlerLocalWorkers(options));
- registerHandler(new ArgHandlerOutDir(options));
registerHandler(new ArgHandlerSoyc(options));
}
@@ -61,26 +62,22 @@
}
static class GWTCompilerOptionsImpl extends PrecompileOptionsImpl implements
- CompilerOptions {
+ LegacyCompilerOptions {
- private LinkOptionsImpl linkOptions = new LinkOptionsImpl();
private int localWorkers;
+ private File outDir;
public GWTCompilerOptionsImpl() {
}
- public GWTCompilerOptionsImpl(CompilerOptions other) {
+ public GWTCompilerOptionsImpl(LegacyCompilerOptions other) {
copyFrom(other);
}
- public void copyFrom(CompilerOptions other) {
+ public void copyFrom(LegacyCompilerOptions other) {
super.copyFrom(other);
- linkOptions.copyFrom(other);
- localWorkers = other.getLocalWorkers();
- }
-
- public File getExtraDir() {
- return linkOptions.getExtraDir();
+ setLocalWorkers(other.getLocalWorkers());
+ setOutDir(other.getOutDir());
}
public int getLocalWorkers() {
@@ -88,11 +85,7 @@
}
public File getOutDir() {
- return linkOptions.getOutDir();
- }
-
- public void setExtraDir(File extraDir) {
- linkOptions.setExtraDir(extraDir);
+ return outDir;
}
public void setLocalWorkers(int localWorkers) {
@@ -100,18 +93,21 @@
}
public void setOutDir(File outDir) {
- linkOptions.setOutDir(outDir);
+ this.outDir = outDir;
}
}
public static void main(String[] args) {
+ System.err.println("WARNING: '" + GWTCompiler.class.getName()
+ + "' is deprecated and will be removed in a future release.");
+ System.err.println("Use '" + Compiler.class.getName() + "' instead.");
/*
* NOTE: main always exits with a call to System.exit to terminate any
* non-daemon threads that were started in Generators. Typically, this is to
* shutdown AWT related threads, since the contract for their termination is
* still implementation-dependent.
*/
- final CompilerOptions options = new GWTCompilerOptionsImpl();
+ final LegacyCompilerOptions options = new GWTCompilerOptionsImpl();
if (new ArgProcessor(options).processArgs(args)) {
CompileTask task = new CompileTask() {
public boolean run(TreeLogger logger) throws UnableToCompleteException {
@@ -129,58 +125,82 @@
private final GWTCompilerOptionsImpl options;
- public GWTCompiler(CompilerOptions options) {
+ public GWTCompiler(LegacyCompilerOptions options) {
this.options = new GWTCompilerOptionsImpl(options);
}
+ /**
+ * Compiles the set of modules specified in the options.
+ */
public boolean run(TreeLogger logger) throws UnableToCompleteException {
- ModuleDef module = ModuleDefLoader.loadFromClassPath(logger,
- options.getModuleName());
+ ModuleDef[] modules = new ModuleDef[options.getModuleNames().size()];
+ int i = 0;
+ for (String moduleName : options.getModuleNames()) {
+ modules[i++] = ModuleDefLoader.loadFromClassPath(logger, moduleName);
+ }
+ return run(logger, modules);
+ }
- if (options.isValidateOnly()) {
- return Precompile.validate(logger, options, module, options.getGenDir(),
- options.getCompilerWorkDir());
- } else {
- PerfLogger.start("compile");
- long compileStart = System.currentTimeMillis();
- logger = logger.branch(TreeLogger.INFO, "Compiling module "
- + options.getModuleName());
+ /**
+ * Compiles a specific set of modules.
+ */
+ public boolean run(TreeLogger logger, ModuleDef... modules)
+ throws UnableToCompleteException {
+ PerfLogger.start("compile");
+ boolean tempWorkDir = false;
+ try {
+ if (options.getWorkDir() == null) {
+ options.setWorkDir(Utility.makeTemporaryDirectory(null, "gwtc"));
+ tempWorkDir = true;
+ }
- boolean tempWorkDir = false;
- try {
- if (options.getWorkDir() == null) {
- options.setWorkDir(Utility.makeTemporaryDirectory(null, "gwtc"));
- tempWorkDir = true;
- }
+ for (ModuleDef module : modules) {
+ String moduleName = module.getName();
+ File compilerWorkDir = options.getCompilerWorkDir(moduleName);
- Precompilation precompilation = Precompile.precompile(logger, options,
- module, options.getGenDir(), options.getCompilerWorkDir());
+ if (options.isValidateOnly()) {
+ if (!Precompile.validate(logger, options, module,
+ options.getGenDir(), compilerWorkDir)) {
+ return false;
+ }
+ } else {
+ long compileStart = System.currentTimeMillis();
+ logger = logger.branch(TreeLogger.INFO, "Compiling module "
+ + moduleName);
- Permutation[] allPerms = precompilation.getPermutations();
- List<FileBackedObject<PermutationResult>> resultFiles = CompilePerms.makeResultFiles(
- options.getCompilerWorkDir(), allPerms);
- CompilePerms.compile(logger, precompilation, allPerms,
- options.getLocalWorkers(), resultFiles);
+ Precompilation precompilation = Precompile.precompile(logger,
+ options, module, options.getGenDir(), compilerWorkDir);
- Link.link(logger.branch(TreeLogger.INFO, "Linking into "
- + options.getOutDir().getPath()), module, precompilation,
- resultFiles, options.getOutDir(), options.getExtraDir());
+ if (precompilation == null) {
+ return false;
+ }
+ Permutation[] allPerms = precompilation.getPermutations();
+ List<FileBackedObject<PermutationResult>> resultFiles = CompilePerms.makeResultFiles(
+ options.getCompilerWorkDir(moduleName), allPerms);
+ CompilePerms.compile(logger, precompilation, allPerms,
+ options.getLocalWorkers(), resultFiles);
- long compileDone = System.currentTimeMillis();
- long delta = compileDone - compileStart;
- logger.log(TreeLogger.INFO, "Compilation succeeded -- "
- + String.format("%.3f", delta / 1000d) + "s");
- return true;
- } catch (IOException e) {
- logger.log(TreeLogger.ERROR,
- "Unable to create compiler work directory", e);
- } finally {
- PerfLogger.end();
- if (tempWorkDir) {
- Util.recursiveDelete(options.getWorkDir(), false);
+ Link.legacyLink(logger.branch(TreeLogger.INFO, "Linking into "
+ + options.getOutDir().getPath()), module, precompilation,
+ resultFiles, options.getOutDir());
+
+ long compileDone = System.currentTimeMillis();
+ long delta = compileDone - compileStart;
+ logger.log(TreeLogger.INFO, "Compilation succeeded -- "
+ + String.format("%.3f", delta / 1000d) + "s");
}
}
+
+ } catch (IOException e) {
+ logger.log(TreeLogger.ERROR, "Unable to create compiler work directory",
+ e);
return false;
+ } finally {
+ PerfLogger.end();
+ if (tempWorkDir) {
+ Util.recursiveDelete(options.getWorkDir(), false);
+ }
}
+ return true;
}
}
diff --git a/dev/core/src/com/google/gwt/dev/GWTHosted.java b/dev/core/src/com/google/gwt/dev/GWTHosted.java
deleted file mode 100644
index 87bd0d4..0000000
--- a/dev/core/src/com/google/gwt/dev/GWTHosted.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.dev;
-
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.linker.ArtifactSet;
-import com.google.gwt.dev.cfg.ModuleDef;
-import com.google.gwt.dev.cfg.ModuleDefLoader;
-import com.google.gwt.dev.shell.ArtifactAcceptor;
-import com.google.gwt.dev.shell.GWTShellServletFilter;
-import com.google.gwt.dev.shell.ServletContainer;
-import com.google.gwt.dev.shell.ServletContainerLauncher;
-import com.google.gwt.dev.shell.jetty.JettyLauncher;
-import com.google.gwt.dev.util.PerfLogger;
-import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
-import com.google.gwt.util.tools.ArgHandlerExtra;
-import com.google.gwt.util.tools.ArgHandlerString;
-
-import java.io.PrintWriter;
-import java.net.BindException;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * The main executable class for the hosted mode shell.
- */
-public class GWTHosted extends GWTShell {
-
- /**
- * Handles the set of modules that can be passed at the end of the command
- * line.
- */
- protected class ArgHandlerModulesExtra extends ArgHandlerExtra {
-
- @Override
- public boolean addExtraArg(String arg) {
- return addModule(console, arg);
- }
-
- @Override
- public String getPurpose() {
- return "Specifies the set of modules to host";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"module"};
- }
- }
- /**
- * Handles the -server command line flag.
- */
- protected class ArgHandlerServer extends ArgHandlerString {
- @Override
- public String getPurpose() {
- return "Prevents the embedded Tomcat server from running, even if a port is specified";
- }
-
- @Override
- public String getTag() {
- return "-server";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"serverLauncherClass"};
- }
-
- @Override
- public boolean setString(String arg) {
- // Supercedes -noserver.
- setRunTomcat(true);
- return setServer(console, arg);
- }
- }
-
- /**
- * Handles a startup url that can be passed on the command line.
- */
- protected class ArgHandlerStartupURLs extends ArgHandlerString {
-
- @Override
- public String getPurpose() {
- return "Automatically launches the specified URL";
- }
-
- @Override
- public String getTag() {
- return "-startupUrl";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"url"};
- }
-
- @Override
- public boolean setString(String arg) {
- addStartupURL(arg);
- return true;
- }
- }
-
- public static void main(String[] args) {
- /*
- * NOTE: main always exits with a call to System.exit to terminate any
- * non-daemon threads that were started in Generators. Typically, this is to
- * shutdown AWT related threads, since the contract for their termination is
- * still implementation-dependent.
- */
- GWTHosted shellMain = new GWTHosted();
- if (shellMain.processArgs(args)) {
- shellMain.run();
- }
- System.exit(0);
- }
-
- protected final PrintWriterTreeLogger console = new PrintWriterTreeLogger(
- new PrintWriter(System.err, true));
-
- /**
- * The servlet launcher to use (defaults to embedded Jetty).
- */
- private ServletContainerLauncher launcher = new JettyLauncher();
-
- /**
- * The set of modules this hosted mode instance can run.
- */
- private Set<ModuleDef> modules = new HashSet<ModuleDef>();
-
- /**
- * The server that was started.
- */
- private ServletContainer server;
-
- /**
- * Our servlet filter, embedded into the server, which autogenerates GWT
- * modules when the selection script is requested.
- */
- private GWTShellServletFilter servletFilter;
-
- {
- console.setMaxDetail(TreeLogger.WARN);
- }
-
- public GWTHosted() {
- super(false, true);
- registerHandler(new ArgHandlerServer());
- registerHandler(new ArgHandlerStartupURLs());
- registerHandler(new ArgHandlerModulesExtra());
- }
-
- public boolean addModule(TreeLogger logger, String moduleName) {
- try {
- ModuleDef moduleDef = ModuleDefLoader.loadFromClassPath(logger,
- moduleName);
- modules.add(moduleDef);
- return true;
- } catch (UnableToCompleteException e) {
- logger.log(TreeLogger.ERROR, "Unable to load module '" + moduleName + "'");
- return false;
- }
- }
-
- public boolean setServer(TreeLogger logger, String serverClassName) {
- Throwable t;
- try {
- Class<?> clazz = Class.forName(serverClassName, true,
- Thread.currentThread().getContextClassLoader());
- Class<? extends ServletContainerLauncher> sclClass = clazz.asSubclass(ServletContainerLauncher.class);
- launcher = sclClass.newInstance();
- return true;
- } catch (ClassCastException e) {
- t = e;
- } catch (ClassNotFoundException e) {
- t = e;
- } catch (InstantiationException e) {
- t = e;
- } catch (IllegalAccessException e) {
- t = e;
- }
- logger.log(TreeLogger.ERROR, "Unable to load server class '"
- + serverClassName + "'", t);
- return false;
- }
-
- @Override
- protected ArtifactAcceptor doCreateArtifactAcceptor(final ModuleDef module) {
- return new ArtifactAcceptor() {
- public void accept(TreeLogger logger, ArtifactSet newlyGeneratedArtifacts)
- throws UnableToCompleteException {
- servletFilter.relink(logger, module, newlyGeneratedArtifacts);
- }
- };
- }
-
- @Override
- protected void shutDown() {
- if (server != null) {
- try {
- server.stop();
- } catch (UnableToCompleteException e) {
- // Already logged.
- }
- server = null;
- }
- }
-
- @Override
- protected int startUpServer() {
- PerfLogger.start("GWTHosted.startUpServer");
- try {
- TreeLogger serverLogger = getTopLogger().branch(TreeLogger.INFO,
- "Starting HTTP on port " + getPort(), null);
- ModuleDef[] moduleArray = modules.toArray(new ModuleDef[modules.size()]);
- for (ModuleDef moduleDef : moduleArray) {
- String[] servletPaths = moduleDef.getServletPaths();
- if (servletPaths.length > 0) {
- serverLogger.log(TreeLogger.WARN,
- "Ignoring legacy <servlet> tag(s) in module '"
- + moduleDef.getName()
- + "'; add servlet tags to your web.xml instead");
- }
- }
- servletFilter = new GWTShellServletFilter(serverLogger, options,
- moduleArray);
- server = launcher.start(serverLogger, getPort(), options.getOutDir(),
- servletFilter);
- assert (server != null);
- return server.getPort();
- } catch (BindException e) {
- System.err.println("Port "
- + getPort()
- + " is already is use; you probably still have another session active");
- } catch (Exception e) {
- System.err.println("Unable to start embedded HTTP server");
- e.printStackTrace();
- } finally {
- PerfLogger.end();
- }
- return -1;
- }
-}
diff --git a/dev/core/src/com/google/gwt/dev/GWTMain.java b/dev/core/src/com/google/gwt/dev/GWTMain.java
index 2e821db..5659ed2 100644
--- a/dev/core/src/com/google/gwt/dev/GWTMain.java
+++ b/dev/core/src/com/google/gwt/dev/GWTMain.java
@@ -18,8 +18,8 @@
import com.google.gwt.dev.util.Util;
/**
- * Executable class provides help to users who run the jar by indicating
- * the enclosed classes that are executable.
+ * Executable class provides help to users who run the jar by indicating the
+ * enclosed classes that are executable.
*/
public class GWTMain {
@@ -31,10 +31,10 @@
System.err.println(About.GWT_VERSION);
}
System.err.println("Available main classes:");
- System.err.println(addSpaces(GWTShell.class.getName(),
- "runs the development shell"));
- System.err.println(addSpaces(GWTCompiler.class.getName(),
- "compiles a GWT module"));
+ System.err.println(addSpaces(HostedMode.class.getName(),
+ "runs the development shell"));
+ System.err.println(addSpaces(Compiler.class.getName(),
+ "compiles a GWT module"));
}
private static String addSpaces(String first, String second) {
diff --git a/dev/core/src/com/google/gwt/dev/GWTShell.java b/dev/core/src/com/google/gwt/dev/GWTShell.java
index 785ab20..d2e05c3 100644
--- a/dev/core/src/com/google/gwt/dev/GWTShell.java
+++ b/dev/core/src/com/google/gwt/dev/GWTShell.java
@@ -17,22 +17,11 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.linker.ArtifactSet;
import com.google.gwt.core.ext.linker.EmittedArtifact;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.dev.GWTCompiler.GWTCompilerOptionsImpl;
import com.google.gwt.dev.cfg.ModuleDef;
-import com.google.gwt.dev.cfg.ModuleDefLoader;
import com.google.gwt.dev.shell.ArtifactAcceptor;
-import com.google.gwt.dev.shell.BrowserWidget;
-import com.google.gwt.dev.shell.BrowserWidgetHost;
-import com.google.gwt.dev.shell.BrowserWidgetHostChecker;
-import com.google.gwt.dev.shell.LowLevel;
-import com.google.gwt.dev.shell.ModuleSpaceHost;
-import com.google.gwt.dev.shell.PlatformSpecific;
-import com.google.gwt.dev.shell.ShellMainWindow;
-import com.google.gwt.dev.shell.ShellModuleSpaceHost;
import com.google.gwt.dev.shell.WorkDirs;
import com.google.gwt.dev.shell.tomcat.EmbeddedTomcatServer;
import com.google.gwt.dev.util.Util;
@@ -43,138 +32,33 @@
import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
import com.google.gwt.dev.util.arg.ArgHandlerLogLevel;
import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
-import com.google.gwt.dev.util.arg.ArgHandlerScriptStyle;
-import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional;
-import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.util.tools.ArgHandlerExtra;
-import com.google.gwt.util.tools.ArgHandlerFlag;
-import com.google.gwt.util.tools.ArgHandlerString;
-import com.google.gwt.util.tools.ToolBase;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.internal.Library;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
/**
* The main executable class for the hosted mode shell.
+ *
+ * @deprecated use {@link HostedMode} instead
*/
-public class GWTShell extends ToolBase {
-
- /**
- * Handles the -blacklist command line argument.
- */
- protected class ArgHandlerBlacklist extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-blacklist", ""};
- }
-
- @Override
- public String getPurpose() {
- return "Prevents the user browsing URLs that match the specified regexes (comma or space separated)";
- }
-
- @Override
- public String getTag() {
- return "-blacklist";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"blacklist-string"};
- }
-
- @Override
- public boolean setString(String blacklistStr) {
- return BrowserWidgetHostChecker.blacklistRegexes(blacklistStr);
- }
- }
-
- /**
- * Handles the -noserver command line flag.
- */
- protected class ArgHandlerNoServerFlag extends ArgHandlerFlag {
- @Override
- public String getPurpose() {
- return "Prevents the embedded Tomcat server from running, even if a port is specified";
- }
-
- @Override
- public String getTag() {
- return "-noserver";
- }
-
- @Override
- public boolean setFlag() {
- runTomcat = false;
- return true;
- }
- }
-
- /**
- * Handles the -port command line flag.
- */
- protected class ArgHandlerPort extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-port", "8888"};
- }
-
- @Override
- public String getPurpose() {
- return "Runs an embedded Tomcat instance on the specified port (defaults to 8888)";
- }
-
- @Override
- public String getTag() {
- return "-port";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"port-number | \"auto\""};
- }
-
- @Override
- public boolean setString(String value) {
- if (value.equals("auto")) {
- port = 0;
- } else {
- try {
- port = Integer.parseInt(value);
- } catch (NumberFormatException e) {
- System.err.println("A port must be an integer or \"auto\"");
- return false;
- }
- }
- return true;
- }
- }
+@Deprecated
+public class GWTShell extends HostedModeBase {
/**
* Handles the list of startup urls that can be passed at the end of the
* command line.
*/
- protected class ArgHandlerStartupURLsExtra extends ArgHandlerExtra {
+ protected static class ArgHandlerStartupURLsExtra extends ArgHandlerExtra {
+
+ private final OptionStartupURLs options;
+
+ public ArgHandlerStartupURLsExtra(OptionStartupURLs options) {
+ this.options = options;
+ }
@Override
public boolean addExtraArg(String arg) {
- addStartupURL(arg);
+ options.addStartupURL(arg);
return true;
}
@@ -190,415 +74,101 @@
}
/**
- * Handles the -whitelist command line flag.
+ * The GWTShell argument processor.
*/
- protected class ArgHandlerWhitelist extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-whitelist", ""};
+ protected static class ArgProcessor extends HostedModeBase.ArgProcessor {
+ public ArgProcessor(ShellOptionsImpl options, boolean forceServer,
+ boolean noURLs) {
+ super(options, forceServer);
+ if (!noURLs) {
+ registerHandler(new ArgHandlerStartupURLsExtra(options));
+ }
+ registerHandler(new ArgHandlerOutDir(options));
}
@Override
- public String getPurpose() {
- return "Allows the user to browse URLs that match the specified regexes (comma or space separated)";
- }
-
- @Override
- public String getTag() {
- return "-whitelist";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"whitelist-string"};
- }
-
- @Override
- public boolean setString(String whitelistStr) {
- return BrowserWidgetHostChecker.whitelistRegexes(whitelistStr);
+ protected String getName() {
+ return GWTShell.class.getName();
}
}
/**
- * Concrete class to implement all compiler options.
+ * Concrete class to implement all shell options.
*/
- static class ShellOptionsImpl extends GWTCompilerOptionsImpl implements
- ShellOptions, WorkDirs {
+ static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements
+ HostedModeBaseOptions, WorkDirs, LegacyCompilerOptions {
+ private int localWorkers;
+ private File outDir;
+
public File getCompilerOutputDir(ModuleDef moduleDef) {
- return new File(getOutDir(), moduleDef.getDeployTo());
+ return new File(getOutDir(), moduleDef.getName());
+ }
+
+ public int getLocalWorkers() {
+ return localWorkers;
+ }
+
+ public File getOutDir() {
+ return outDir;
}
public File getShellPublicGenDir(ModuleDef moduleDef) {
return new File(getShellBaseWorkDir(moduleDef), "public");
}
- /**
- * The base shell work directory.
- */
- protected File getShellBaseWorkDir(ModuleDef moduleDef) {
- return new File(new File(getWorkDir(), moduleDef.getName()), "shell");
+ @Override
+ public File getWorkDir() {
+ return new File(getOutDir(), ".gwt-tmp");
}
- /**
- * Where generated files go by default until we are sure they are public;
- * then they are copied into {@link #getShellPublicGenDir(ModuleDef)}.
- */
- protected File getShellPrivateGenDir(ModuleDef moduleDef) {
- return new File(getShellBaseWorkDir(moduleDef), "gen");
- }
- }
-
- private class BrowserWidgetHostImpl implements BrowserWidgetHost {
- public BrowserWidgetHostImpl() {
+ public void setLocalWorkers(int localWorkers) {
+ this.localWorkers = localWorkers;
}
- public void compile(ModuleDef moduleDef) throws UnableToCompleteException {
- GWTShell.this.compile(getLogger(), moduleDef);
+ public void setOutDir(File outDir) {
+ this.outDir = outDir;
}
-
- public void compile(String[] moduleNames) throws UnableToCompleteException {
- for (int i = 0; i < moduleNames.length; i++) {
- String moduleName = moduleNames[i];
- ModuleDef moduleDef = loadModule(moduleName, getLogger());
- compile(moduleDef);
- }
- }
-
- public ModuleSpaceHost createModuleSpaceHost(BrowserWidget widget,
- final String moduleName) throws UnableToCompleteException {
- TreeLogger logger = getLogger();
-
- // Switch to a wait cursor.
- //
- Shell widgetShell = widget.getShell();
- try {
- Cursor waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
- widgetShell.setCursor(waitCursor);
-
- // Try to find an existing loaded version of the module def.
- //
- ModuleDef moduleDef = loadModule(moduleName, logger);
- assert (moduleDef != null);
-
- TypeOracle typeOracle = moduleDef.getTypeOracle(logger);
- ShellModuleSpaceHost host = doCreateShellModuleSpaceHost(logger,
- typeOracle, moduleDef);
- return host;
- } finally {
- Cursor normalCursor = display.getSystemCursor(SWT.CURSOR_ARROW);
- widgetShell.setCursor(normalCursor);
- }
- }
-
- public TreeLogger getLogger() {
- return getTopLogger();
- }
-
- public String normalizeURL(String whatTheUserTyped) {
- return GWTShell.this.normalizeURL(whatTheUserTyped);
- }
-
- public BrowserWidget openNewBrowserWindow()
- throws UnableToCompleteException {
- return GWTShell.this.openNewBrowserWindow();
- }
-
- /**
- * Load a module.
- *
- * @param moduleName name of the module to load
- * @param logger TreeLogger to use
- * @return the loaded module
- * @throws UnableToCompleteException
- */
- private ModuleDef loadModule(String moduleName, TreeLogger logger)
- throws UnableToCompleteException {
- boolean assumeFresh = !alreadySeenModules.contains(moduleName);
- ModuleDef moduleDef = ModuleDefLoader.loadFromClassPath(logger,
- moduleName, !assumeFresh);
- alreadySeenModules.add(moduleName);
- assert (moduleDef != null) : "Required module state is absent";
- return moduleDef;
- }
- }
-
- private static Image[] icons;
-
- static {
- // Correct menu on Mac OS X
- Display.setAppName("GWT");
- }
-
- public static String checkHost(String hostUnderConsideration,
- Set<String> hosts) {
- hostUnderConsideration = hostUnderConsideration.toLowerCase();
- for (String rule : hosts) {
- // match on lowercased regex
- if (hostUnderConsideration.matches(".*" + rule + ".*")) {
- return rule;
- }
- }
- return null;
- }
-
- public static String computeHostRegex(String url) {
- // the entire URL up to the first slash not prefixed by a slash or colon.
- String raw = url.split("(?<![:/])/")[0];
- // escape the dots and put a begin line specifier on the result
- return "^" + raw.replaceAll("[.]", "[.]");
- }
-
- public static String formatRules(Set<String> invalidHttpHosts) {
- StringBuffer out = new StringBuffer();
- for (String rule : invalidHttpHosts) {
- out.append(rule);
- out.append(" ");
- }
- return out.toString();
- }
-
- /**
- * Well-known place to get the GWT icons.
- */
- public static Image[] getIcons() {
- // Make sure icon images are loaded.
- //
- if (icons == null) {
- icons = new Image[] {
- LowLevel.loadImage("icon16.png"), LowLevel.loadImage("icon24.png"),
- LowLevel.loadImage("icon32.png"), LowLevel.loadImage("icon48.png"),
- LowLevel.loadImage("icon128.png")};
- }
- return icons;
}
public static void main(String[] args) {
+ System.err.println("WARNING: '" + GWTShell.class.getName()
+ + "' is deprecated and will be removed in a future release.");
+ System.err.println("Use '" + HostedMode.class.getName() + "' instead.");
/*
* NOTE: main always exits with a call to System.exit to terminate any
* non-daemon threads that were started in Generators. Typically, this is to
* shutdown AWT related threads, since the contract for their termination is
* still implementation-dependent.
*/
- GWTShell shellMain = new GWTShell();
- if (shellMain.processArgs(args)) {
- shellMain.run();
+ GWTShell gwtShell = new GWTShell();
+ ArgProcessor argProcessor = new ArgProcessor(gwtShell.options, false, false);
+ if (argProcessor.processArgs(args)) {
+ gwtShell.run();
+ // Exit w/ success code.
+ System.exit(0);
}
- System.exit(0);
+ // Exit w/ non-success code.
+ System.exit(-1);
}
/**
- * Use the default display; constructing a new one would make instantiating
- * multiple GWTShells fail with a mysterious exception.
+ * Hiding super field because it's actually the same object, just with a
+ * stronger type.
*/
- protected final Display display = Display.getDefault();
+ @SuppressWarnings("hiding")
+ protected final ShellOptionsImpl options = (ShellOptionsImpl) super.options;
- protected final ShellOptionsImpl options = new ShellOptionsImpl();
-
- /**
- * Cheat on the first load's refresh by assuming the module loaded by
- * {@link com.google.gwt.dev.shell.GWTShellServlet} is still fresh. This
- * prevents a double-refresh on startup. Subsequent refreshes will trigger a
- * real refresh.
- */
- private Set<String> alreadySeenModules = new HashSet<String>();
-
- private BrowserWidgetHostImpl browserHost = new BrowserWidgetHostImpl();
-
- private final List<Shell> browserShells = new ArrayList<Shell>();
-
- private boolean headlessMode = false;
-
- private ShellMainWindow mainWnd;
-
- private int port;
-
- private boolean runTomcat = true;
-
- private boolean started;
-
- private final List<String> startupUrls = new ArrayList<String>();
-
- public GWTShell() {
- this(false, false);
- }
-
- protected GWTShell(boolean forceServer, boolean noURLs) {
- // Set any platform specific system properties.
- BootStrapPlatform.initHostedMode();
- BootStrapPlatform.applyPlatformHacks();
-
- registerHandler(getArgHandlerPort());
-
- if (!forceServer) {
- registerHandler(new ArgHandlerNoServerFlag());
- }
-
- registerHandler(new ArgHandlerWhitelist());
- registerHandler(new ArgHandlerBlacklist());
-
- registerHandler(new ArgHandlerLogLevel(options));
-
- registerHandler(new ArgHandlerGenDir(options));
- registerHandler(new ArgHandlerWorkDirOptional(options));
-
- if (!noURLs) {
- registerHandler(new ArgHandlerStartupURLsExtra());
- }
-
- registerHandler(new ArgHandlerExtraDir(options));
- registerHandler(new ArgHandlerOutDir(options));
-
- registerHandler(new ArgHandlerScriptStyle(options));
- registerHandler(new ArgHandlerEnableAssertions(options));
- registerHandler(new ArgHandlerDisableAggressiveOptimization(options));
- registerHandler(new ArgHandlerDisableRunAsync(options));
- }
-
- public void addStartupURL(String url) {
- startupUrls.add(url);
- }
-
- public void closeAllBrowserWindows() {
- while (!browserShells.isEmpty()) {
- browserShells.get(0).dispose();
- }
- }
-
- public CompilerOptions getCompilerOptions() {
+ public LegacyCompilerOptions getCompilerOptions() {
return new GWTCompilerOptionsImpl(options);
}
- public int getPort() {
- return port;
- }
-
- public TreeLogger getTopLogger() {
- return mainWnd.getLogger();
- }
-
- public boolean hasBrowserWindowsOpen() {
- if (browserShells.isEmpty()) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Launch the arguments as Urls in separate windows.
- */
- public void launchStartupUrls(final TreeLogger logger) {
- if (startupUrls != null) {
- // Launch a browser window for each startup url.
- //
- String startupURL = "";
- try {
- for (String prenormalized : startupUrls) {
- startupURL = normalizeURL(prenormalized);
- logger.log(TreeLogger.TRACE, "Starting URL: " + startupURL, null);
- BrowserWidget bw = openNewBrowserWindow();
- bw.go(startupURL);
- }
- } catch (UnableToCompleteException e) {
- logger.log(TreeLogger.ERROR,
- "Unable to open new window for startup URL: " + startupURL, null);
- }
- }
- }
-
- public String normalizeURL(String unknownUrlText) {
- if (unknownUrlText.indexOf(":") != -1) {
- // Assume it's a full url.
- return unknownUrlText;
- }
-
- // Assume it's a trailing url path.
- //
- if (unknownUrlText.length() > 0 && unknownUrlText.charAt(0) == '/') {
- unknownUrlText = unknownUrlText.substring(1);
- }
-
- int prt = getPort();
- if (prt != 80 && prt != 0) {
- // CHECKSTYLE_OFF: Not really an assembled error message, so no space
- // after ':'.
- return "http://localhost:" + prt + "/" + unknownUrlText;
- // CHECKSTYLE_ON
- } else {
- return "http://localhost/" + unknownUrlText;
- }
- }
-
- /**
- * Called directly by ShellMainWindow and indirectly via BrowserWidgetHost.
- */
- public BrowserWidget openNewBrowserWindow() throws UnableToCompleteException {
- boolean succeeded = false;
- Shell s = createTrackedBrowserShell();
- try {
- BrowserWidget bw = PlatformSpecific.createBrowserWidget(getTopLogger(),
- s, browserHost);
-
- if (mainWnd != null) {
- Rectangle r = mainWnd.getShell().getBounds();
- int n = browserShells.size() + 1;
- s.setBounds(r.x + n * 50, r.y + n * 50, 800, 600);
- } else {
- s.setSize(800, 600);
- }
-
- if (!isHeadless()) {
- s.open();
- }
-
- bw.onFirstShown();
- succeeded = true;
- return bw;
- } finally {
- if (!succeeded) {
- s.dispose();
- }
- }
- }
-
- /**
- * Sets up all the major aspects of running the shell graphically, including
- * creating the main window and optionally starting the embedded Tomcat
- * server.
- */
- public void run() {
- try {
- if (!startUp()) {
- // Failed to initialize.
- return;
- }
-
- // Perform any platform-specific hacks to initialize the GUI.
- BootStrapPlatform.initGui();
-
- // Tomcat's running now, so launch browsers for startup urls now.
- launchStartupUrls(getTopLogger());
-
- pumpEventLoop();
-
- shutDown();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
public void setCompilerOptions(CompilerOptions options) {
this.options.copyFrom(options);
}
- public void setPort(int port) {
- this.port = port;
- }
-
- public void setRunTomcat(boolean run) {
- runTomcat = run;
+ @Override
+ protected void compile(TreeLogger logger) throws UnableToCompleteException {
+ throw new UnsupportedOperationException();
}
/**
@@ -606,13 +176,19 @@
* def programmatically in some cases (this is needed for JUnit support, for
* example).
*/
+ @Override
protected void compile(TreeLogger logger, ModuleDef moduleDef)
throws UnableToCompleteException {
- CompilerOptions newOptions = new GWTCompilerOptionsImpl(options);
- newOptions.setModuleName(moduleDef.getName());
- new GWTCompiler(newOptions).run(logger);
+ LegacyCompilerOptions newOptions = new GWTCompilerOptionsImpl(options);
+ new GWTCompiler(newOptions).run(logger, moduleDef);
}
+ @Override
+ protected HostedModeBaseOptions createOptions() {
+ return new ShellOptionsImpl();
+ }
+
+ @Override
protected ArtifactAcceptor doCreateArtifactAcceptor(final ModuleDef module) {
return new ArtifactAcceptor() {
public void accept(TreeLogger logger, ArtifactSet artifacts)
@@ -633,148 +209,15 @@
};
}
- /**
- * Creates an instance of ShellModuleSpaceHost (or a derived class) using the
- * specified constituent parts. This method is made to be overridden for
- * subclasses that need to change the behavior of ShellModuleSpaceHost.
- *
- * @param logger TreeLogger to use
- * @param typeOracle
- * @param moduleDef
- * @param genDir
- * @return ShellModuleSpaceHost instance
- */
- protected ShellModuleSpaceHost doCreateShellModuleSpaceHost(
- TreeLogger logger, TypeOracle typeOracle, ModuleDef moduleDef) {
- // Clear out the shell temp directory.
- Util.recursiveDelete(options.getShellBaseWorkDir(moduleDef), true);
- return new ShellModuleSpaceHost(logger, typeOracle, moduleDef,
- options.getGenDir(), options.getShellPrivateGenDir(moduleDef),
- doCreateArtifactAcceptor(moduleDef));
- }
-
- /**
- * Can be override to change the default log level in subclasses. JUnit does
- * this for example.
- */
- protected Type doGetDefaultLogLevel() {
- return Type.INFO;
- }
-
- /**
- * Derived classes can override to prevent automatic update checking.
- */
- protected boolean doShouldCheckForUpdates() {
- return true;
- }
-
- /**
- * Derived classes can override to set a default port.
- */
- protected ArgHandlerPort getArgHandlerPort() {
- return new ArgHandlerPort();
- }
-
- protected BrowserWidgetHost getBrowserHost() {
- return browserHost;
- }
-
- protected void initializeLogger() {
- final AbstractTreeLogger logger = mainWnd.getLogger();
- logger.setMaxDetail(options.getLogLevel());
- }
-
- /**
- * By default we will open the application window.
- *
- * @return true if we are running in headless mode
- */
- protected boolean isHeadless() {
- return headlessMode;
- }
-
- protected boolean notDone() {
- if (!mainWnd.isDisposed()) {
- return true;
- }
- if (!browserShells.isEmpty()) {
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- protected void pumpEventLoop() {
- TreeLogger logger = getTopLogger();
-
- // Run the event loop. When there are no open shells, quit.
- //
- while (notDone()) {
- try {
- if (!display.readAndDispatch()) {
- sleep();
- }
- } catch (Throwable e) {
- String msg = e.getMessage();
- msg = (msg != null ? msg : e.getClass().getName());
- logger.log(TreeLogger.ERROR, msg, e);
- }
- }
- }
-
- protected void setHeadless(boolean headlessMode) {
- this.headlessMode = headlessMode;
- }
-
- /**
- *
- */
- protected void shutDown() {
- if (!runTomcat) {
- return;
- }
-
+ @Override
+ protected void doShutDownServer() {
// Stop the HTTP server.
//
EmbeddedTomcatServer.stop();
}
- protected void sleep() {
- display.sleep();
- }
-
- protected boolean startUp() {
- if (started) {
- throw new IllegalStateException("Startup code has already been run");
- }
-
- started = true;
-
- loadRequiredNativeLibs();
-
- // Create the main app window.
- // When it is up and running, it will start the Tomcat server if desired.
- //
- openAppWindow();
-
- // Initialize the logger.
- //
- initializeLogger();
-
- if (runTomcat) {
- int resultPort = startUpServer();
- if (resultPort < 0) {
- return false;
- }
- port = resultPort;
- }
-
- return true;
- }
-
- protected int startUpServer() {
+ @Override
+ protected int doStartUpServer() {
// TODO(bruce): make tomcat work in terms of the modular launcher
String whyFailed = EmbeddedTomcatServer.start(getTopLogger(), getPort(),
options);
@@ -788,58 +231,14 @@
return EmbeddedTomcatServer.getPort();
}
- private Shell createTrackedBrowserShell() {
- final Shell shell = new Shell(display);
- FillLayout fillLayout = new FillLayout();
- fillLayout.marginWidth = 0;
- fillLayout.marginHeight = 0;
- shell.setLayout(fillLayout);
- browserShells.add(shell);
- shell.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (e.widget == shell) {
- browserShells.remove(shell);
- }
- }
- });
-
- shell.setImages(getIcons());
-
- return shell;
- }
-
- private void loadRequiredNativeLibs() {
- String libName = null;
- try {
- libName = "swt";
- Library.loadLibrary(libName);
- } catch (UnsatisfiedLinkError e) {
- StringBuffer sb = new StringBuffer();
- sb.append("Unable to load required native library '" + libName + "'");
- sb.append("\n\tPlease specify the JVM startup argument ");
- sb.append("\"-Djava.library.path\"");
- throw new RuntimeException(sb.toString(), e);
- }
- }
-
- private void openAppWindow() {
- final Shell shell = new Shell(display);
-
- FillLayout fillLayout = new FillLayout();
- fillLayout.marginWidth = 0;
- fillLayout.marginHeight = 0;
- shell.setLayout(fillLayout);
-
- shell.setImages(getIcons());
-
- boolean checkForUpdates = doShouldCheckForUpdates();
-
- mainWnd = new ShellMainWindow(this, shell, runTomcat ? getPort() : 0,
- checkForUpdates);
-
- shell.setSize(700, 600);
- if (!isHeadless()) {
- shell.open();
- }
+ @Override
+ protected boolean initModule(String moduleName) {
+ /*
+ * Not used in legacy mode due to GWTShellServlet playing this role.
+ *
+ * TODO: something smarter here and actually make GWTShellServlet less
+ * magic?
+ */
+ return false;
}
}
diff --git a/dev/core/src/com/google/gwt/dev/HostedMode.java b/dev/core/src/com/google/gwt/dev/HostedMode.java
new file mode 100644
index 0000000..cebda22
--- /dev/null
+++ b/dev/core/src/com/google/gwt/dev/HostedMode.java
@@ -0,0 +1,478 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.ServletContainer;
+import com.google.gwt.core.ext.ServletContainerLauncher;
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.core.ext.linker.ArtifactSet;
+import com.google.gwt.core.ext.linker.impl.StandardLinkerContext;
+import com.google.gwt.dev.Compiler.CompilerOptionsImpl;
+import com.google.gwt.dev.cfg.ModuleDef;
+import com.google.gwt.dev.shell.ArtifactAcceptor;
+import com.google.gwt.dev.shell.jetty.JettyLauncher;
+import com.google.gwt.dev.util.Util;
+import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
+import com.google.gwt.dev.util.arg.ArgHandlerLocalWorkers;
+import com.google.gwt.dev.util.arg.ArgHandlerModuleName;
+import com.google.gwt.dev.util.arg.ArgHandlerWarDir;
+import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional;
+import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.util.tools.ArgHandlerString;
+import com.google.gwt.util.tools.Utility;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.BindException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The main executable class for the hosted mode shell. NOTE: the public API for
+ * this class is to be determined. Consider this class as having <b>no</b>
+ * public API other than {@link #main(String[])}.
+ */
+public class HostedMode extends HostedModeBase {
+
+ /**
+ * Handles the -server command line flag.
+ */
+ protected static class ArgHandlerServer extends ArgHandlerString {
+ private HostedModeOptions options;
+
+ public ArgHandlerServer(HostedModeOptions options) {
+ this.options = options;
+ }
+
+ @Override
+ public String[] getDefaultArgs() {
+ if (options.isNoServer()) {
+ return null;
+ } else {
+ return new String[] {getTag(), JettyLauncher.class.getName()};
+ }
+ }
+
+ @Override
+ public String getPurpose() {
+ return "Prevents the embedded Tomcat server from running, even if a port is specified";
+ }
+
+ @Override
+ public String getTag() {
+ return "-server";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"servletContainerLauncher"};
+ }
+
+ @Override
+ public boolean setString(String sclClassName) {
+ // Supercedes -noserver.
+ options.setNoServer(false);
+ Throwable t;
+ try {
+ Class<?> clazz = Class.forName(sclClassName, true,
+ Thread.currentThread().getContextClassLoader());
+ Class<? extends ServletContainerLauncher> sclClass = clazz.asSubclass(ServletContainerLauncher.class);
+ options.setServletContainerLauncher(sclClass.newInstance());
+ return true;
+ } catch (ClassCastException e) {
+ t = e;
+ } catch (ClassNotFoundException e) {
+ t = e;
+ } catch (InstantiationException e) {
+ t = e;
+ } catch (IllegalAccessException e) {
+ t = e;
+ }
+ System.err.println("Unable to load server class '" + sclClassName + "'");
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * Handles a startup url that can be passed on the command line.
+ */
+ protected static class ArgHandlerStartupURLs extends ArgHandlerString {
+ private final OptionStartupURLs options;
+
+ public ArgHandlerStartupURLs(OptionStartupURLs options) {
+ this.options = options;
+ }
+
+ @Override
+ public String getPurpose() {
+ return "Automatically launches the specified URL";
+ }
+
+ @Override
+ public String getTag() {
+ return "-startupUrl";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"url"};
+ }
+
+ @Override
+ public boolean setString(String arg) {
+ options.addStartupURL(arg);
+ return true;
+ }
+ }
+
+ static class ArgProcessor extends HostedModeBase.ArgProcessor {
+ public ArgProcessor(HostedModeOptions options) {
+ super(options, false);
+ registerHandler(new ArgHandlerServer(options));
+ registerHandler(new ArgHandlerStartupURLs(options));
+ registerHandler(new ArgHandlerWarDir(options));
+ registerHandler(new ArgHandlerExtraDir(options));
+ registerHandler(new ArgHandlerWorkDirOptional(options));
+ registerHandler(new ArgHandlerLocalWorkers(options));
+ registerHandler(new ArgHandlerModuleName(options));
+ }
+
+ @Override
+ protected String getName() {
+ return HostedMode.class.getName();
+ }
+ }
+
+ interface HostedModeOptions extends HostedModeBaseOptions, CompilerOptions {
+ ServletContainerLauncher getServletContainerLauncher();
+
+ void setServletContainerLauncher(ServletContainerLauncher scl);
+ }
+
+ /**
+ * Concrete class to implement all hosted mode options.
+ */
+ static class HostedModeOptionsImpl extends HostedModeBaseOptionsImpl
+ implements HostedModeOptions {
+ private File extraDir;
+ private int localWorkers;
+ private ServletContainerLauncher scl;
+ private File warDir;
+
+ public File getExtraDir() {
+ return extraDir;
+ }
+
+ public int getLocalWorkers() {
+ return localWorkers;
+ }
+
+ public ServletContainerLauncher getServletContainerLauncher() {
+ return scl;
+ }
+
+ public File getShellBaseWorkDir(ModuleDef moduleDef) {
+ return new File(new File(getWorkDir(), moduleDef.getName()), "shell");
+ }
+
+ public File getShellPublicGenDir(ModuleDef moduleDef) {
+ return new File(getShellBaseWorkDir(moduleDef), "public");
+ }
+
+ public File getWarDir() {
+ return warDir;
+ }
+
+ public void setExtraDir(File extraDir) {
+ this.extraDir = extraDir;
+ }
+
+ public void setLocalWorkers(int localWorkers) {
+ this.localWorkers = localWorkers;
+ }
+
+ public void setServletContainerLauncher(ServletContainerLauncher scl) {
+ this.scl = scl;
+ }
+
+ public void setWarDir(File warDir) {
+ this.warDir = warDir;
+ }
+ }
+
+ public static void main(String[] args) {
+ /*
+ * NOTE: main always exits with a call to System.exit to terminate any
+ * non-daemon threads that were started in Generators. Typically, this is to
+ * shutdown AWT related threads, since the contract for their termination is
+ * still implementation-dependent.
+ */
+ HostedMode hostedMode = new HostedMode();
+ if (new ArgProcessor(hostedMode.options).processArgs(args)) {
+ hostedMode.run();
+ // Exit w/ success code.
+ System.exit(0);
+ }
+ // Exit w/ non-success code.
+ System.exit(-1);
+ }
+
+ protected final PrintWriterTreeLogger console = new PrintWriterTreeLogger(
+ new PrintWriter(System.err, true));
+
+ /**
+ * Hiding super field because it's actually the same object, just with a
+ * stronger type.
+ */
+ @SuppressWarnings("hiding")
+ protected final HostedModeOptionsImpl options = (HostedModeOptionsImpl) super.options;
+
+ /**
+ * Maps each active linker stack by module.
+ */
+ private final Map<String, StandardLinkerContext> linkerStacks = new HashMap<String, StandardLinkerContext>();
+
+ /**
+ * The set of specified modules by name; the keys represent the renamed name
+ * of each module rather than the canonical name.
+ */
+ private Map<String, ModuleDef> modulesByName = new HashMap<String, ModuleDef>();
+
+ /**
+ * The server that was started.
+ */
+ private ServletContainer server;
+
+ /**
+ * Tracks whether we created a temp workdir that we need to destroy.
+ */
+ private boolean tempWorkDir = false;
+
+ {
+ console.setMaxDetail(TreeLogger.WARN);
+ }
+
+ /**
+ * Default constructor for testing; no public API yet.
+ */
+ HostedMode() {
+ }
+
+ @Override
+ protected void compile(TreeLogger logger) throws UnableToCompleteException {
+ CompilerOptions newOptions = new CompilerOptionsImpl(options);
+ new Compiler(newOptions).run(logger);
+ }
+
+ protected void compile(TreeLogger logger, ModuleDef moduleDef)
+ throws UnableToCompleteException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected HostedModeBaseOptions createOptions() {
+ return new HostedModeOptionsImpl();
+ }
+
+ @Override
+ protected ArtifactAcceptor doCreateArtifactAcceptor(final ModuleDef module) {
+ return new ArtifactAcceptor() {
+ public void accept(TreeLogger logger, ArtifactSet newlyGeneratedArtifacts)
+ throws UnableToCompleteException {
+ relink(logger, module, newlyGeneratedArtifacts);
+ }
+ };
+ }
+
+ @Override
+ protected void doShutDownServer() {
+ if (server != null) {
+ try {
+ server.stop();
+ } catch (UnableToCompleteException e) {
+ // Already logged.
+ }
+ server = null;
+ }
+
+ if (tempWorkDir) {
+ Util.recursiveDelete(options.getWorkDir(), false);
+ }
+ }
+
+ @Override
+ protected boolean doStartup() {
+ if (!super.doStartup()) {
+ return false;
+ }
+ tempWorkDir = options.getWorkDir() == null;
+ if (tempWorkDir) {
+ try {
+ options.setWorkDir(Utility.makeTemporaryDirectory(null, "gwtc"));
+ } catch (IOException e) {
+ System.err.println("Unable to create hosted mode work directory");
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ for (String moduleName : options.getModuleNames()) {
+ TreeLogger loadLogger = getTopLogger().branch(TreeLogger.DEBUG,
+ "Loading module " + moduleName);
+ try {
+ ModuleDef module = loadModule(loadLogger, moduleName, false);
+
+ // TODO: Validate servlet tags.
+ String[] servletPaths = module.getServletPaths();
+ if (servletPaths.length > 0) {
+ loadLogger.log(TreeLogger.WARN,
+ "Ignoring legacy <servlet> tag(s) in module '" + moduleName
+ + "'; add servlet tags to your web.xml instead");
+ }
+
+ link(loadLogger, module, false);
+ } catch (UnableToCompleteException e) {
+ // Already logged.
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ protected int doStartUpServer() {
+ try {
+ TreeLogger serverLogger = getTopLogger().branch(TreeLogger.INFO,
+ "Starting HTTP on port " + getPort(), null);
+ server = options.getServletContainerLauncher().start(serverLogger,
+ getPort(), options.getWarDir());
+ assert (server != null);
+ return server.getPort();
+ } catch (BindException e) {
+ System.err.println("Port "
+ + getPort()
+ + " is already is use; you probably still have another session active");
+ } catch (Exception e) {
+ System.err.println("Unable to start embedded HTTP server");
+ e.printStackTrace();
+ }
+ return -1;
+ }
+
+ @Override
+ protected String getHost() {
+ if (server != null) {
+ return server.getHost();
+ }
+ return super.getHost();
+ }
+
+ @Override
+ protected boolean initModule(String moduleName) {
+ ModuleDef module = modulesByName.get(moduleName);
+ if (module == null) {
+ getTopLogger().log(
+ TreeLogger.WARN,
+ "Unknown module requested '"
+ + moduleName
+ + "'; all active GWT modules must be specified in the command line arguments");
+ return false;
+ }
+ try {
+ boolean shouldRefreshPage = false;
+ if (module.isGwtXmlFileStale()) {
+ shouldRefreshPage = true;
+ module = loadModule(getTopLogger(), module.getCanonicalName(), false);
+ }
+ link(getTopLogger(), module, true);
+ return shouldRefreshPage;
+ } catch (UnableToCompleteException e) {
+ // Already logged.
+ return false;
+ }
+ }
+
+ /*
+ * Overridden to keep our map up to date.
+ */
+ @Override
+ protected ModuleDef loadModule(TreeLogger logger, String moduleName,
+ boolean refresh) throws UnableToCompleteException {
+ ModuleDef module = super.loadModule(logger, moduleName, refresh);
+ modulesByName.put(module.getName(), module);
+ return module;
+ }
+
+ /**
+ * Perform an initial hosted mode link, without overwriting newer or
+ * unmodified files in the output folder.
+ *
+ * @param logger the logger to use
+ * @param module the module to link
+ * @param includePublicFiles if <code>true</code>, include public files in
+ * the link, otherwise do not include them
+ * @throws UnableToCompleteException
+ */
+ private void link(TreeLogger logger, ModuleDef module,
+ boolean includePublicFiles) throws UnableToCompleteException {
+ // TODO: move the module-specific computations to a helper function.
+ File moduleOutDir = new File(options.getWarDir(), module.getName());
+ File moduleExtraDir = (options.getExtraDir() == null) ? null : new File(
+ options.getExtraDir(), module.getName());
+
+ // Create a new active linker stack for the fresh link.
+ StandardLinkerContext linkerStack = new StandardLinkerContext(logger,
+ module, options);
+ linkerStacks.put(module.getName(), linkerStack);
+
+ if (!includePublicFiles) {
+ linkerStack.getArtifacts().clear();
+ }
+
+ ArtifactSet artifacts = linkerStack.invokeLink(logger);
+ linkerStack.produceOutputDirectory(logger, artifacts, moduleOutDir,
+ moduleExtraDir);
+ }
+
+ /**
+ * Perform hosted mode relink when new artifacts are generated, without
+ * overwriting newer or unmodified files in the output folder.
+ *
+ * @param logger the logger to use
+ * @param module the module to link
+ * @param newlyGeneratedArtifacts the set of new artifacts
+ * @throws UnableToCompleteException
+ */
+ private void relink(TreeLogger logger, ModuleDef module,
+ ArtifactSet newlyGeneratedArtifacts) throws UnableToCompleteException {
+ // TODO: move the module-specific computations to a helper function.
+ File moduleOutDir = new File(options.getWarDir(), module.getName());
+ File moduleExtraDir = (options.getExtraDir() == null) ? null : new File(
+ options.getExtraDir(), module.getName());
+
+ // Find the existing linker stack.
+ StandardLinkerContext linkerStack = linkerStacks.get(module.getName());
+ assert linkerStack != null;
+
+ ArtifactSet artifacts = linkerStack.invokeRelink(logger,
+ newlyGeneratedArtifacts);
+ linkerStack.produceOutputDirectory(logger, artifacts, moduleOutDir,
+ moduleExtraDir);
+ }
+}
diff --git a/dev/core/src/com/google/gwt/dev/HostedModeBase.java b/dev/core/src/com/google/gwt/dev/HostedModeBase.java
new file mode 100644
index 0000000..4f4181d
--- /dev/null
+++ b/dev/core/src/com/google/gwt/dev/HostedModeBase.java
@@ -0,0 +1,772 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.core.ext.typeinfo.TypeOracle;
+import com.google.gwt.dev.Precompile.PrecompileOptionsImpl;
+import com.google.gwt.dev.cfg.ModuleDef;
+import com.google.gwt.dev.cfg.ModuleDefLoader;
+import com.google.gwt.dev.jjs.JJSOptions;
+import com.google.gwt.dev.shell.ArtifactAcceptor;
+import com.google.gwt.dev.shell.BrowserWidget;
+import com.google.gwt.dev.shell.BrowserWidgetHost;
+import com.google.gwt.dev.shell.BrowserWidgetHostChecker;
+import com.google.gwt.dev.shell.BrowserWindowController;
+import com.google.gwt.dev.shell.ModuleSpaceHost;
+import com.google.gwt.dev.shell.PlatformSpecific;
+import com.google.gwt.dev.shell.ShellMainWindow;
+import com.google.gwt.dev.shell.ShellModuleSpaceHost;
+import com.google.gwt.dev.util.Util;
+import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization;
+import com.google.gwt.dev.util.arg.ArgHandlerEnableAssertions;
+import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
+import com.google.gwt.dev.util.arg.ArgHandlerLogLevel;
+import com.google.gwt.dev.util.arg.ArgHandlerScriptStyle;
+import com.google.gwt.dev.util.arg.OptionGenDir;
+import com.google.gwt.dev.util.arg.OptionLogLevel;
+import com.google.gwt.dev.util.log.AbstractTreeLogger;
+import com.google.gwt.util.tools.ArgHandlerFlag;
+import com.google.gwt.util.tools.ArgHandlerString;
+import com.google.gwt.util.tools.ToolBase;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The main executable class for the hosted mode shell.
+ */
+abstract class HostedModeBase implements BrowserWindowController {
+
+ /**
+ * Handles the -blacklist command line argument.
+ */
+ protected static class ArgHandlerBlacklist extends ArgHandlerString {
+ @Override
+ public String getPurpose() {
+ return "Prevents the user browsing URLs that match the specified regexes (comma or space separated)";
+ }
+
+ @Override
+ public String getTag() {
+ return "-blacklist";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"blacklist-string"};
+ }
+
+ @Override
+ public boolean setString(String blacklistStr) {
+ return BrowserWidgetHostChecker.blacklistRegexes(blacklistStr);
+ }
+ }
+
+ /**
+ * Handles the -noserver command line flag.
+ */
+ protected static class ArgHandlerNoServerFlag extends ArgHandlerFlag {
+ private final OptionNoServer options;
+
+ public ArgHandlerNoServerFlag(OptionNoServer options) {
+ this.options = options;
+ }
+
+ @Override
+ public String getPurpose() {
+ return "Prevents the embedded Tomcat server from running, even if a port is specified";
+ }
+
+ @Override
+ public String getTag() {
+ return "-noserver";
+ }
+
+ @Override
+ public boolean setFlag() {
+ options.setNoServer(true);
+ return true;
+ }
+ }
+
+ /**
+ * Handles the -port command line flag.
+ */
+ protected static class ArgHandlerPort extends ArgHandlerString {
+
+ private final OptionPort options;
+
+ public ArgHandlerPort(OptionPort options) {
+ this.options = options;
+ }
+
+ @Override
+ public String[] getDefaultArgs() {
+ return new String[] {getTag(), "8888"};
+ }
+
+ @Override
+ public String getPurpose() {
+ return "Runs an embedded Tomcat instance on the specified port (defaults to 8888)";
+ }
+
+ @Override
+ public String getTag() {
+ return "-port";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"port-number | \"auto\""};
+ }
+
+ @Override
+ public boolean setString(String value) {
+ if (value.equals("auto")) {
+ options.setPort(0);
+ } else {
+ try {
+ options.setPort(Integer.parseInt(value));
+ } catch (NumberFormatException e) {
+ System.err.println("A port must be an integer or \"auto\"");
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Handles the -whitelist command line flag.
+ */
+ protected static class ArgHandlerWhitelist extends ArgHandlerString {
+ @Override
+ public String getPurpose() {
+ return "Allows the user to browse URLs that match the specified regexes (comma or space separated)";
+ }
+
+ @Override
+ public String getTag() {
+ return "-whitelist";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"whitelist-string"};
+ }
+
+ @Override
+ public boolean setString(String whitelistStr) {
+ return BrowserWidgetHostChecker.whitelistRegexes(whitelistStr);
+ }
+ }
+
+ protected interface HostedModeBaseOptions extends JJSOptions, OptionLogLevel,
+ OptionGenDir, OptionNoServer, OptionPort, OptionStartupURLs {
+
+ /**
+ * The base shell work directory.
+ */
+ File getShellBaseWorkDir(ModuleDef moduleDef);
+ }
+
+ /**
+ * Concrete class to implement all hosted mode base options.
+ */
+ protected static class HostedModeBaseOptionsImpl extends
+ PrecompileOptionsImpl implements HostedModeBaseOptions {
+
+ private boolean isNoServer;
+ private int port;
+ private final List<String> startupURLs = new ArrayList<String>();
+
+ public void addStartupURL(String url) {
+ startupURLs.add(url);
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public File getShellBaseWorkDir(ModuleDef moduleDef) {
+ return new File(new File(getWorkDir(), moduleDef.getName()), "shell");
+ }
+
+ public List<String> getStartupURLs() {
+ return Collections.unmodifiableList(startupURLs);
+ }
+
+ public boolean isNoServer() {
+ return isNoServer;
+ }
+
+ public void setNoServer(boolean isNoServer) {
+ this.isNoServer = isNoServer;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+ }
+
+ /**
+ * Controls whether to run a server or not.
+ *
+ */
+ protected interface OptionNoServer {
+ boolean isNoServer();
+
+ void setNoServer(boolean isNoServer);
+ }
+
+ /**
+ * Controls what port to use.
+ *
+ */
+ protected interface OptionPort {
+ int getPort();
+
+ void setPort(int port);
+ }
+
+ /**
+ * Controls the startup URLs.
+ */
+ protected interface OptionStartupURLs {
+ void addStartupURL(String url);
+
+ List<String> getStartupURLs();
+ }
+
+ abstract static class ArgProcessor extends ArgProcessorBase {
+ public ArgProcessor(HostedModeBaseOptions options, boolean forceServer) {
+ if (!forceServer) {
+ registerHandler(new ArgHandlerNoServerFlag(options));
+ }
+ registerHandler(new ArgHandlerPort(options));
+ registerHandler(new ArgHandlerWhitelist());
+ registerHandler(new ArgHandlerBlacklist());
+ registerHandler(new ArgHandlerLogLevel(options));
+ registerHandler(new ArgHandlerGenDir(options));
+ registerHandler(new ArgHandlerScriptStyle(options));
+ registerHandler(new ArgHandlerEnableAssertions(options));
+ registerHandler(new ArgHandlerDisableAggressiveOptimization(options));
+ }
+ }
+
+ private class BrowserWidgetHostImpl implements BrowserWidgetHost {
+
+ public void compile() throws UnableToCompleteException {
+ if (isLegacyMode()) {
+ throw new UnsupportedOperationException();
+ }
+ HostedModeBase.this.compile(getLogger());
+ }
+
+ public void compile(String[] moduleNames) throws UnableToCompleteException {
+ if (!isLegacyMode()) {
+ throw new UnsupportedOperationException();
+ }
+ for (int i = 0; i < moduleNames.length; i++) {
+ String moduleName = moduleNames[i];
+ ModuleDef moduleDef = loadModule(getLogger(), moduleName, true);
+ HostedModeBase.this.compile(getLogger(), moduleDef);
+ }
+ }
+
+ public ModuleSpaceHost createModuleSpaceHost(BrowserWidget widget,
+ final String moduleName) throws UnableToCompleteException {
+ TreeLogger logger = getLogger();
+
+ // Switch to a wait cursor.
+ //
+ Shell widgetShell = widget.getShell();
+ try {
+ Cursor waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
+ widgetShell.setCursor(waitCursor);
+
+ // Try to find an existing loaded version of the module def.
+ //
+ ModuleDef moduleDef = loadModule(logger, moduleName, true);
+ assert (moduleDef != null);
+
+ TypeOracle typeOracle = moduleDef.getTypeOracle(logger);
+ ShellModuleSpaceHost host = doCreateShellModuleSpaceHost(logger,
+ typeOracle, moduleDef);
+ return host;
+ } finally {
+ Cursor normalCursor = display.getSystemCursor(SWT.CURSOR_ARROW);
+ widgetShell.setCursor(normalCursor);
+ }
+ }
+
+ public TreeLogger getLogger() {
+ return getTopLogger();
+ }
+
+ public boolean initModule(String moduleName) {
+ return HostedModeBase.this.initModule(moduleName);
+ }
+
+ @Deprecated
+ public boolean isLegacyMode() {
+ return HostedModeBase.this instanceof GWTShell;
+ }
+
+ public String normalizeURL(String whatTheUserTyped) {
+ return HostedModeBase.this.normalizeURL(whatTheUserTyped);
+ }
+
+ public BrowserWidget openNewBrowserWindow()
+ throws UnableToCompleteException {
+ return HostedModeBase.this.openNewBrowserWindow();
+ }
+ }
+
+ static {
+ // Force ToolBase to clinit, which causes SWT stuff to happen.
+ new ToolBase() {
+ };
+ // Correct menu on Mac OS X
+ Display.setAppName("GWT");
+ }
+
+ protected final HostedModeBaseOptions options;
+
+ /**
+ * Cheat on the first load's refresh by assuming the module loaded by
+ * {@link com.google.gwt.dev.shell.GWTShellServlet} is still fresh. This
+ * prevents a double-refresh on startup. Subsequent refreshes will trigger a
+ * real refresh.
+ */
+ private Set<String> alreadySeenModules = new HashSet<String>();
+
+ private BrowserWidgetHostImpl browserHost = new BrowserWidgetHostImpl();
+
+ private final List<Shell> browserShells = new ArrayList<Shell>();
+
+ /**
+ * Use the default display; constructing a new one would make instantiating
+ * multiple GWTShells fail with a mysterious exception.
+ */
+ private final Display display = Display.getDefault();
+
+ private boolean headlessMode = false;
+
+ private ShellMainWindow mainWnd;
+
+ private boolean started;
+
+ public HostedModeBase() {
+ // Set any platform specific system properties.
+ BootStrapPlatform.initHostedMode();
+ BootStrapPlatform.applyPlatformHacks();
+ options = createOptions();
+ }
+
+ public final void addStartupURL(String url) {
+ options.addStartupURL(url);
+ }
+
+ public final void closeAllBrowserWindows() {
+ while (!browserShells.isEmpty()) {
+ browserShells.get(0).dispose();
+ }
+ }
+
+ public final int getPort() {
+ return options.getPort();
+ }
+
+ public TreeLogger getTopLogger() {
+ return mainWnd.getLogger();
+ }
+
+ public final boolean hasBrowserWindowsOpen() {
+ if (browserShells.isEmpty()) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Launch the arguments as Urls in separate windows.
+ */
+ public void launchStartupUrls(final TreeLogger logger) {
+ // Launch a browser window for each startup url.
+ String startupURL = "";
+ try {
+ for (String prenormalized : options.getStartupURLs()) {
+ startupURL = normalizeURL(prenormalized);
+ logger.log(TreeLogger.TRACE, "Starting URL: " + startupURL, null);
+ BrowserWidget bw = openNewBrowserWindow();
+ bw.go(startupURL);
+ }
+ } catch (UnableToCompleteException e) {
+ logger.log(TreeLogger.ERROR,
+ "Unable to open new window for startup URL: " + startupURL, null);
+ }
+ }
+
+ public final String normalizeURL(String unknownUrlText) {
+ if (unknownUrlText.indexOf(":") != -1) {
+ // Assume it's a full url.
+ return unknownUrlText;
+ }
+
+ // Assume it's a trailing url path.
+ if (unknownUrlText.length() > 0 && unknownUrlText.charAt(0) == '/') {
+ unknownUrlText = unknownUrlText.substring(1);
+ }
+
+ int port = getPort();
+ String host = getHost();
+ if (port != 80) {
+ // CHECKSTYLE_OFF: Not really an assembled error message, so no space
+ // after ':'.
+ return "http://" + host + ":" + port + "/" + unknownUrlText;
+ // CHECKSTYLE_ON
+ } else {
+ return "http://" + host + "/" + unknownUrlText;
+ }
+ }
+
+ /**
+ * Called directly by ShellMainWindow and indirectly via BrowserWidgetHost.
+ */
+ public final BrowserWidget openNewBrowserWindow()
+ throws UnableToCompleteException {
+ boolean succeeded = false;
+ Shell s = createTrackedBrowserShell();
+ try {
+ BrowserWidget bw = PlatformSpecific.createBrowserWidget(getTopLogger(),
+ s, browserHost);
+
+ if (mainWnd != null) {
+ Rectangle r = mainWnd.getShell().getBounds();
+ int n = browserShells.size() + 1;
+ s.setBounds(r.x + n * 50, r.y + n * 50, 800, 600);
+ } else {
+ s.setSize(800, 600);
+ }
+
+ if (!isHeadless()) {
+ s.open();
+ }
+
+ bw.onFirstShown();
+ succeeded = true;
+ return bw;
+ } finally {
+ if (!succeeded) {
+ s.dispose();
+ }
+ }
+ }
+
+ /**
+ * Sets up all the major aspects of running the shell graphically, including
+ * creating the main window and optionally starting the embedded Tomcat
+ * server.
+ */
+ public final void run() {
+ try {
+ if (!startUp()) {
+ // Failed to initalize.
+ return;
+ }
+
+ // Eager AWT initialization for OS X to ensure safe coexistence with SWT.
+ BootStrapPlatform.initGui();
+
+ // Tomcat's running now, so launch browsers for startup urls now.
+ launchStartupUrls(getTopLogger());
+
+ pumpEventLoop();
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ shutDown();
+ }
+ }
+
+ public final void setPort(int port) {
+ options.setPort(port);
+ }
+
+ public final void setRunTomcat(boolean run) {
+ options.setNoServer(!run);
+ }
+
+ /**
+ * Compiles all modules.
+ */
+ protected abstract void compile(TreeLogger logger)
+ throws UnableToCompleteException;
+
+ /**
+ * Compiles a module (legacy only).
+ */
+ @Deprecated
+ protected abstract void compile(TreeLogger logger, ModuleDef moduleDef)
+ throws UnableToCompleteException;
+
+ protected abstract HostedModeBaseOptions createOptions();
+
+ protected abstract ArtifactAcceptor doCreateArtifactAcceptor(ModuleDef module);
+
+ /**
+ * Creates an instance of ShellModuleSpaceHost (or a derived class) using the
+ * specified constituent parts. This method is made to be overridden for
+ * subclasses that need to change the behavior of ShellModuleSpaceHost.
+ *
+ * @param logger TreeLogger to use
+ * @param typeOracle
+ * @param moduleDef
+ * @param genDir
+ * @return ShellModuleSpaceHost instance
+ */
+ protected final ShellModuleSpaceHost doCreateShellModuleSpaceHost(
+ TreeLogger logger, TypeOracle typeOracle, ModuleDef moduleDef) {
+ // Clear out the shell temp directory.
+ Util.recursiveDelete(options.getShellBaseWorkDir(moduleDef), true);
+ return new ShellModuleSpaceHost(logger, typeOracle, moduleDef,
+ options.getGenDir(), new File(options.getShellBaseWorkDir(moduleDef),
+ "gen"), doCreateArtifactAcceptor(moduleDef));
+ }
+
+ /**
+ * Derived classes can override to prevent automatic update checking.
+ */
+ protected boolean doShouldCheckForUpdates() {
+ return true;
+ }
+
+ protected abstract void doShutDownServer();
+
+ protected boolean doStartup() {
+ loadRequiredNativeLibs();
+
+ // Create the main app window.
+ openAppWindow();
+
+ // Initialize the logger.
+ //
+ initializeLogger();
+ return true;
+ }
+
+ protected abstract int doStartUpServer();
+
+ protected final BrowserWidgetHost getBrowserHost() {
+ return browserHost;
+ }
+
+ protected String getHost() {
+ return "localhost";
+ }
+
+ protected void initializeLogger() {
+ final AbstractTreeLogger logger = mainWnd.getLogger();
+ logger.setMaxDetail(options.getLogLevel());
+ }
+
+ /**
+ * Called from a selection script as it begins to load in hosted mode. This
+ * triggers a hosted mode link, which might actually update the running
+ * selection script.
+ *
+ * @param moduleName the module to link
+ * @return <code>true</code> if the selection script was overwritten; this
+ * will trigger a full-page refresh by the calling (out of date)
+ * selection script
+ */
+ protected abstract boolean initModule(String moduleName);
+
+ /**
+ * By default we will open the application window.
+ *
+ * @return true if we are running in headless mode
+ */
+ protected final boolean isHeadless() {
+ return headlessMode;
+ }
+
+ /**
+ * Load a module.
+ *
+ * @param moduleName name of the module to load
+ * @param logger TreeLogger to use
+ * @param refresh if <code>true</code>, refresh the module from disk
+ * @return the loaded module
+ * @throws UnableToCompleteException
+ */
+ protected ModuleDef loadModule(TreeLogger logger, String moduleName,
+ boolean refresh) throws UnableToCompleteException {
+ refresh &= alreadySeenModules.contains(moduleName);
+ ModuleDef moduleDef = ModuleDefLoader.loadFromClassPath(logger, moduleName,
+ refresh);
+ alreadySeenModules.add(moduleName);
+ assert (moduleDef != null) : "Required module state is absent";
+ return moduleDef;
+ }
+
+ protected boolean notDone() {
+ if (!mainWnd.isDisposed()) {
+ return true;
+ }
+ if (!browserShells.isEmpty()) {
+ return true;
+ }
+ return false;
+ }
+
+ protected final void pumpEventLoop() {
+ TreeLogger logger = getTopLogger();
+
+ // Run the event loop. When there are no open shells, quit.
+ //
+ while (notDone()) {
+ try {
+ if (!display.readAndDispatch()) {
+ sleep();
+ }
+ } catch (Throwable e) {
+ String msg = e.getMessage();
+ msg = (msg != null ? msg : e.getClass().getName());
+ logger.log(TreeLogger.ERROR, msg, e);
+ }
+ }
+ }
+
+ protected final void setHeadless(boolean headlessMode) {
+ this.headlessMode = headlessMode;
+ }
+
+ protected final void shutDown() {
+ if (options.isNoServer()) {
+ return;
+ }
+ doShutDownServer();
+ }
+
+ protected void sleep() {
+ display.sleep();
+ }
+
+ protected final boolean startUp() {
+ if (started) {
+ throw new IllegalStateException("Startup code has already been run");
+ }
+
+ started = true;
+
+ if (!doStartup()) {
+ return false;
+ }
+
+ startupHook();
+
+ if (!options.isNoServer()) {
+ int resultPort = doStartUpServer();
+ if (resultPort < 0) {
+ return false;
+ }
+ options.setPort(resultPort);
+ }
+
+ return true;
+ }
+
+ /**
+ * Hook for subclasses to initialize things after the window and logger are
+ * initialized but before the embedded server is started.
+ */
+ protected void startupHook() {
+ }
+
+ private Shell createTrackedBrowserShell() {
+ final Shell shell = new Shell(display);
+ FillLayout fillLayout = new FillLayout();
+ fillLayout.marginWidth = 0;
+ fillLayout.marginHeight = 0;
+ shell.setLayout(fillLayout);
+ browserShells.add(shell);
+ shell.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ if (e.widget == shell) {
+ browserShells.remove(shell);
+ }
+ }
+ });
+
+ shell.setImages(ShellMainWindow.getIcons());
+
+ return shell;
+ }
+
+ private void loadRequiredNativeLibs() {
+ String libName = null;
+ try {
+ libName = "swt";
+ Library.loadLibrary(libName);
+ } catch (UnsatisfiedLinkError e) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Unable to load required native library '" + libName + "'");
+ sb.append("\n\tPlease specify the JVM startup argument ");
+ sb.append("\"-Djava.library.path\"");
+ throw new RuntimeException(sb.toString(), e);
+ }
+ }
+
+ protected void openAppWindow() {
+ final Shell shell = new Shell(display);
+
+ FillLayout fillLayout = new FillLayout();
+ fillLayout.marginWidth = 0;
+ fillLayout.marginHeight = 0;
+ shell.setLayout(fillLayout);
+
+ shell.setImages(ShellMainWindow.getIcons());
+
+ boolean checkForUpdates = doShouldCheckForUpdates();
+
+ mainWnd = new ShellMainWindow(this, shell, options.isNoServer() ? 0
+ : getPort(), checkForUpdates);
+
+ shell.setSize(700, 600);
+ if (!isHeadless()) {
+ shell.open();
+ }
+ }
+}
diff --git a/dev/core/src/com/google/gwt/dev/ShellOptions.java b/dev/core/src/com/google/gwt/dev/HostedModeOptions.java
similarity index 83%
rename from dev/core/src/com/google/gwt/dev/ShellOptions.java
rename to dev/core/src/com/google/gwt/dev/HostedModeOptions.java
index 71ea4e8..53ed608 100644
--- a/dev/core/src/com/google/gwt/dev/ShellOptions.java
+++ b/dev/core/src/com/google/gwt/dev/HostedModeOptions.java
@@ -19,11 +19,11 @@
import com.google.gwt.dev.util.arg.OptionExtraDir;
import com.google.gwt.dev.util.arg.OptionGenDir;
import com.google.gwt.dev.util.arg.OptionLogLevel;
-import com.google.gwt.dev.util.arg.OptionOutDir;
+import com.google.gwt.dev.util.arg.OptionWarDir;
/**
* The complete set of options for the GWT compiler.
*/
-public interface ShellOptions extends JJSOptions, OptionLogLevel, OptionOutDir,
- OptionGenDir, OptionExtraDir {
+public interface HostedModeOptions extends JJSOptions, OptionLogLevel,
+ OptionExtraDir, OptionWarDir, OptionGenDir {
}
diff --git a/dev/core/src/com/google/gwt/dev/ShellOptions.java b/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java
similarity index 65%
copy from dev/core/src/com/google/gwt/dev/ShellOptions.java
copy to dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java
index 71ea4e8..c72bcc1 100644
--- a/dev/core/src/com/google/gwt/dev/ShellOptions.java
+++ b/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java
@@ -15,15 +15,13 @@
*/
package com.google.gwt.dev;
-import com.google.gwt.dev.jjs.JJSOptions;
-import com.google.gwt.dev.util.arg.OptionExtraDir;
-import com.google.gwt.dev.util.arg.OptionGenDir;
-import com.google.gwt.dev.util.arg.OptionLogLevel;
-import com.google.gwt.dev.util.arg.OptionOutDir;
+import com.google.gwt.dev.Link.LegacyLinkOptions;
+import com.google.gwt.dev.Precompile.PrecompileOptions;
/**
* The complete set of options for the GWT compiler.
*/
-public interface ShellOptions extends JJSOptions, OptionLogLevel, OptionOutDir,
- OptionGenDir, OptionExtraDir {
+public interface LegacyCompilerOptions extends PrecompileOptions, LegacyLinkOptions,
+ OptionLocalWorkers {
}
+
\ No newline at end of file
diff --git a/dev/core/src/com/google/gwt/dev/Link.java b/dev/core/src/com/google/gwt/dev/Link.java
index 99d2252..e1a911e 100644
--- a/dev/core/src/com/google/gwt/dev/Link.java
+++ b/dev/core/src/com/google/gwt/dev/Link.java
@@ -29,9 +29,10 @@
import com.google.gwt.dev.util.FileBackedObject;
import com.google.gwt.dev.util.Util;
import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
-import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
+import com.google.gwt.dev.util.arg.ArgHandlerWarDir;
import com.google.gwt.dev.util.arg.OptionExtraDir;
import com.google.gwt.dev.util.arg.OptionOutDir;
+import com.google.gwt.dev.util.arg.OptionWarDir;
import java.io.File;
import java.util.ArrayList;
@@ -46,15 +47,21 @@
/**
* Options for Link.
*/
+ public interface LegacyLinkOptions extends CompileTaskOptions, OptionOutDir {
+ }
+
+ /**
+ * Options for Link.
+ */
public interface LinkOptions extends CompileTaskOptions, OptionExtraDir,
- OptionOutDir {
+ OptionWarDir {
}
static class ArgProcessor extends CompileArgProcessor {
public ArgProcessor(LinkOptions options) {
super(options);
registerHandler(new ArgHandlerExtraDir(options));
- registerHandler(new ArgHandlerOutDir(options));
+ registerHandler(new ArgHandlerWarDir(options));
}
@Override
@@ -70,7 +77,7 @@
LinkOptions {
private File extraDir;
- private File outDir;
+ private File warDir;
public LinkOptionsImpl() {
}
@@ -82,26 +89,37 @@
public void copyFrom(LinkOptions other) {
super.copyFrom(other);
setExtraDir(other.getExtraDir());
- setOutDir(other.getOutDir());
+ setWarDir(other.getWarDir());
}
public File getExtraDir() {
return extraDir;
}
- public File getOutDir() {
- return outDir;
+ public File getWarDir() {
+ return warDir;
}
public void setExtraDir(File extraDir) {
this.extraDir = extraDir;
}
- public void setOutDir(File outDir) {
- this.outDir = outDir;
+ public void setWarDir(File warDir) {
+ this.warDir = warDir;
}
}
+ public static void legacyLink(TreeLogger logger, ModuleDef module,
+ Precompilation precompilation,
+ List<FileBackedObject<PermutationResult>> resultFiles, File outDir)
+ throws UnableToCompleteException {
+ StandardLinkerContext linkerContext = new StandardLinkerContext(logger,
+ module, precompilation.getUnifiedAst().getOptions());
+ ArtifactSet artifacts = doLink(logger, linkerContext, precompilation,
+ resultFiles);
+ doProduceLegacyOutput(logger, artifacts, linkerContext, module, outDir);
+ }
+
public static ArtifactSet link(TreeLogger logger, ModuleDef module,
Precompilation precompilation,
List<FileBackedObject<PermutationResult>> resultFiles)
@@ -163,45 +181,31 @@
return linkerContext.invokeLink(logger);
}
- private static void doProduceOutput(TreeLogger logger, ArtifactSet artifacts,
- StandardLinkerContext linkerContext, ModuleDef module, File outDir,
- File extraDir) throws UnableToCompleteException {
- boolean warnOnExtra = false;
- File moduleExtraDir;
- if (extraDir == null) {
- /*
- * Legacy behavior for backwards compatibility; if the extra directory is
- * not specified, make it a sibling to the deploy directory, with -aux.
- */
- String deployDir = module.getDeployTo();
- deployDir = deployDir.substring(0, deployDir.length() - 1) + "-aux";
- moduleExtraDir = new File(outDir, deployDir);
-
- /*
- * Only warn when we create a new legacy extra dir.
- */
- warnOnExtra = !moduleExtraDir.exists();
- } else {
- moduleExtraDir = new File(extraDir, module.getDeployTo());
- }
-
- File moduleOutDir = new File(outDir, module.getDeployTo());
+ private static void doProduceLegacyOutput(TreeLogger logger,
+ ArtifactSet artifacts, StandardLinkerContext linkerContext,
+ ModuleDef module, File outDir) throws UnableToCompleteException {
+ File moduleOutDir = new File(outDir, module.getName());
+ File moduleExtraDir = new File(outDir, module.getName() + "-aux");
Util.recursiveDelete(moduleOutDir, true);
Util.recursiveDelete(moduleExtraDir, true);
linkerContext.produceOutputDirectory(logger, artifacts, moduleOutDir,
moduleExtraDir);
+ logger.log(TreeLogger.INFO, "Link succeeded");
+ }
- /*
- * Warn on legacy extra directory, but only if: 1) It didn't exist before.
- * 2) We just created it.
- */
- if (warnOnExtra && moduleExtraDir.exists()) {
- logger.log(
- TreeLogger.WARN,
- "Non-public artificats were produced in '"
- + moduleExtraDir.getAbsolutePath()
- + "' within the public output folder; use -extra to specify an alternate location");
+ private static void doProduceOutput(TreeLogger logger, ArtifactSet artifacts,
+ StandardLinkerContext linkerContext, ModuleDef module, File outDir,
+ File extraDir) throws UnableToCompleteException {
+ // TODO: move the module-specific computations to a helper function.
+ File moduleOutDir = new File(outDir, module.getName());
+ File moduleExtraDir = (extraDir == null) ? null : new File(extraDir,
+ module.getName());
+ Util.recursiveDelete(moduleOutDir, true);
+ if (moduleExtraDir != null) {
+ Util.recursiveDelete(moduleExtraDir, true);
}
+ linkerContext.produceOutputDirectory(logger, artifacts, moduleOutDir,
+ moduleExtraDir);
logger.log(TreeLogger.INFO, "Link succeeded");
}
@@ -230,8 +234,6 @@
}
}
- private ModuleDef module;
-
private final LinkOptionsImpl options;
public Link(LinkOptions options) {
@@ -239,9 +241,11 @@
}
public boolean run(TreeLogger logger) throws UnableToCompleteException {
- module = ModuleDefLoader.loadFromClassPath(logger, options.getModuleName());
+ for (String moduleName : options.getModuleNames()) {
+ File compilerWorkDir = options.getCompilerWorkDir(moduleName);
+ ModuleDef module = ModuleDefLoader.loadFromClassPath(logger, moduleName);
- File precompilationFile = new File(options.getCompilerWorkDir(),
+ File precompilationFile = new File(options.getCompilerWorkDir(moduleName),
Precompile.PRECOMPILATION_FILENAME);
if (!precompilationFile.exists()) {
logger.log(TreeLogger.ERROR, "File not found '"
@@ -251,40 +255,40 @@
}
Precompilation precompilation;
- try {
- precompilation = Util.readFileAsObject(precompilationFile,
- Precompilation.class);
- } catch (ClassNotFoundException e) {
- logger.log(TreeLogger.ERROR, "Unable to deserialize '"
- + precompilationFile.getAbsolutePath() + "'", e);
- return false;
- }
- Permutation[] perms = precompilation.getPermutations();
-
- List<FileBackedObject<PermutationResult>> resultFiles = new ArrayList<FileBackedObject<PermutationResult>>(
- perms.length);
- for (int i = 0; i < perms.length; ++i) {
- File permFile = CompilePerms.makePermFilename(
- options.getCompilerWorkDir(), i);
- if (!permFile.exists()) {
- logger.log(TreeLogger.ERROR, "File not found '"
- + precompilationFile.getAbsolutePath()
- + "'; please compile all permutations");
+ try {
+ precompilation = Util.readFileAsObject(precompilationFile,
+ Precompilation.class);
+ } catch (ClassNotFoundException e) {
+ logger.log(TreeLogger.ERROR, "Unable to deserialize '"
+ + precompilationFile.getAbsolutePath() + "'", e);
return false;
}
- resultFiles.add(new FileBackedObject<PermutationResult>(
- PermutationResult.class, permFile));
+ Permutation[] perms = precompilation.getPermutations();
+
+ List<FileBackedObject<PermutationResult>> resultFiles = new ArrayList<FileBackedObject<PermutationResult>>(
+ perms.length);
+ for (int i = 0; i < perms.length; ++i) {
+ File f = CompilePerms.makePermFilename(compilerWorkDir, perms[i].getId());
+ if (!f.exists()) {
+ logger.log(TreeLogger.ERROR, "File not found '"
+ + precompilationFile.getAbsolutePath()
+ + "'; please compile all permutations");
+ return false;
+ }
+ resultFiles.add(new FileBackedObject<PermutationResult>(
+ PermutationResult.class, f));
+ }
+
+ TreeLogger branch = logger.branch(TreeLogger.INFO, "Linking module "
+ + module.getName());
+ StandardLinkerContext linkerContext = new StandardLinkerContext(branch,
+ module, precompilation.getUnifiedAst().getOptions());
+ ArtifactSet artifacts = doLink(branch, linkerContext, precompilation,
+ resultFiles);
+
+ doProduceOutput(branch, artifacts, linkerContext, module,
+ options.getWarDir(), options.getExtraDir());
}
-
- TreeLogger branch = logger.branch(TreeLogger.INFO, "Linking module "
- + module.getName());
- StandardLinkerContext linkerContext = new StandardLinkerContext(branch,
- module, precompilation.getUnifiedAst().getOptions());
- ArtifactSet artifacts = doLink(branch, linkerContext, precompilation,
- resultFiles);
-
- doProduceOutput(branch, artifacts, linkerContext, module,
- options.getOutDir(), options.getExtraDir());
return true;
}
}
diff --git a/dev/core/src/com/google/gwt/dev/Permutation.java b/dev/core/src/com/google/gwt/dev/Permutation.java
index 3eba3f2..28bacf7 100644
--- a/dev/core/src/com/google/gwt/dev/Permutation.java
+++ b/dev/core/src/com/google/gwt/dev/Permutation.java
@@ -32,6 +32,18 @@
private final List<StaticPropertyOracle> propertyOracles = new ArrayList<StaticPropertyOracle>();
private final SortedMap<String, String> rebindAnswers = new TreeMap<String, String>();
+ /**
+ * Clones an existing permutation, but with a new id.
+ *
+ * @param id new permutation id
+ * @param other Permutation to copy
+ */
+ public Permutation(int id, Permutation other) {
+ this.id = id;
+ this.propertyOracles.addAll(other.propertyOracles);
+ this.rebindAnswers.putAll(other.rebindAnswers);
+ }
+
public Permutation(int id, StaticPropertyOracle propertyOracle) {
this.id = id;
this.propertyOracles.add(propertyOracle);
diff --git a/dev/core/src/com/google/gwt/dev/Precompilation.java b/dev/core/src/com/google/gwt/dev/Precompilation.java
index 8eb7438..4c0fa32 100644
--- a/dev/core/src/com/google/gwt/dev/Precompilation.java
+++ b/dev/core/src/com/google/gwt/dev/Precompilation.java
@@ -19,6 +19,7 @@
import com.google.gwt.dev.jjs.UnifiedAst;
import java.io.Serializable;
+import java.util.Collection;
/**
* The result of compilation phase 1, includes a unified AST and metadata
@@ -35,17 +36,24 @@
private final UnifiedAst unifiedAst;
/**
- * Constructs a new precompilation.
+ * Constructs a new precompilation. We create new Permutations with
+ * a new id so that the ids are consecutive and correspond to the index
+ * in the array.
*
* @param unifiedAst the unified AST used by
* {@link com.google.gwt.dev.jjs.JavaToJavaScriptCompiler}
* @param permutations the set of permutations that can be run
* @param generatedArtifacts the set of artifacts created by generators
*/
- public Precompilation(UnifiedAst unifiedAst, Permutation[] permutations,
- ArtifactSet generatedArtifacts) {
+ public Precompilation(UnifiedAst unifiedAst,
+ Collection<Permutation> permutations, ArtifactSet generatedArtifacts) {
this.unifiedAst = unifiedAst;
- this.permutations = permutations;
+ this.permutations = new Permutation[permutations.size()];
+ int i = 0;
+ for (Permutation permutation : permutations) {
+ this.permutations[i] = new Permutation(i, permutation);
+ ++i;
+ }
this.generatedArtifacts = generatedArtifacts;
}
diff --git a/dev/core/src/com/google/gwt/dev/Precompile.java b/dev/core/src/com/google/gwt/dev/Precompile.java
index 0e55c39..cb95d6c 100644
--- a/dev/core/src/com/google/gwt/dev/Precompile.java
+++ b/dev/core/src/com/google/gwt/dev/Precompile.java
@@ -311,8 +311,8 @@
merged.put(rebindResultsString, permutation);
}
}
- permutations = merged.values().toArray(new Permutation[merged.size()]);
- return new Precompilation(unifiedAst, permutations, generatedArtifacts);
+ return new Precompilation(unifiedAst, merged.values(),
+ generatedArtifacts);
} catch (UnableToCompleteException e) {
// We intentionally don't pass in the exception here since the real
// cause has been logged.
@@ -374,50 +374,44 @@
}
public boolean run(TreeLogger logger) throws UnableToCompleteException {
- if (options.isValidateOnly()) {
- init(logger);
- TreeLogger branch = logger.branch(TreeLogger.INFO,
- "Validating compilation " + module.getName());
- if (validate(branch, options, module, options.getGenDir(),
- options.getCompilerWorkDir())) {
+ for (String moduleName : options.getModuleNames()) {
+ File compilerWorkDir = options.getCompilerWorkDir(moduleName);
+ Util.recursiveDelete(compilerWorkDir, true);
+ compilerWorkDir.mkdirs();
+
+ this.module = ModuleDefLoader.loadFromClassPath(logger, moduleName);
+
+ // TODO: All JDT checks now before even building TypeOracle?
+ module.getCompilationState(logger);
+
+ if (options.isValidateOnly()) {
+ TreeLogger branch = logger.branch(TreeLogger.INFO,
+ "Validating compilation " + module.getName());
+ if (!validate(branch, options, module, options.getGenDir(),
+ compilerWorkDir)) {
+ branch.log(TreeLogger.ERROR, "Validation failed");
+ return false;
+ }
branch.log(TreeLogger.INFO, "Validation succeeded");
- return true;
} else {
- branch.log(TreeLogger.ERROR, "Validation failed");
- return false;
- }
- } else {
- init(logger);
- TreeLogger branch = logger.branch(TreeLogger.INFO, "Precompiling module "
- + module.getName());
- Precompilation precompilation = precompile(branch, options, module,
- options.getGenDir(), options.getCompilerWorkDir());
- if (precompilation != null) {
- Util.writeObjectAsFile(branch, new File(options.getCompilerWorkDir(),
+ TreeLogger branch = logger.branch(TreeLogger.INFO,
+ "Precompiling module " + module.getName());
+ Precompilation precompilation = precompile(branch, options, module,
+ options.getGenDir(), compilerWorkDir);
+ if (precompilation == null) {
+ branch.log(TreeLogger.ERROR, "Precompilation failed");
+ return false;
+ }
+ Util.writeObjectAsFile(branch, new File(compilerWorkDir,
PRECOMPILATION_FILENAME), precompilation);
- Util.writeStringAsFile(branch, new File(options.getCompilerWorkDir(),
+ Util.writeStringAsFile(branch, new File(compilerWorkDir,
PERM_COUNT_FILENAME),
String.valueOf(precompilation.getPermutations().length));
branch.log(TreeLogger.INFO,
"Precompilation succeeded, number of permutations: "
+ precompilation.getPermutations().length);
- return true;
}
- branch.log(TreeLogger.ERROR, "Precompilation failed");
- return false;
}
- }
-
- private void init(TreeLogger logger) throws UnableToCompleteException {
- // Clean out the work dir and/or create it.
- File compilerWorkDir = options.getCompilerWorkDir();
- Util.recursiveDelete(compilerWorkDir, true);
- compilerWorkDir.mkdirs();
-
- this.module = ModuleDefLoader.loadFromClassPath(logger,
- options.getModuleName());
-
- // TODO: All JDT checks now before even building TypeOracle?
- module.getCompilationState(logger);
+ return true;
}
}
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java b/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
index cbc3e39..6ab4a8f 100644
--- a/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
+++ b/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
@@ -42,7 +42,6 @@
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -85,8 +84,6 @@
private Class<? extends Linker> activePrimaryLinker;
- private String deployTo;
-
private final List<String> entryPointTypeNames = new ArrayList<String>();
private final Set<File> gwtXmlFiles = new HashSet<File>();
@@ -269,17 +266,6 @@
return lazyCompilationState;
}
- /**
- * Returns the desired deployment path within the output directory. The
- * returned value will start and end with a <code>'/'</code> character.
- */
- public String getDeployTo() {
- String result = (deployTo == null) ? ('/' + getName() + '/') : deployTo;
- assert result.startsWith("/");
- assert result.endsWith("/");
- return result;
- }
-
public synchronized String[] getEntryPointTypeNames() {
final int n = entryPointTypeNames.size();
return entryPointTypeNames.toArray(new String[n]);
@@ -364,14 +350,17 @@
}
public boolean isGwtXmlFileStale() {
- for (Iterator<File> iter = gwtXmlFiles.iterator(); iter.hasNext();) {
- File xmlFile = iter.next();
- if ((!xmlFile.exists())
- || (xmlFile.lastModified() > moduleDefCreationTime)) {
- return true;
+ return lastModified() > moduleDefCreationTime;
+ }
+
+ public long lastModified() {
+ long lastModified = 0;
+ for (File xmlFile : gwtXmlFiles) {
+ if (xmlFile.exists()) {
+ lastModified = Math.max(lastModified, xmlFile.lastModified());
}
}
- return false;
+ return lastModified > 0 ? lastModified : moduleDefCreationTime;
}
/**
@@ -407,26 +396,6 @@
}
/**
- * Set the deployment path for this module. Setting this value to
- * <code>null</code> or the empty string will default to the fully-qualified
- * module name.
- */
- public void setDeployTo(String deployTo) {
- if (deployTo != null && deployTo.length() == 0) {
- deployTo = null;
- } else {
- assert deployTo.startsWith("/");
- // Ensure ends with trailing slash.
- if (!deployTo.endsWith("/")) {
- deployTo += '/';
- }
- assert deployTo.endsWith("/");
- }
-
- this.deployTo = deployTo;
- }
-
- /**
* Override the module's apparent name. Setting this value to
* <code>null<code> will disable the name override.
*/
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
index 5f1287b..ebde69d 100644
--- a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
+++ b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
@@ -921,7 +921,6 @@
}
protected final String __module_1_rename_to = "";
- protected final String __module_2_deploy_to = "";
private final PropertyAttrCvt bindingPropAttrCvt = new PropertyAttrCvt(
BindingProperty.class);
@@ -968,21 +967,11 @@
registerAttributeConverter(Class.class, classAttrCvt);
}
- protected Schema __module_begin(NullableName renameTo, String deployTo)
- throws UnableToCompleteException {
-
- if (deployTo != null && deployTo.length() > 0) {
- // Only absolute paths, although it is okay to have multiple slashes.
- if (!deployTo.startsWith("/")) {
- logger.log(TreeLogger.ERROR, "deploy-to '" + deployTo
- + "' must begin with forward slash (e.g. '/foo')");
- throw new UnableToCompleteException();
- }
- }
+ protected Schema __module_begin(NullableName renameTo) {
return bodySchema;
}
- protected void __module_end(NullableName renameTo, String deployTo) {
+ protected void __module_end(NullableName renameTo) {
// Maybe infer source and public.
//
if (!foundExplicitSourceOrSuperSource) {
@@ -997,7 +986,6 @@
// We do this in __module_end so this value is never inherited
moduleDef.setNameOverride(renameTo.token);
- moduleDef.setDeployTo(deployTo);
}
/**
diff --git a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
index 8ca9fd8..6bb5875 100644
--- a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
@@ -103,7 +103,9 @@
CompilationUnitAdapter adapter = (CompilationUnitAdapter) icu;
CompilationUnit unit = adapter.getUnit();
unit.setJdtCud(cud);
- recordBinaryTypes(unit.getCompiledClasses());
+ if (!cud.compilationResult().hasErrors()) {
+ recordBinaryTypes(unit.getCompiledClasses());
+ }
}
}
diff --git a/dev/core/src/com/google/gwt/dev/javac/LongFromJSNIChecker.java b/dev/core/src/com/google/gwt/dev/javac/LongFromJSNIChecker.java
index fa49fd6..7e699ab 100644
--- a/dev/core/src/com/google/gwt/dev/javac/LongFromJSNIChecker.java
+++ b/dev/core/src/com/google/gwt/dev/javac/LongFromJSNIChecker.java
@@ -189,10 +189,11 @@
if (binding instanceof ProblemReferenceBinding) {
ProblemReferenceBinding prb = (ProblemReferenceBinding) binding;
- if (prb.problemId() == ProblemReasons.NotVisible) {
+ if (prb.problemId() == ProblemReasons.NotVisible
+ && prb.closestMatch() instanceof ReferenceBinding) {
// It's just a visibility problem, so try drilling
// down manually
- ReferenceBinding drilling = prb.closestMatch();
+ ReferenceBinding drilling = (ReferenceBinding) prb.closestMatch();
for (int i = prb.compoundName.length; i < compoundName.length; i++) {
drilling = drilling.getMemberType(compoundName[i]);
}
diff --git a/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java b/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java
index 7d4b788..8ac02f1 100644
--- a/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java
+++ b/dev/core/src/com/google/gwt/dev/shell/BrowserWidget.java
@@ -93,7 +93,18 @@
openWebModeButton = newItem("new-web-mode-window.gif", "&Compile/Browse",
"Compiles and opens the current URL in the system browser");
openWebModeButton.addSelectionListener(this);
- openWebModeButton.setEnabled(false);
+ updateWebMode();
+ }
+
+ @Deprecated
+ public void updateWebMode() {
+ if (!openWebModeButton.isDisposed()) {
+ if (getHost().isLegacyMode()) {
+ openWebModeButton.setEnabled(!loadedModules.isEmpty());
+ } else {
+ openWebModeButton.setEnabled(true);
+ }
+ }
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -114,22 +125,26 @@
browser.stop();
} else if (evt.widget == openWebModeButton) {
// first, compile
- Set<String> keySet = new HashSet<String>();
- for (Map.Entry<?, ModuleSpace> entry : loadedModules.entrySet()) {
- ModuleSpace module = entry.getValue();
- keySet.add(module.getModuleName());
- }
- String[] moduleNames = Util.toStringArray(keySet);
- if (moduleNames.length == 0) {
- // A latent problem with a module.
- //
- openWebModeButton.setEnabled(false);
- return;
- }
try {
Cursor waitCursor = getDisplay().getSystemCursor(SWT.CURSOR_WAIT);
getShell().setCursor(waitCursor);
- getHost().compile(moduleNames);
+ if (getHost().isLegacyMode()) {
+ Set<String> keySet = new HashSet<String>();
+ for (Map.Entry<?, ModuleSpace> entry : loadedModules.entrySet()) {
+ ModuleSpace module = entry.getValue();
+ keySet.add(module.getModuleName());
+ }
+ String[] moduleNames = Util.toStringArray(keySet);
+ if (moduleNames.length == 0) {
+ // A latent problem with a module.
+ //
+ openWebModeButton.setEnabled(false);
+ return;
+ }
+ getHost().compile(moduleNames);
+ } else {
+ getHost().compile();
+ }
} catch (UnableToCompleteException e) {
// Already logged by callee.
//
@@ -154,9 +169,10 @@
}
/**
- * The version number that should be passed into gwtOnLoad.
+ * The version number that should be passed into gwtOnLoad. Must match the
+ * version in hosted.html.
*/
- private static final String EXPECTED_GWT_ONLOAD_VERSION = "1.5";
+ private static final String EXPECTED_GWT_ONLOAD_VERSION = "1.6";
public static void launchExternalBrowser(TreeLogger logger, String location) {
// check GWT_EXTERNAL_BROWSER first, it overrides everything else
@@ -330,7 +346,7 @@
// Enable the compile button since we successfully loaded.
//
- toolbar.openWebModeButton.setEnabled(true);
+ toolbar.updateWebMode();
}
/**
@@ -356,27 +372,19 @@
loadedModules.remove(key);
}
}
- if (loadedModules.isEmpty()) {
- if (!toolbar.openWebModeButton.isDisposed()) {
- // Disable the compile button.
- //
- toolbar.openWebModeButton.setEnabled(false);
- }
- }
+ toolbar.updateWebMode();
}
/**
- * Report that gwtOnLoad was called with the wrong number of
+ * Report that an external method was called with the wrong number of
* arguments.
- *
- * @param numArgs number of arguments supplied
*/
- protected void reportIncorrectGwtOnLoadInvocation(int numArgs) {
+ protected void reportIncorrectInvocation(String name, int expectedArgs,
+ int actualArgs) {
getHost().getLogger().log(
TreeLogger.ERROR,
- "Not enough arguments ("
- + numArgs
- + ") passed to external.gwtOnLoad(), expected (3); "
+ "Not enough arguments (" + actualArgs + ") passed to external." + name
+ + "(), expected (" + expectedArgs + "); "
+ "your hosted mode bootstrap file may be out of date; "
+ "if you are using -noserver try recompiling and redeploying "
+ "your app");
@@ -398,8 +406,8 @@
/**
* Validate that the supplied hosted.html version matches.
*
- * This is to detect cases where users upgrade to a new version
- * but forget to update the generated hosted.html file.
+ * This is to detect cases where users upgrade to a new version but forget to
+ * update the generated hosted.html file.
*
* @param version version supplied by hosted.html file
* @return true if the version is valid, false otherwise
@@ -408,8 +416,7 @@
if (!EXPECTED_GWT_ONLOAD_VERSION.equals(version)) {
getHost().getLogger().log(
TreeLogger.ERROR,
- "Invalid version number \""
- + version
+ "Invalid version number \"" + version
+ "\" passed to external.gwtOnLoad(), expected \""
+ EXPECTED_GWT_ONLOAD_VERSION
+ "\"; your hosted mode bootstrap file may be out of date; "
diff --git a/dev/core/src/com/google/gwt/dev/shell/BrowserWidgetHost.java b/dev/core/src/com/google/gwt/dev/shell/BrowserWidgetHost.java
index 8c557e0..74c2175 100644
--- a/dev/core/src/com/google/gwt/dev/shell/BrowserWidgetHost.java
+++ b/dev/core/src/com/google/gwt/dev/shell/BrowserWidgetHost.java
@@ -17,16 +17,29 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.cfg.ModuleDef;
/**
* Interface that unifies access to the <code>BrowserWidget</code>,
* <code>ModuleSpaceHost</code>, and the compiler.
*/
public interface BrowserWidgetHost {
- void compile(String[] modules) throws UnableToCompleteException;
+ /**
+ * Perform a web-mode compile on the user-specified set of modules. Used in
+ * non-legacy mode.
+ *
+ * @throws UnableToCompleteException
+ */
+ void compile() throws UnableToCompleteException;
- void compile(ModuleDef module) throws UnableToCompleteException;
+ /**
+ * Compile the specified set of modules, used in legacy mode.
+ *
+ * @param modules the names of the modules to compile
+ * @throws UnableToCompleteException
+ * @deprecated will be removed when legacy shell mode is removed
+ */
+ @Deprecated
+ void compile(String[] modules) throws UnableToCompleteException;
// Factor this out if BrowserWidget becomes decoupled from hosted mode
ModuleSpaceHost createModuleSpaceHost(BrowserWidget widget, String moduleName)
@@ -34,6 +47,26 @@
TreeLogger getLogger();
+ /**
+ * Called from a selection script as it begins to load in hosted mode. This
+ * triggers a hosted mode link, which might actually update the running
+ * selection script.
+ *
+ * @param moduleName the module to link
+ * @return <code>true</code> if the selection script was overwritten; this
+ * will trigger a full-page refresh by the calling (out of date)
+ * selection script
+ */
+ boolean initModule(String moduleName);
+
+ /**
+ * Returns <code>true</code> if running in legacy mode.
+ *
+ * @deprecated will be removed when legacy shell mode is removed
+ */
+ @Deprecated
+ boolean isLegacyMode();
+
String normalizeURL(String whatTheUserTyped);
BrowserWidget openNewBrowserWindow() throws UnableToCompleteException;
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/dev/core/src/com/google/gwt/dev/shell/BrowserWindowController.java
similarity index 61%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to dev/core/src/com/google/gwt/dev/shell/BrowserWindowController.java
index 906258b..e2bb884 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/dev/core/src/com/google/gwt/dev/shell/BrowserWindowController.java
@@ -1,32 +1,31 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.event.shared;
-
-/**
- *
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
- */
-public interface HasHandlerManager {
- /**
- * Gets this widget's handler manager.
- *
- * @return the manager
- */
- HandlerManager getHandlerManager();
-}
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev.shell;
+
+import com.google.gwt.core.ext.UnableToCompleteException;
+
+/**
+ * Interface to the browser window controller.
+ */
+public interface BrowserWindowController {
+ void closeAllBrowserWindows();
+
+ boolean hasBrowserWindowsOpen();
+
+ String normalizeURL(String string);
+
+ BrowserWidget openNewBrowserWindow() throws UnableToCompleteException;
+}
\ No newline at end of file
diff --git a/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java b/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
index 2a85fd9..595cf10 100644
--- a/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
+++ b/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
@@ -352,13 +352,15 @@
private static final String CLASS_DUMP_PATH = "rewritten-classes";
+ private static boolean emmaIsAvailable = false;
+
+ private static EmmaStrategy emmaStrategy;
+
/**
* Caches the byte code for {@link JavaScriptHost}.
*/
private static byte[] javaScriptHostBytes;
- private static EmmaStrategy emmaStrategy;
-
static {
for (Class<?> c : BRIDGE_CLASSES) {
BRIDGE_CLASS_NAMES.put(c.getName(), c);
@@ -366,8 +368,10 @@
/*
* Specific support for bridging to Emma since the user classloader is
* generally completely isolated.
+ *
+ * We are looking for a specific emma class "com.vladium.emma.rt.RT". If
+ * that changes in the future, this code would need to be updated as well.
*/
- boolean emmaIsAvailable = false;
try {
Class<?> emmaBridge = Class.forName(EmmaStrategy.EMMA_RT_CLASSNAME,
false, Thread.currentThread().getContextClassLoader());
@@ -713,27 +717,52 @@
CompiledClass compiledClass = compilationState.getClassFileMap().get(
lookupClassName);
+
+ byte classBytes[] = null;
if (compiledClass != null) {
- byte[] classBytes = compiledClass.getBytes();
+
+ injectJsniFor(compiledClass);
+ classBytes = compiledClass.getBytes();
if (!compiledClass.getUnit().isSuperSource()) {
+ /*
+ * It is okay if Emma throws away the old classBytes since the actual
+ * jsni injection happens in the rewriter. The injectJsniFor method
+ * above simply defines the native methods in the browser.
+ */
classBytes = emmaStrategy.getEmmaClassBytes(classBytes,
lookupClassName, compiledClass.getUnit().getLastModified());
} else {
logger.log(TreeLogger.SPAM, "no emma instrumentation for "
+ lookupClassName + " because it is from super-source");
}
- if (classRewriter != null) {
- byte[] newBytes = classRewriter.rewrite(className, classBytes);
- if (CLASS_DUMP) {
- if (!Arrays.equals(classBytes, newBytes)) {
- classDump(className, newBytes);
- }
- }
- classBytes = newBytes;
+ } else if (emmaIsAvailable) {
+ /*
+ * TypeOracle does not know about this class. Most probably, this class
+ * was referenced in one of the classes loaded from disk. Check if we can
+ * find it on disk. Typically this is a synthetic class added by the
+ * compiler. If the synthetic class contains native methods, it will fail
+ * later.
+ */
+ if (isSynthetic(className)) {
+ /*
+ * modification time = 0 ensures that whatever is on the disk is always
+ * loaded.
+ */
+ logger.log(TreeLogger.SPAM, "EmmaStrategy: loading " + lookupClassName
+ + " from disk even though TypeOracle does not know about it");
+ classBytes = emmaStrategy.getEmmaClassBytes(null, lookupClassName, 0);
}
- return classBytes;
}
- return null;
+ if (classBytes != null && classRewriter != null) {
+ byte[] newBytes = classRewriter.rewrite(className, classBytes);
+ if (CLASS_DUMP) {
+ if (!Arrays.equals(classBytes, newBytes)) {
+ classDump(className, newBytes);
+ }
+ }
+ classBytes = newBytes;
+ }
+ return classBytes;
}
private String getBinaryName(JClassType type) {
@@ -764,6 +793,30 @@
}
/**
+ * For safety, we only allow synthetic classes to be loaded this way. Accepts
+ * any classes whose names match .+$\d+
+ * <p>
+ * If new compilers have different conventions for synthetic classes, this
+ * code needs to be updated.
+ * </p>
+ *
+ * @param className class to be loaded from disk.
+ * @return true iff class should be loaded from disk
+ */
+ private boolean isSynthetic(String className) {
+ int index = className.lastIndexOf("$");
+ if (index <= 0 || index == className.length() - 1) {
+ return false;
+ }
+ for (int i = index + 1; i < className.length(); i++) {
+ if (!Character.isDigit(className.charAt(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Tricky one, this. Reaches over into this modules's JavaScriptHost class and
* sets its static 'host' field to our module space.
*
diff --git a/dev/core/src/com/google/gwt/dev/shell/DialogBase.java b/dev/core/src/com/google/gwt/dev/shell/DialogBase.java
index 8642486..358abdc 100644
--- a/dev/core/src/com/google/gwt/dev/shell/DialogBase.java
+++ b/dev/core/src/com/google/gwt/dev/shell/DialogBase.java
@@ -15,8 +15,6 @@
*/
package com.google.gwt.dev.shell;
-import com.google.gwt.dev.GWTShell;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -136,7 +134,7 @@
Shell parent = getParent();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL
| SWT.RESIZE);
- shell.setImages(GWTShell.getIcons());
+ shell.setImages(ShellMainWindow.getIcons());
shell.setText(getText());
shell.setLayout(new FillLayout());
diff --git a/dev/core/src/com/google/gwt/dev/shell/GWTShellServletFilter.java b/dev/core/src/com/google/gwt/dev/shell/GWTShellServletFilter.java
deleted file mode 100644
index 4b5c6a6..0000000
--- a/dev/core/src/com/google/gwt/dev/shell/GWTShellServletFilter.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.dev.shell;
-
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.linker.ArtifactSet;
-import com.google.gwt.core.ext.linker.impl.StandardLinkerContext;
-import com.google.gwt.dev.ShellOptions;
-import com.google.gwt.dev.cfg.ModuleDef;
-
-import org.apache.commons.collections.map.AbstractReferenceMap;
-import org.apache.commons.collections.map.ReferenceIdentityMap;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Built-in servlet for convenient access to the public path of a specified
- * module.
- */
-public class GWTShellServletFilter implements Filter {
-
- private final Map<String, ModuleDef> autogenScripts = new HashMap<String, ModuleDef>();
- /**
- * Maintains a persistent map of linker contexts for each module, for
- * incremental re-link with new generated artifacts.
- */
- @SuppressWarnings("unchecked")
- private final Map<ModuleDef, StandardLinkerContext> linkerContextsByModule = new ReferenceIdentityMap(
- AbstractReferenceMap.WEAK, AbstractReferenceMap.HARD, true);
-
- private TreeLogger logger;
-
- private final ShellOptions options;
-
- public GWTShellServletFilter(TreeLogger logger, ShellOptions options,
- ModuleDef[] moduleDefs) {
- this.logger = logger;
- this.options = options;
- for (ModuleDef moduleDef : moduleDefs) {
- String scriptName = moduleDef.getDeployTo() + moduleDef.getName()
- + ".nocache.js";
- autogenScripts.put(scriptName, moduleDef);
- }
- }
-
- public void destroy() {
- }
-
- public void doFilter(ServletRequest req, ServletResponse resp,
- FilterChain chain) throws IOException, ServletException {
-
- if (req instanceof HttpServletRequest) {
- HttpServletRequest request = (HttpServletRequest) req;
- String pathInfo = request.getRequestURI();
- logger.log(TreeLogger.TRACE, "Request for: " + pathInfo);
- ModuleDef moduleDef = autogenScripts.get(pathInfo);
- if (moduleDef != null) {
- /*
- * If the '?compiled' request property is specified, don't
- * auto-generate.
- *
- * TODO(scottb): does this even do anything anymore?
- *
- * TODO(scottb): how do we avoid clobbering a compiled selection script?
- */
- if (req.getParameter("compiled") == null) {
- try {
- // Run the linkers for hosted mode.
- hostedModeLink(logger.branch(TreeLogger.TRACE, "Request for '"
- + pathInfo + "' maps to script generator for module '"
- + moduleDef.getName() + "'"), moduleDef);
- } catch (UnableToCompleteException e) {
- /*
- * The error will have already been logged. Continue, since this
- * could actually be a request for a static file that happens to
- * have an unfortunately confusing name.
- */
- }
- }
- }
- }
-
- // Do normal handling, knowing that the linkers may have run earlier to
- // produce files we are just about to serve.
- chain.doFilter(req, resp);
- }
-
- public void init(FilterConfig filterConfig) throws ServletException {
- }
-
- /**
- * Called when new generated artifacts are produced.
- */
- public void relink(TreeLogger logger, ModuleDef moduleDef,
- ArtifactSet newArtifacts) throws UnableToCompleteException {
- StandardLinkerContext context = linkerContextsByModule.get(moduleDef);
- assert context != null;
-
- ArtifactSet artifacts = context.invokeRelink(logger, newArtifacts);
- dumpArtifacts(logger, moduleDef, context, artifacts);
- }
-
- private void dumpArtifacts(TreeLogger logger, ModuleDef moduleDef,
- StandardLinkerContext context, ArtifactSet artifacts)
- throws UnableToCompleteException {
- File outputPath = new File(options.getOutDir(), moduleDef.getDeployTo());
- File extraPath = null;
- if (options.getExtraDir() != null) {
- extraPath = new File(options.getExtraDir(), moduleDef.getDeployTo());
- }
- context.produceOutputDirectory(logger, artifacts, outputPath, extraPath);
- }
-
- private void hostedModeLink(TreeLogger logger, ModuleDef moduleDef)
- throws UnableToCompleteException {
- String moduleName = moduleDef.getName();
- logger.log(TreeLogger.TRACE, "Running linkers for module " + moduleName);
-
- // TODO: blow away artifacts from a previous link.
-
- // Perform the initial link.
- StandardLinkerContext context = new StandardLinkerContext(logger,
- moduleDef, options);
- ArtifactSet artifacts = context.invokeLink(logger);
- dumpArtifacts(logger, moduleDef, context, artifacts);
-
- // Save off a new active link state (which may overwrite an old one).
- linkerContextsByModule.put(moduleDef, context);
- }
-}
diff --git a/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java b/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
index 1e46069..031cc44 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
+++ b/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
@@ -17,7 +17,6 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.GWTShell;
import com.google.gwt.dev.util.Util;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.TreeLoggerWidget;
@@ -30,6 +29,7 @@
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -46,7 +46,6 @@
private class Toolbar extends HeaderBarBase {
private ToolItem about;
-
private ToolItem clearLog;
private ToolItem collapseAll;
private ToolItem expandAll;
@@ -60,9 +59,9 @@
newWindow.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- String startupUrl = serverWindow.normalizeURL("/");
+ String startupUrl = browserWindowController.normalizeURL("/");
try {
- BrowserWidget bw = serverWindow.openNewBrowserWindow();
+ BrowserWidget bw = browserWindowController.openNewBrowserWindow();
bw.go(startupUrl);
} catch (UnableToCompleteException e) {
getLogger().log(TreeLogger.ERROR,
@@ -137,6 +136,23 @@
}
}
+ private static Image[] icons;
+
+ /**
+ * Well-known place to get the GWT icons.
+ */
+ public static Image[] getIcons() {
+ // Make sure icon images are loaded.
+ //
+ if (icons == null) {
+ icons = new Image[] {
+ LowLevel.loadImage("icon16.png"), LowLevel.loadImage("icon24.png"),
+ LowLevel.loadImage("icon32.png"), LowLevel.loadImage("icon48.png"),
+ LowLevel.loadImage("icon128.png")};
+ }
+ return icons;
+ }
+
private static String verify(String hash) {
char[] in = hash.toCharArray();
char[] ou = new char[in.length];
@@ -156,19 +172,19 @@
return String.valueOf(ou);
}
+ private BrowserWindowController browserWindowController;
+
private Color colorWhite;
private TreeLoggerWidget logPane;
- private GWTShell serverWindow;
-
private Toolbar toolbar;
- public ShellMainWindow(GWTShell serverWindow, final Shell parent,
- int serverPort, boolean checkForUpdates) {
+ public ShellMainWindow(BrowserWindowController browserWindowController,
+ final Shell parent, int serverPort, boolean checkForUpdates) {
super(parent, SWT.NONE);
- this.serverWindow = serverWindow;
+ this.browserWindowController = browserWindowController;
colorWhite = new Color(null, 255, 255, 255);
@@ -256,7 +272,7 @@
}
public void shellClosed(ShellEvent e) {
- if (serverWindow.hasBrowserWindowsOpen()) {
+ if (browserWindowController.hasBrowserWindowsOpen()) {
boolean closeWindows = true;
if (System.getProperty("gwt.shell.endquick") == null) {
closeWindows = DialogBase.confirmAction((Shell) e.widget,
@@ -265,7 +281,7 @@
}
if (closeWindows) {
- serverWindow.closeAllBrowserWindows();
+ browserWindowController.closeAllBrowserWindows();
e.doit = true;
} else {
e.doit = false;
diff --git a/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java b/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java
index 6433045..6ace93c 100644
--- a/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java
+++ b/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java
@@ -37,7 +37,6 @@
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.IdentityHashMap;
@@ -253,26 +252,20 @@
pendingResource.commit(logger);
// Add the GeneratedResource to the ArtifactSet
- GeneratedResource toReturn;
- try {
- toReturn = new StandardGeneratedResource(currentGenerator,
- pendingResource.getPartialPath(), pendingResource.getFile().toURL());
- commitArtifact(logger, toReturn);
+ GeneratedResource toReturn = new StandardGeneratedResource(
+ currentGenerator, pendingResource.getPartialPath(),
+ pendingResource.getFile());
+ commitArtifact(logger, toReturn);
- /*
- * The resource is now no longer pending, so remove it from the map. If
- * the commit above throws an exception, it's okay to leave the entry in
- * the map because it will be reported later as not having been
- * committed, which is accurate.
- */
- pendingResourcesByOutputStream.remove(os);
+ /*
+ * The resource is now no longer pending, so remove it from the map. If
+ * the commit above throws an exception, it's okay to leave the entry in
+ * the map because it will be reported later as not having been committed,
+ * which is accurate.
+ */
+ pendingResourcesByOutputStream.remove(os);
- return toReturn;
- } catch (MalformedURLException e) {
- // This is very unlikely, since the file already exists
- logger.log(TreeLogger.ERROR, "Unable to commit artifact", e);
- throw new UnableToCompleteException();
- }
+ return toReturn;
} else {
logger.log(TreeLogger.WARN,
"Generator attempted to commit an unknown OutputStream", null);
diff --git a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java b/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
index 832311d..58ed521 100644
--- a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
+++ b/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
@@ -15,28 +15,24 @@
*/
package com.google.gwt.dev.shell.jetty;
+import com.google.gwt.core.ext.ServletContainer;
+import com.google.gwt.core.ext.ServletContainerLauncher;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.dev.shell.ServletContainer;
-import com.google.gwt.dev.shell.ServletContainerLauncher;
-import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.servlet.FilterHolder;
import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.log.Log;
import org.mortbay.log.Logger;
import java.io.File;
-import javax.servlet.Filter;
-
/**
* A launcher for an embedded Jetty server.
*/
-public class JettyLauncher implements ServletContainerLauncher {
+public class JettyLauncher extends ServletContainerLauncher {
/**
* An adapter for the Jetty logging system to GWT's TreeLogger. This
@@ -136,16 +132,18 @@
}
}
- private static class JettyServletContainer implements ServletContainer {
+ private static class JettyServletContainer extends ServletContainer {
private final int actualPort;
private final File appRootDir;
private final TreeLogger logger;
private final WebAppContext wac;
+ private final Server server;
- public JettyServletContainer(TreeLogger logger, WebAppContext wac,
- int actualPort, File appRootDir) {
+ public JettyServletContainer(TreeLogger logger, Server server,
+ WebAppContext wac, int actualPort, File appRootDir) {
this.logger = logger;
+ this.server = server;
this.wac = wac;
this.actualPort = actualPort;
this.appRootDir = appRootDir;
@@ -180,7 +178,8 @@
TreeLogger branch = logger.branch(TreeLogger.INFO,
"Stopping Jetty server");
try {
- wac.stop();
+ server.stop();
+ server.setStopAtShutdown(false);
} catch (Exception e) {
branch.log(TreeLogger.ERROR, "Unable to stop embedded Jetty server", e);
throw new UnableToCompleteException();
@@ -190,50 +189,50 @@
}
@SuppressWarnings("unchecked")
- public ServletContainer start(TreeLogger logger, int port, File appRootDir,
- Filter shellServletFilter) throws Exception {
+ public ServletContainer start(TreeLogger logger, int port, File appRootDir)
+ throws Exception {
checkStartParams(logger, port, appRootDir);
- // The dance we do with Jetty's logging system.
- System.setProperty("VERBOSE", "true");
- JettyTreeLogger.setDefaultConstruction(logger, TreeLogger.INFO);
- System.setProperty("org.mortbay.log.class", JettyTreeLogger.class.getName());
- // Force initialization.
- Log.isDebugEnabled();
- if (JettyTreeLogger.isDefaultConstructionReady()) {
- // The log system was already initialized and did not use our
- // newly-constructed logger, set it explicitly now.
- Log.setLog(new JettyTreeLogger());
+ // The dance we do with Jetty's logging system -- disabled, log to console.
+ if (false) {
+ System.setProperty("VERBOSE", "true");
+ JettyTreeLogger.setDefaultConstruction(logger, TreeLogger.INFO);
+ System.setProperty("org.mortbay.log.class",
+ JettyTreeLogger.class.getName());
+ // Force initialization.
+ Log.isDebugEnabled();
+ if (JettyTreeLogger.isDefaultConstructionReady()) {
+ // The log system was already initialized and did not use our
+ // newly-constructed logger, set it explicitly now.
+ Log.setLog(new JettyTreeLogger());
+ }
}
- Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
- connector.setHost("127.0.0.1");
- // Don't steal ports from an existing proc.
+
+ // Don't share ports with an existing process.
connector.setReuseAddress(false);
+ // Linux keeps the port blocked after shutdown if we don't disable this.
+ connector.setSoLingerTime(0);
+
+ Server server = new Server();
server.addConnector(connector);
// Create a new web app in the war directory.
WebAppContext wac = new WebAppContext(appRootDir.getAbsolutePath(), "/");
- // Prevent file locking on windows; pick up file changes.
+ // Prevent file locking on Windows; pick up file changes.
wac.getInitParams().put(
"org.mortbay.jetty.servlet.Default.useFileMappedBuffer", "false");
- // Setup the shell servlet filter to generate nocache.js files (and run
- // the hosted mode linker stack.
- FilterHolder filterHolder = new FilterHolder();
- filterHolder.setFilter(shellServletFilter);
- wac.addFilter(filterHolder, "/*", Handler.ALL);
-
server.setHandler(wac);
- server.setStopAtShutdown(true);
server.start();
+ server.setStopAtShutdown(true);
- return new JettyServletContainer(logger, wac, connector.getLocalPort(),
- appRootDir);
+ return new JettyServletContainer(logger, server, wac,
+ connector.getLocalPort(), appRootDir);
}
private void checkStartParams(TreeLogger logger, int port, File appRootDir) {
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerLogLevel.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerLogLevel.java
index f2bf710..a87e8ca 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerLogLevel.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerLogLevel.java
@@ -21,7 +21,7 @@
/**
* Argument handler for processing the log level flag.
*/
-public final class ArgHandlerLogLevel extends ArgHandler {
+public class ArgHandlerLogLevel extends ArgHandler {
private static final String OPTIONS_STRING = computeOptionsString();
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerModuleName.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerModuleName.java
index 3dab092..4b010ed 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerModuleName.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerModuleName.java
@@ -30,7 +30,7 @@
@Override
public boolean addExtraArg(String arg) {
- option.setModuleName(arg);
+ option.addModuleName(arg);
return true;
}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java
index bf5a5b1..a318409 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java
@@ -31,7 +31,7 @@
}
public String[] getDefaultArgs() {
- return new String[] {"-out", System.getProperty("user.dir")};
+ return new String[] {getTag(), System.getProperty("user.dir")};
}
public String getPurpose() {
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerScriptStyle.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerScriptStyle.java
index 3c9b5c0..f98f0c8 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerScriptStyle.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerScriptStyle.java
@@ -30,7 +30,7 @@
}
public String[] getDefaultArgs() {
- return new String[] {"-style", "obfuscate"};
+ return new String[] {getTag(), "obfuscate"};
}
public String getPurpose() {
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWarDir.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWarDir.java
new file mode 100644
index 0000000..2cbd7cb
--- /dev/null
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWarDir.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2006 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev.util.arg;
+
+import com.google.gwt.util.tools.ArgHandlerDir;
+
+import java.io.File;
+
+/**
+ * Argument handler for processing the output directory flag.
+ */
+public final class ArgHandlerWarDir extends ArgHandlerDir {
+
+ private final OptionWarDir option;
+
+ public ArgHandlerWarDir(OptionWarDir option) {
+ this.option = option;
+ }
+
+ public String[] getDefaultArgs() {
+ return new String[] {getTag(), "war"};
+ }
+
+ public String getPurpose() {
+ return "The war directory to write output files into (defaults to war)";
+ }
+
+ public String getTag() {
+ return "-war";
+ }
+
+ @Override
+ public void setDir(File dir) {
+ option.setWarDir(dir);
+ }
+
+}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java
index fc923fd..80c8f32 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java
@@ -22,7 +22,7 @@
/**
* Argument handler for processing an optional working directory.
*/
-public final class ArgHandlerWorkDirOptional extends ArgHandlerDir {
+public class ArgHandlerWorkDirOptional extends ArgHandlerDir {
private final OptionWorkDir option;
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java
index 6413f35..0f86683 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java
@@ -15,37 +15,21 @@
*/
package com.google.gwt.dev.util.arg;
-import com.google.gwt.util.tools.ArgHandlerDir;
-
-import java.io.File;
-
/**
* Argument handler for processing a required work directory.
*/
-public final class ArgHandlerWorkDirRequired extends ArgHandlerDir {
-
- private final OptionWorkDir option;
+public class ArgHandlerWorkDirRequired extends ArgHandlerWorkDirOptional {
public ArgHandlerWorkDirRequired(OptionWorkDir option) {
- this.option = option;
+ super(option);
}
public String getPurpose() {
return "The compiler work directory (must be writeable)";
}
- public String getTag() {
- return "-workDir";
- }
-
@Override
public boolean isRequired() {
return true;
}
-
- @Override
- public void setDir(File dir) {
- option.setWorkDir(dir);
- }
-
}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/OptionExtraDir.java b/dev/core/src/com/google/gwt/dev/util/arg/OptionExtraDir.java
index 586f41f..b2ecc22 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/OptionExtraDir.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/OptionExtraDir.java
@@ -30,5 +30,5 @@
/**
* Sets the extra resource directory.
*/
- void setExtraDir(File dir);
+ void setExtraDir(File extraDir);
}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/OptionModuleName.java b/dev/core/src/com/google/gwt/dev/util/arg/OptionModuleName.java
index 688406e..749b563 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/OptionModuleName.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/OptionModuleName.java
@@ -15,18 +15,25 @@
*/
package com.google.gwt.dev.util.arg;
+import java.util.List;
+
/**
* Option to set the module name.
*/
public interface OptionModuleName {
/**
- * Returns the name of the module.
+ * Returns the list of module names.
*/
- String getModuleName();
+ List<String> getModuleNames();
/**
* Sets the name of the module.
*/
- void setModuleName(String moduleName);
+ void addModuleName(String moduleName);
+
+ /**
+ * Sets the list of module names.
+ */
+ void setModuleNames(List<String> moduleNames);
}
diff --git a/dev/core/src/com/google/gwt/dev/util/arg/OptionOutDir.java b/dev/core/src/com/google/gwt/dev/util/arg/OptionOutDir.java
index 25b2b12..c9f714f 100644
--- a/dev/core/src/com/google/gwt/dev/util/arg/OptionOutDir.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/OptionOutDir.java
@@ -30,5 +30,5 @@
/**
* Sets the output directory.
*/
- void setOutDir(File dir);
+ void setOutDir(File outDir);
}
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/dev/core/src/com/google/gwt/dev/util/arg/OptionWarDir.java
similarity index 66%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to dev/core/src/com/google/gwt/dev/util/arg/OptionWarDir.java
index 906258b..0839e95 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/dev/core/src/com/google/gwt/dev/util/arg/OptionWarDir.java
@@ -1,32 +1,34 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.event.shared;
-
-/**
- *
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
- */
-public interface HasHandlerManager {
- /**
- * Gets this widget's handler manager.
- *
- * @return the manager
- */
- HandlerManager getHandlerManager();
-}
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.dev.util.arg;
+
+import java.io.File;
+
+/**
+ * Option to set the output directory.
+ */
+public interface OptionWarDir {
+
+ /**
+ * Returns the output directory.
+ */
+ File getWarDir();
+
+ /**
+ * Sets the output directory.
+ */
+ void setWarDir(File dir);
+}
diff --git a/dev/core/src/com/google/gwt/dev/util/xml/ReflectiveParser.java b/dev/core/src/com/google/gwt/dev/util/xml/ReflectiveParser.java
index 1b53760..81a6ffa 100644
--- a/dev/core/src/com/google/gwt/dev/util/xml/ReflectiveParser.java
+++ b/dev/core/src/com/google/gwt/dev/util/xml/ReflectiveParser.java
@@ -51,9 +51,9 @@
private Reader reader;
- private Stack schemaLevels = new Stack();
+ private Stack<Schema> schemaLevels = new Stack<Schema>();
- private Stack argStack = new Stack();
+ private Stack<Object[]> argStack = new Stack<Object[]>();
private Schema defaultSchema;
@@ -82,7 +82,7 @@
}
// Find the precomputed handler class info.
//
- Class slc = schemaLevel.getClass();
+ Class<? extends Schema> slc = schemaLevel.getClass();
HandlerClassInfo classInfo = HandlerClassInfo.getClassInfo(slc);
assert (classInfo != null); // would've thrown if unregistered
HandlerMethod method = classInfo.getTextMethod();
@@ -118,7 +118,7 @@
// Find the precomputed handler class info.
//
- Class slc = schemaLevel.getClass();
+ Class<? extends Schema> slc = schemaLevel.getClass();
HandlerClassInfo classInfo = HandlerClassInfo.getClassInfo(slc);
assert (classInfo != null); // would've thrown if unregistered
HandlerMethod method = classInfo.getEndMethod(elem);
@@ -174,7 +174,7 @@
// Find the precomputed handler class info.
//
- Class slc = schemaLevel.getClass();
+ Class<? extends Schema> slc = schemaLevel.getClass();
HandlerClassInfo classInfo = HandlerClassInfo.getClassInfo(slc);
HandlerMethod method = classInfo.getStartMethod(elemName);
@@ -268,15 +268,15 @@
}
private Object[] getCurrentArgs() {
- return (Object[]) argStack.peek();
+ return argStack.peek();
}
private Schema getNextToTopSchemaLevel() {
- return (Schema) schemaLevels.get(schemaLevels.size() - 2);
+ return schemaLevels.get(schemaLevels.size() - 2);
}
private Schema getTopSchemaLevel() {
- return (Schema) schemaLevels.peek();
+ return schemaLevels.peek();
}
private void parse(TreeLogger logger, Schema topSchema, Reader reader)
@@ -303,7 +303,11 @@
Throwable caught = null;
try {
this.reader = reader;
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd",
+ false);
+ SAXParser parser = factory.newSAXParser();
InputSource inputSource = new InputSource(this.reader);
XMLReader xmlReader = parser.getXMLReader();
xmlReader.setContentHandler(this);
@@ -351,7 +355,7 @@
//
Schema maybeParent = null;
for (int i = schemaLevels.size() - 1; i >= 0; --i) {
- maybeParent = (Schema) schemaLevels.get(i);
+ maybeParent = schemaLevels.get(i);
if (maybeParent != null) {
break;
}
@@ -384,16 +388,16 @@
/**
* Can safely register the same class recursively.
*/
- public static void registerSchemaLevel(Class schemaLevelClass) {
+ public static void registerSchemaLevel(Class<? extends Schema> schemaLevelClass) {
HandlerClassInfo.registerClass(schemaLevelClass);
// Try to register nested classes.
//
- Class[] nested = schemaLevelClass.getDeclaredClasses();
+ Class<?>[] nested = schemaLevelClass.getDeclaredClasses();
for (int i = 0, n = nested.length; i < n; ++i) {
- Class nestedClass = nested[i];
+ Class<?> nestedClass = nested[i];
if (Schema.class.isAssignableFrom(nestedClass)) {
- registerSchemaLevel(nestedClass);
+ registerSchemaLevel(nestedClass.asSubclass(Schema.class));
}
}
}
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandler.java b/dev/core/src/com/google/gwt/util/tools/ArgHandler.java
index 7dcacf8..81f7ea1 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandler.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandler.java
@@ -20,7 +20,9 @@
*/
public abstract class ArgHandler {
- public abstract String[] getDefaultArgs();
+ public String[] getDefaultArgs() {
+ return null;
+ }
public abstract String getPurpose();
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerDir.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerDir.java
index 968e622..5123cb9 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerDir.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerDir.java
@@ -22,10 +22,6 @@
*/
public abstract class ArgHandlerDir extends ArgHandler {
- public String[] getDefaultArgs() {
- return null;
- }
-
public abstract String getPurpose();
public abstract String getTag();
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerExtra.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerExtra.java
index dbe1984..65e7587 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerExtra.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerExtra.java
@@ -22,10 +22,6 @@
public abstract boolean addExtraArg(String arg);
- public String[] getDefaultArgs() {
- return null;
- }
-
public final String getTag() {
return null;
}
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerFlag.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerFlag.java
index 1c86b12..10dcdb2 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerFlag.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerFlag.java
@@ -22,10 +22,6 @@
*/
public abstract class ArgHandlerFlag extends ArgHandler {
- public String[] getDefaultArgs() {
- return null;
- }
-
public abstract String getPurpose();
public abstract String getTag();
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerInt.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerInt.java
index b69c8ed..89f069a 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerInt.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerInt.java
@@ -20,10 +20,6 @@
*/
public abstract class ArgHandlerInt extends ArgHandler {
- public String[] getDefaultArgs() {
- return null;
- }
-
public abstract String getPurpose();
public abstract String getTag();
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerOutDir.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerOutDir.java
index ea4f7a9..2a57c0c 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerOutDir.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerOutDir.java
@@ -21,7 +21,7 @@
public abstract class ArgHandlerOutDir extends ArgHandlerDir {
public String[] getDefaultArgs() {
- return new String[] {"-out", System.getProperty("user.dir")};
+ return new String[] {getTag(), System.getProperty("user.dir")};
}
public String getPurpose() {
diff --git a/dev/core/src/com/google/gwt/util/tools/ArgHandlerString.java b/dev/core/src/com/google/gwt/util/tools/ArgHandlerString.java
index b6f56bd..f947e21 100644
--- a/dev/core/src/com/google/gwt/util/tools/ArgHandlerString.java
+++ b/dev/core/src/com/google/gwt/util/tools/ArgHandlerString.java
@@ -20,10 +20,6 @@
*/
public abstract class ArgHandlerString extends ArgHandler {
- public String[] getDefaultArgs() {
- return null;
- }
-
public int handle(String[] args, int startIndex) {
if (startIndex + 1 < args.length) {
if (!setString(args[startIndex + 1])) {
diff --git a/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java b/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java
new file mode 100644
index 0000000..5faff0d
--- /dev/null
+++ b/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java
@@ -0,0 +1,76 @@
+package com.google.gwt.dev;
+
+import com.google.gwt.util.tools.Utility;
+
+import junit.framework.TestCase;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+/**
+ * Base class for argument processor testing.
+ */
+public abstract class ArgProcessorTestBase extends TestCase {
+
+ private static class MockOutputStream extends OutputStream {
+ private boolean isEmpty = true;
+
+ public boolean isEmpty() {
+ return isEmpty;
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ isEmpty = false;
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ isEmpty = false;
+ }
+ }
+
+ /*
+ * The "compute installation directory" dance.
+ */
+ static {
+ String oldValue = System.getProperty("gwt.devjar");
+ System.setProperty("gwt.devjar", "gwt-dev-windows.jar");
+ Utility.getInstallPath();
+ if (oldValue == null) {
+ System.getProperties().remove("gwt.devjar");
+ } else {
+ System.setProperty("gwt.devjar", oldValue);
+ }
+ }
+
+ protected static void assertProcessFailure(ArgProcessorBase argProcessor,
+ String... args) {
+ PrintStream oldErrStream = System.err;
+ MockOutputStream myErrStream = new MockOutputStream();
+ try {
+ System.setErr(new PrintStream(myErrStream, true));
+ assertFalse(argProcessor.processArgs(args));
+ } finally {
+ System.setErr(oldErrStream);
+ }
+ assertFalse(myErrStream.isEmpty());
+ }
+
+ protected static void assertProcessSuccess(ArgProcessorBase argProcessor,
+ String... args) {
+ PrintStream oldErrStream = System.err;
+ ByteArrayOutputStream myErrStream = new ByteArrayOutputStream();
+ try {
+ System.setErr(new PrintStream(myErrStream, true));
+ if (!argProcessor.processArgs(args)) {
+ fail(new String(myErrStream.toByteArray()));
+ }
+ assertEquals(0, myErrStream.size());
+ } finally {
+ System.setErr(oldErrStream);
+ }
+ }
+}
diff --git a/dev/core/test/com/google/gwt/dev/CompilerTest.java b/dev/core/test/com/google/gwt/dev/CompilerTest.java
new file mode 100644
index 0000000..cda54e3
--- /dev/null
+++ b/dev/core/test/com/google/gwt/dev/CompilerTest.java
@@ -0,0 +1,68 @@
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.dev.Compiler.CompilerOptionsImpl;
+import com.google.gwt.dev.jjs.JsOutputOption;
+
+import java.io.File;
+
+/**
+ * Test for {@link Compiler}.
+ */
+public class CompilerTest extends ArgProcessorTestBase {
+
+ private final Compiler.ArgProcessor argProcessor;
+ private final CompilerOptionsImpl options = new CompilerOptionsImpl();
+
+ public CompilerTest() {
+ argProcessor = new Compiler.ArgProcessor(options);
+ }
+
+ public void testAllValidArgs() {
+ assertProcessSuccess(argProcessor, "-logLevel", "DEBUG", "-style",
+ "PRETTY", "-ea", "-XdisableAggressiveOptimization", "-gen", "myGen",
+ "-war", "myWar", "-workDir", "myWork", "-extra", "myExtra",
+ "-localWorkers", "2", "c.g.g.h.H", "my.Module");
+
+ assertEquals(new File("myGen").getAbsoluteFile(),
+ options.getGenDir().getAbsoluteFile());
+ assertEquals(new File("myWar"), options.getWarDir());
+ assertEquals(new File("myWork"), options.getWorkDir());
+ assertEquals(new File("myExtra"), options.getExtraDir());
+
+ assertEquals(2, options.getLocalWorkers());
+
+ assertEquals(TreeLogger.DEBUG, options.getLogLevel());
+ assertEquals(JsOutputOption.PRETTY, options.getOutput());
+ assertTrue(options.isEnableAssertions());
+ assertFalse(options.isAggressivelyOptimize());
+
+ assertEquals(2, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ assertEquals("my.Module", options.getModuleNames().get(1));
+ }
+
+ public void testDefaultArgs() {
+ assertProcessSuccess(argProcessor, "c.g.g.h.H");
+
+ assertEquals(null, options.getGenDir());
+ assertEquals(new File("war").getAbsoluteFile(),
+ options.getWarDir().getAbsoluteFile());
+ assertEquals(null, options.getWorkDir());
+ assertEquals(null, options.getExtraDir());
+
+ assertEquals(TreeLogger.INFO, options.getLogLevel());
+ assertEquals(JsOutputOption.OBFUSCATED, options.getOutput());
+ assertFalse(options.isEnableAssertions());
+ assertTrue(options.isAggressivelyOptimize());
+
+ assertEquals(1, options.getLocalWorkers());
+
+ assertEquals(1, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ }
+
+ public void testForbiddenArgs() {
+ assertProcessFailure(argProcessor, "-out", "www");
+ }
+}
diff --git a/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java b/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java
new file mode 100644
index 0000000..fb4e07b
--- /dev/null
+++ b/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java
@@ -0,0 +1,63 @@
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.dev.GWTCompiler.GWTCompilerOptionsImpl;
+import com.google.gwt.dev.jjs.JsOutputOption;
+
+import java.io.File;
+
+/**
+ * Test for deprecated {@link GWTShell}.
+ */
+@SuppressWarnings("deprecation")
+public class GWTCompilerTest extends ArgProcessorTestBase {
+
+ private final GWTCompiler.ArgProcessor argProcessor;
+ private final GWTCompilerOptionsImpl options = new GWTCompilerOptionsImpl();
+
+ public GWTCompilerTest() {
+ argProcessor = new GWTCompiler.ArgProcessor(options);
+ }
+
+ public void testAllValidArgs() {
+ assertProcessSuccess(argProcessor, "-logLevel", "DEBUG", "-style",
+ "PRETTY", "-ea", "-XdisableAggressiveOptimization", "-out", "myWww",
+ "-gen", "myGen", "c.g.g.h.H", "my.Module");
+
+ assertEquals(new File("myGen").getAbsoluteFile(),
+ options.getGenDir().getAbsoluteFile());
+ assertEquals(new File("myWww"), options.getOutDir());
+
+ assertEquals(TreeLogger.DEBUG, options.getLogLevel());
+ assertEquals(JsOutputOption.PRETTY, options.getOutput());
+ assertTrue(options.isEnableAssertions());
+ assertFalse(options.isAggressivelyOptimize());
+
+ assertEquals(2, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ assertEquals("my.Module", options.getModuleNames().get(1));
+ }
+
+ public void testDefaultArgs() {
+ assertProcessSuccess(argProcessor, "c.g.g.h.H");
+
+ assertEquals(null, options.getGenDir());
+ assertEquals(new File("").getAbsoluteFile(),
+ options.getOutDir().getAbsoluteFile());
+
+ assertEquals(TreeLogger.INFO, options.getLogLevel());
+ assertEquals(JsOutputOption.OBFUSCATED, options.getOutput());
+ assertFalse(options.isEnableAssertions());
+ assertTrue(options.isAggressivelyOptimize());
+
+ assertEquals(1, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ }
+
+ public void testForbiddenArgs() {
+ assertProcessFailure(argProcessor, "-localWorkers", "2");
+ assertProcessFailure(argProcessor, "-extra", "extra");
+ assertProcessFailure(argProcessor, "-war", "war");
+ assertProcessFailure(argProcessor, "-work", "work");
+ }
+}
diff --git a/dev/core/test/com/google/gwt/dev/GWTShellTest.java b/dev/core/test/com/google/gwt/dev/GWTShellTest.java
new file mode 100644
index 0000000..7b76e59
--- /dev/null
+++ b/dev/core/test/com/google/gwt/dev/GWTShellTest.java
@@ -0,0 +1,73 @@
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.dev.GWTShell.ShellOptionsImpl;
+import com.google.gwt.dev.HostedModeTest.MySCL;
+import com.google.gwt.dev.jjs.JsOutputOption;
+import com.google.gwt.dev.shell.BrowserWidgetHostChecker;
+
+import java.io.File;
+
+/**
+ * Test for deprecated {@link GWTShell}.
+ */
+@SuppressWarnings("deprecation")
+public class GWTShellTest extends ArgProcessorTestBase {
+
+ private final GWTShell.ArgProcessor argProcessor;
+ private final ShellOptionsImpl options = new ShellOptionsImpl();
+
+ public GWTShellTest() {
+ argProcessor = new GWTShell.ArgProcessor(options, false, false);
+ }
+
+ public void testAllValidArgs() {
+ assertProcessSuccess(argProcessor, "-port", "8080", "-whitelist", "white",
+ "-blacklist", "black", "-logLevel", "DEBUG", "-style", "PRETTY", "-ea",
+ "-XdisableAggressiveOptimization", "-noserver", "-out", "myWww",
+ "-gen", "myGen", "http://www.google.com/", "foo");
+
+ assertNotNull(BrowserWidgetHostChecker.matchWhitelisted("white"));
+ assertNotNull(BrowserWidgetHostChecker.matchBlacklisted("black"));
+
+ assertEquals(new File("myGen").getAbsoluteFile(),
+ options.getGenDir().getAbsoluteFile());
+ assertEquals(new File("myWww"), options.getOutDir());
+
+ assertEquals(TreeLogger.DEBUG, options.getLogLevel());
+ assertEquals(JsOutputOption.PRETTY, options.getOutput());
+ assertTrue(options.isEnableAssertions());
+ assertFalse(options.isAggressivelyOptimize());
+
+ assertEquals(8080, options.getPort());
+ assertTrue(options.isNoServer());
+ assertEquals(2, options.getStartupURLs().size());
+ assertEquals("http://www.google.com/", options.getStartupURLs().get(0));
+ assertEquals("foo", options.getStartupURLs().get(1));
+ }
+
+ public void testDefaultArgs() {
+ assertProcessSuccess(argProcessor);
+
+ assertEquals(null, options.getGenDir());
+ assertEquals(new File("").getAbsoluteFile(),
+ options.getOutDir().getAbsoluteFile());
+
+ assertEquals(TreeLogger.INFO, options.getLogLevel());
+ assertEquals(JsOutputOption.OBFUSCATED, options.getOutput());
+ assertFalse(options.isEnableAssertions());
+ assertTrue(options.isAggressivelyOptimize());
+
+ assertEquals(8888, options.getPort());
+ assertFalse(options.isNoServer());
+ assertEquals(0, options.getStartupURLs().size());
+ }
+
+ public void testForbiddenArgs() {
+ assertProcessFailure(argProcessor, "-localWorkers", "2");
+ assertProcessFailure(argProcessor, "-extra", "extra");
+ assertProcessFailure(argProcessor, "-war", "war");
+ assertProcessFailure(argProcessor, "-work", "work");
+ assertProcessFailure(argProcessor, "-server", MySCL.class.getName());
+ }
+}
diff --git a/dev/core/test/com/google/gwt/dev/HostedModeTest.java b/dev/core/test/com/google/gwt/dev/HostedModeTest.java
new file mode 100644
index 0000000..015e943
--- /dev/null
+++ b/dev/core/test/com/google/gwt/dev/HostedModeTest.java
@@ -0,0 +1,121 @@
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.ServletContainer;
+import com.google.gwt.core.ext.ServletContainerLauncher;
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.dev.HostedMode.HostedModeOptionsImpl;
+import com.google.gwt.dev.jjs.JsOutputOption;
+import com.google.gwt.dev.shell.BrowserWidgetHostChecker;
+
+import java.io.File;
+import java.net.BindException;
+
+/**
+ * Test for {@link HostedMode}.
+ */
+public class HostedModeTest extends ArgProcessorTestBase {
+
+ public static class MySCL extends ServletContainerLauncher {
+ public ServletContainer start(TreeLogger logger, int port, File appRootDir)
+ throws BindException, Exception {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ private final HostedMode.ArgProcessor argProcessor;
+ private final HostedModeOptionsImpl options = new HostedModeOptionsImpl();
+
+ public HostedModeTest() {
+ argProcessor = new HostedMode.ArgProcessor(options);
+ }
+
+ public void testAllValidArgs() {
+ assertProcessSuccess(argProcessor, "-port", "8080", "-whitelist", "white",
+ "-blacklist", "black", "-logLevel", "DEBUG", "-style", "PRETTY", "-ea",
+ "-XdisableAggressiveOptimization", "-noserver", "-server",
+ MySCL.class.getName(), "-gen", "myGen", "-war", "myWar", "-workDir",
+ "myWork", "-extra", "myExtra", "-localWorkers", "2", "-startupUrl",
+ "http://www.google.com/", "-startupUrl", "foo", "c.g.g.h.H",
+ "my.Module");
+
+ assertNotNull(BrowserWidgetHostChecker.matchWhitelisted("white"));
+ assertNotNull(BrowserWidgetHostChecker.matchBlacklisted("black"));
+
+ assertEquals(new File("myGen").getAbsoluteFile(),
+ options.getGenDir().getAbsoluteFile());
+ assertEquals(new File("myWar"), options.getWarDir());
+ assertEquals(new File("myWork"), options.getWorkDir());
+ assertEquals(new File("myExtra"), options.getExtraDir());
+
+ assertEquals(TreeLogger.DEBUG, options.getLogLevel());
+ assertEquals(JsOutputOption.PRETTY, options.getOutput());
+ assertTrue(options.isEnableAssertions());
+ assertFalse(options.isAggressivelyOptimize());
+
+ assertEquals(2, options.getLocalWorkers());
+
+ assertEquals(8080, options.getPort());
+ // False because -server overrides -noserver.
+ assertFalse(options.isNoServer());
+ assertSame(MySCL.class, options.getServletContainerLauncher().getClass());
+
+ assertEquals(2, options.getStartupURLs().size());
+ assertEquals("http://www.google.com/", options.getStartupURLs().get(0));
+ assertEquals("foo", options.getStartupURLs().get(1));
+
+ assertEquals(2, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ assertEquals("my.Module", options.getModuleNames().get(1));
+ }
+
+ public void testNoServer() {
+ assertProcessSuccess(argProcessor, "-noserver", "c.g.g.h.H");
+
+ assertTrue(options.isNoServer());
+ assertNull(options.getServletContainerLauncher());
+
+ assertEquals(1, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ }
+
+ public void testNoServerOverridesServer() {
+ assertProcessSuccess(argProcessor, "-server", MySCL.class.getName(),
+ "-noserver", "c.g.g.h.H");
+
+ assertTrue(options.isNoServer());
+ assertSame(MySCL.class, options.getServletContainerLauncher().getClass());
+
+ assertEquals(1, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ }
+
+ public void testDefaultArgs() {
+ assertProcessSuccess(argProcessor, "c.g.g.h.H");
+
+ assertEquals(null, options.getGenDir());
+ assertEquals(new File("war").getAbsoluteFile(),
+ options.getWarDir().getAbsoluteFile());
+ assertEquals(null, options.getWorkDir());
+ assertEquals(null, options.getExtraDir());
+
+ assertEquals(TreeLogger.INFO, options.getLogLevel());
+ assertEquals(JsOutputOption.OBFUSCATED, options.getOutput());
+ assertFalse(options.isEnableAssertions());
+ assertTrue(options.isAggressivelyOptimize());
+
+ assertEquals(1, options.getLocalWorkers());
+
+ assertEquals(8888, options.getPort());
+ assertFalse(options.isNoServer());
+ assertNotNull(options.getServletContainerLauncher());
+
+ assertEquals(0, options.getStartupURLs().size());
+
+ assertEquals(1, options.getModuleNames().size());
+ assertEquals("c.g.g.h.H", options.getModuleNames().get(0));
+ }
+
+ public void testForbiddenArgs() {
+ assertProcessFailure(argProcessor, "-out", "www");
+ }
+}
diff --git a/dev/core/test/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsCheckerTest.java b/dev/core/test/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsCheckerTest.java
index 16b7e90..e3ab405 100644
--- a/dev/core/test/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsCheckerTest.java
+++ b/dev/core/test/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsCheckerTest.java
@@ -92,6 +92,10 @@
return null;
}
+ public char[][][] getMissingTypeNames() {
+ return null;
+ }
+
public int getModifiers() {
return 0;
}
@@ -169,7 +173,8 @@
TypeDeclaration typeDeclaration = new TypeDeclaration(compilationResult);
typeDeclaration.scope = new ClassScope(cud.scope, null);
- typeDeclaration.staticInitializerScope = new MethodScope(typeDeclaration.scope, null, false);
+ typeDeclaration.staticInitializerScope = new MethodScope(
+ typeDeclaration.scope, null, false);
cud.types = new TypeDeclaration[] {typeDeclaration};
BinaryTypeBinding binaryTypeBinding = new BinaryTypeBinding(null,
@@ -205,8 +210,10 @@
assertEquals(expectedExpressions.length, binaryTypeReferenceSites.size());
for (int i = 0; i < binaryTypeReferenceSites.size(); ++i) {
BinaryTypeReferenceSite binaryTypeReferenceSite = binaryTypeReferenceSites.get(i);
- assertSame(binaryTypeBinding, binaryTypeReferenceSite.getBinaryTypeBinding());
- assertSame(expectedExpressions[i], binaryTypeReferenceSite.getExpression());
+ assertSame(binaryTypeBinding,
+ binaryTypeReferenceSite.getBinaryTypeBinding());
+ assertSame(expectedExpressions[i],
+ binaryTypeReferenceSite.getExpression());
}
}
diff --git a/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java b/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java
index f0cbe8c..e1f8aef 100644
--- a/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java
+++ b/dev/linux/src/com/google/gwt/dev/shell/moz/BrowserWidgetMoz.java
@@ -70,6 +70,17 @@
}
/**
+ * Causes a link to occur for the specified module.
+ *
+ * @param moduleName the module name to link
+ * @return <code>true</code> if this module is stale and should be
+ * reloaded
+ */
+ public boolean initModule(String moduleName) {
+ return getHost().initModule(moduleName);
+ }
+
+ /**
* Unload one or more modules.
*
* @param scriptObject window to unload, 0 if all
diff --git a/dev/linux/src/com/google/gwt/dev/shell/moz/LowLevelMoz.java b/dev/linux/src/com/google/gwt/dev/shell/moz/LowLevelMoz.java
index 1606f78..2b89c2e 100644
--- a/dev/linux/src/com/google/gwt/dev/shell/moz/LowLevelMoz.java
+++ b/dev/linux/src/com/google/gwt/dev/shell/moz/LowLevelMoz.java
@@ -75,6 +75,8 @@
* Safari.
*/
interface ExternalObject {
+ boolean initModule(String moduleName);
+
boolean gwtOnLoad(int scriptGlobalObject, String moduleName, String version);
}
diff --git a/dev/mac/src/com/google/gwt/dev/shell/mac/BrowserWidgetSaf.java b/dev/mac/src/com/google/gwt/dev/shell/mac/BrowserWidgetSaf.java
index 439cae7..3d0fe1a 100644
--- a/dev/mac/src/com/google/gwt/dev/shell/mac/BrowserWidgetSaf.java
+++ b/dev/mac/src/com/google/gwt/dev/shell/mac/BrowserWidgetSaf.java
@@ -39,6 +39,9 @@
if ("gwtonload".equalsIgnoreCase(name)) {
return LowLevelSaf.wrapDispatchMethod(jsContext, "gwtOnload",
new GwtOnLoad());
+ } else if ("initmodule".equalsIgnoreCase(name)) {
+ return LowLevelSaf.wrapDispatchMethod(jsContext, "initModule",
+ new InitModule());
}
// Native code eats the same ref it gave us.
return LowLevelSaf.getJsUndefined(jsContext);
@@ -88,6 +91,17 @@
}
}
+ /**
+ * Causes a link to occur for the specified module.
+ *
+ * @param moduleName the module name to link
+ * @return <code>true</code> if this module is stale and should be
+ * reloaded
+ */
+ public boolean initModule(String moduleName) {
+ return getHost().initModule(moduleName);
+ }
+
public void setField(int jsContext, String name, int value) {
try {
// TODO (knorton): This should produce an error. The SetProperty
@@ -127,8 +141,8 @@
return jsFalse;
}
- if (jsargs.length < 2) {
- reportIncorrectGwtOnLoadInvocation(jsargs.length);
+ if (jsargs.length < 3) {
+ reportIncorrectInvocation("gwtOnLoad", 3, jsargs.length);
return jsFalse;
}
@@ -141,16 +155,10 @@
}
String moduleName = LowLevelSaf.toString(jsContext, jsargs[1]);
- /*
- * gwtOnLoad may or may not be called with a third argument indicating
- * which version of GWT the JavaScript bootstrap sequence assumes that
- * its talking to.
- */
- String version = null;
- if (jsargs.length == 3 && !LowLevelSaf.isJsNull(jsContext, jsargs[2])
- && LowLevelSaf.isJsString(jsContext, jsargs[2])) {
- version = LowLevelSaf.toString(jsContext, jsargs[2]);
+ if (!LowLevelSaf.isJsString(jsContext, jsargs[2])) {
+ return jsFalse;
}
+ String version = LowLevelSaf.toString(jsContext, jsargs[2]);
boolean result = ((ExternalObject) thisObj).gwtOnLoad(jsargs[0],
moduleName, version);
@@ -168,6 +176,46 @@
}
}
+ private final class InitModule implements DispatchMethod {
+
+ public int invoke(int jsContext, int jsthis, int[] jsargs, int[] exception) {
+ int jsFalse = LowLevelSaf.toJsBoolean(jsContext, false);
+ LowLevelSaf.pushJsContext(jsContext);
+ try {
+ if (!LowLevelSaf.isDispatchObject(jsContext, jsthis)) {
+ return jsFalse;
+ }
+
+ Object thisObj = LowLevelSaf.unwrapDispatchObject(jsContext, jsthis);
+ if (!(thisObj instanceof ExternalObject)) {
+ return jsFalse;
+ }
+
+ if (jsargs.length < 1) {
+ reportIncorrectInvocation("initModule", 1, jsargs.length);
+ return jsFalse;
+ }
+
+ if (!LowLevelSaf.isJsString(jsContext, jsargs[0])) {
+ return jsFalse;
+ }
+ String moduleName = LowLevelSaf.toString(jsContext, jsargs[0]);
+
+ boolean result = ((ExternalObject) thisObj).initModule(moduleName);
+ // Native code eats the same ref it gave us.
+ return LowLevelSaf.toJsBoolean(jsContext, result);
+ } catch (Throwable e) {
+ return jsFalse;
+ } finally {
+ for (int jsarg : jsargs) {
+ LowLevelSaf.gcUnprotect(jsContext, jsarg);
+ }
+ LowLevelSaf.gcUnprotect(jsContext, jsthis);
+ LowLevelSaf.popJsContext(jsContext);
+ }
+ }
+ }
+
private static final int REDRAW_PERIOD = 250;
static {
diff --git a/dev/oophm/overlay/com/google/gwt/dev/GWTShell.java b/dev/oophm/overlay/com/google/gwt/dev/GWTShell.java
index bad33df..9bd08a6 100644
--- a/dev/oophm/overlay/com/google/gwt/dev/GWTShell.java
+++ b/dev/oophm/overlay/com/google/gwt/dev/GWTShell.java
@@ -28,29 +28,18 @@
import com.google.gwt.dev.shell.BrowserListener;
import com.google.gwt.dev.shell.BrowserWidget;
import com.google.gwt.dev.shell.BrowserWidgetHost;
-import com.google.gwt.dev.shell.BrowserWidgetHostChecker;
import com.google.gwt.dev.shell.ModuleSpaceHost;
import com.google.gwt.dev.shell.OophmSessionHandler;
import com.google.gwt.dev.shell.ShellMainWindow;
import com.google.gwt.dev.shell.ShellModuleSpaceHost;
import com.google.gwt.dev.shell.WorkDirs;
import com.google.gwt.dev.shell.tomcat.EmbeddedTomcatServer;
-import com.google.gwt.dev.util.PerfLogger;
import com.google.gwt.dev.util.Util;
-import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization;
-import com.google.gwt.dev.util.arg.ArgHandlerEnableAssertions;
-import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
-import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
-import com.google.gwt.dev.util.arg.ArgHandlerLogLevel;
import com.google.gwt.dev.util.arg.ArgHandlerOutDir;
-import com.google.gwt.dev.util.arg.ArgHandlerScriptStyle;
-import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
import com.google.gwt.util.tools.ArgHandlerExtra;
-import com.google.gwt.util.tools.ArgHandlerFlag;
import com.google.gwt.util.tools.ArgHandlerString;
-import com.google.gwt.util.tools.ToolBase;
import java.awt.Cursor;
import java.io.File;
@@ -71,100 +60,7 @@
/**
* The main executable class for the hosted mode shell.
*/
-public class GWTShell extends ToolBase {
-
- /**
- * Handles the -blacklist command line argument.
- */
- protected class ArgHandlerBlacklist extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-blacklist", ""};
- }
-
- @Override
- public String getPurpose() {
- return "Prevents the user browsing URLs that match the specified regexes (comma or space separated)";
- }
-
- @Override
- public String getTag() {
- return "-blacklist";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"blacklist-string"};
- }
-
- @Override
- public boolean setString(String blacklistStr) {
- return BrowserWidgetHostChecker.blacklistRegexes(blacklistStr);
- }
- }
-
- /**
- * handles the -noserver command line flag.
- */
- protected class ArgHandlerNoServerFlag extends ArgHandlerFlag {
- @Override
- public String getPurpose() {
- return "Prevents the embedded Tomcat server from running, even if a port is specified";
- }
-
- @Override
- public String getTag() {
- return "-noserver";
- }
-
- @Override
- public boolean setFlag() {
- runTomcat = false;
- return true;
- }
- }
-
- /**
- * Handles the -port command line flag.
- */
- protected class ArgHandlerPort extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-port", "8888"};
- }
-
- @Override
- public String getPurpose() {
- return "Runs an embedded Tomcat instance on the specified port (defaults to 8888)";
- }
-
- @Override
- public String getTag() {
- return "-port";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"port-number | \"auto\""};
- }
-
- @Override
- public boolean setString(String value) {
- if (value.equals("auto")) {
- port = 0;
- } else {
- try {
- port = Integer.parseInt(value);
- } catch (NumberFormatException e) {
- System.err.println("A port must be an integer or \"auto\"");
- return false;
- }
- }
- return true;
- }
- }
+public class GWTShell extends HostedModeBase {
/**
* Handles the -portHosted command line flag.
@@ -209,13 +105,20 @@
}
/**
- * Handles the list of startup urls that can be passed on the command line.
+ * Handles the list of startup urls that can be passed at the end of the
+ * command line.
*/
- protected class ArgHandlerStartupURLs extends ArgHandlerExtra {
+ protected static class ArgHandlerStartupURLsExtra extends ArgHandlerExtra {
+
+ private final OptionStartupURLs options;
+
+ public ArgHandlerStartupURLsExtra(OptionStartupURLs options) {
+ this.options = options;
+ }
@Override
public boolean addExtraArg(String arg) {
- addStartupURL(arg);
+ options.addStartupURL(arg);
return true;
}
@@ -231,62 +134,59 @@
}
/**
- * Handles the -whitelist command line flag.
+ * The GWTShell argument processor.
*/
- protected class ArgHandlerWhitelist extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-whitelist", ""};
+ protected static class ArgProcessor extends HostedModeBase.ArgProcessor {
+ public ArgProcessor(ShellOptionsImpl options, boolean forceServer,
+ boolean noURLs) {
+ super(options, forceServer);
+ if (!noURLs) {
+ registerHandler(new ArgHandlerStartupURLsExtra(options));
+ }
+ registerHandler(new ArgHandlerOutDir(options));
}
@Override
- public String getPurpose() {
- return "Allows the user to browse URLs that match the specified regexes (comma or space separated)";
- }
-
- @Override
- public String getTag() {
- return "-whitelist";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"whitelist-string"};
- }
-
- @Override
- public boolean setString(String whitelistStr) {
- return BrowserWidgetHostChecker.whitelistRegexes(whitelistStr);
+ protected String getName() {
+ return GWTShell.class.getName();
}
}
/**
- * Concrete class to implement all compiler options.
+ * Concrete class to implement all shell options.
*/
- static class ShellOptionsImpl extends GWTCompilerOptionsImpl implements
- ShellOptions, WorkDirs {
+ static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements
+ HostedModeBaseOptions, WorkDirs, LegacyCompilerOptions {
+ private int localWorkers;
+ private File outDir;
+
public File getCompilerOutputDir(ModuleDef moduleDef) {
- return new File(getOutDir(), moduleDef.getDeployTo());
+ return new File(getOutDir(), moduleDef.getName());
+ }
+
+ public int getLocalWorkers() {
+ return localWorkers;
+ }
+
+ public File getOutDir() {
+ return outDir;
}
public File getShellPublicGenDir(ModuleDef moduleDef) {
return new File(getShellBaseWorkDir(moduleDef), "public");
}
- /**
- * The base shell work directory.
- */
- protected File getShellBaseWorkDir(ModuleDef moduleDef) {
- return new File(new File(getWorkDir(), moduleDef.getName()), "shell");
+ @Override
+ public File getWorkDir() {
+ return new File(getOutDir(), ".gwt-tmp");
}
- /**
- * Where generated files go by default until we are sure they are public;
- * then they are copied into {@link #getShellPublicGenDir(ModuleDef)}.
- */
- protected File getShellPrivateGenDir(ModuleDef moduleDef) {
- return new File(getShellBaseWorkDir(moduleDef), "gen");
+ public void setLocalWorkers(int localWorkers) {
+ this.localWorkers = localWorkers;
+ }
+
+ public void setOutDir(File outDir) {
+ this.outDir = outDir;
}
}
@@ -344,12 +244,9 @@
// Create a sandbox for the module.
// TODO(jat): consider multiple instances of the same module open at
// once
- File shellDir = new File(outDir, GWT_SHELL_PATH + File.separator
- + moduleName);
-
TypeOracle typeOracle = moduleDef.getTypeOracle(logger);
ShellModuleSpaceHost host = doCreateShellModuleSpaceHost(logger,
- typeOracle, moduleDef, genDir, shellDir);
+ typeOracle, moduleDef);
if (tab != null) {
moduleTabs.put(host, tab);
@@ -445,10 +342,15 @@
* shutdown AWT related threads, since the contract for their termination is
* still implementation-dependent.
*/
- GWTShell shellMain = new GWTShell();
- if (shellMain.processArgs(args)) {
- shellMain.run();
+ GWTShell gwtShell = new GWTShell();
+ ArgProcessor argProcessor = new ArgProcessor(gwtShell.options, false, false);
+ if (argProcessor.processArgs(args)) {
+ gwtShell.run();
+ // Exit w/ success code.
+ System.exit(0);
}
+ // Exit w/ non-success code.
+ System.exit(-1);
}
/**
@@ -470,7 +372,12 @@
protected File outDir;
- protected final ShellOptionsImpl options = new ShellOptionsImpl();
+ /**
+ * Hiding super field because it's actually the same object, just with a
+ * stronger type.
+ */
+ @SuppressWarnings("hiding")
+ protected final ShellOptionsImpl options = (ShellOptionsImpl) super.options;
/**
* Cheat on the first load's refresh by assuming the module loaded by
@@ -490,14 +397,10 @@
private ShellMainWindow mainWnd;
- private int port;
-
private int portHosted;
private boolean runTomcat = true;
- private boolean started;
-
private final List<String> startupUrls = new ArrayList<String>();
private JTabbedPane tabs;
@@ -506,47 +409,6 @@
private WebServerPanel webServerLog;
- public GWTShell() {
- this(false, false);
- }
-
- protected GWTShell(boolean forceServer, boolean noURLs) {
- // Set any platform specific system properties.
- BootStrapPlatform.initHostedMode();
- BootStrapPlatform.applyPlatformHacks();
-
- registerHandler(getArgHandlerPort());
-
- registerHandler(getArgHandlerPortHosted());
-
- if (!forceServer) {
- registerHandler(new ArgHandlerNoServerFlag());
- }
-
- registerHandler(new ArgHandlerWhitelist());
- registerHandler(new ArgHandlerBlacklist());
-
- registerHandler(new ArgHandlerLogLevel(options));
-
- registerHandler(new ArgHandlerGenDir(options));
- registerHandler(new ArgHandlerWorkDirOptional(options));
-
- if (!noURLs) {
- registerHandler(new ArgHandlerStartupURLs());
- }
-
- registerHandler(new ArgHandlerExtraDir(options));
- registerHandler(new ArgHandlerOutDir(options));
-
- registerHandler(new ArgHandlerScriptStyle(options));
- registerHandler(new ArgHandlerEnableAssertions(options));
- registerHandler(new ArgHandlerDisableAggressiveOptimization(options));
- }
-
- public void addStartupURL(String url) {
- startupUrls.add(url);
- }
-
public File getGenDir() {
return genDir;
}
@@ -559,10 +421,6 @@
return outDir;
}
- public int getPort() {
- return port;
- }
-
public TreeLogger getTopLogger() {
return topLogger;
}
@@ -614,51 +472,6 @@
}
}
- public String normalizeURL(String unknownUrlText) {
- if (unknownUrlText.indexOf(":") != -1) {
- // Assume it's a full url.
- return unknownUrlText;
- }
-
- // Assume it's a trailing url path.
- //
- if (unknownUrlText.length() > 0 && unknownUrlText.charAt(0) == '/') {
- unknownUrlText = unknownUrlText.substring(1);
- }
-
- int prt = getPort();
- if (prt != 80 && prt != 0) {
- // CHECKSTYLE_OFF: Not really an assembled error message, so no space
- // after ':'.
- return "http://localhost:" + prt + "/" + unknownUrlText;
- // CHECKSTYLE_ON
- } else {
- return "http://localhost/" + unknownUrlText;
- }
- }
-
- /**
- * Sets up all the major aspects of running the shell graphically, including
- * creating the main window and optionally starting the embedded Tomcat
- * server.
- */
- public void run() {
- try {
- if (!startUp()) {
- // Failed to initialize.
- return;
- }
-
- // Perform any platform-specific hacks to initialize the GUI.
- BootStrapPlatform.initGui();
-
- // Tomcat's running now, so launch browsers for startup urls now.
- launchStartupUrls(getTopLogger());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
public void setCompilerOptions(CompilerOptions options) {
this.options.copyFrom(options);
}
@@ -675,12 +488,9 @@
this.outDir = outDir;
}
- public void setPort(int port) {
- this.port = port;
- }
-
- public void setRunTomcat(boolean run) {
- runTomcat = run;
+ @Override
+ protected void compile(TreeLogger logger) throws UnableToCompleteException {
+ throw new UnsupportedOperationException();
}
/**
@@ -688,13 +498,19 @@
* def programmatically in some cases (this is needed for JUnit support, for
* example).
*/
+ @SuppressWarnings("deprecation")
protected void compile(TreeLogger logger, ModuleDef moduleDef)
throws UnableToCompleteException {
- CompilerOptions newOptions = new GWTCompilerOptionsImpl(options);
- newOptions.setModuleName(moduleDef.getName());
+ LegacyCompilerOptions newOptions = new GWTCompilerOptionsImpl(options);
+ newOptions.addModuleName(moduleDef.getName());
new GWTCompiler(newOptions).run(logger);
}
+ @Override
+ protected HostedModeBaseOptions createOptions() {
+ return new ShellOptionsImpl();
+ }
+
protected ArtifactAcceptor doCreateArtifactAcceptor(final ModuleDef module) {
return new ArtifactAcceptor() {
public void accept(TreeLogger logger, ArtifactSet artifacts)
@@ -716,27 +532,6 @@
}
/**
- * Creates an instance of ShellModuleSpaceHost (or a derived class) using the
- * specified constituent parts. This method is made to be overridden for
- * subclasses that need to change the behavior of ShellModuleSpaceHost.
- *
- * @param logger TreeLogger to use
- * @param typeOracle
- * @param moduleDef
- * @param genDir
- * @return ShellModuleSpaceHost instance
- */
- protected ShellModuleSpaceHost doCreateShellModuleSpaceHost(
- TreeLogger logger, TypeOracle typeOracle, ModuleDef moduleDef,
- File genDir, File shellDir) {
- // Clear out the shell temp directory.
- Util.recursiveDelete(options.getShellBaseWorkDir(moduleDef), true);
- return new ShellModuleSpaceHost(logger, typeOracle, moduleDef,
- options.getGenDir(), options.getShellPrivateGenDir(moduleDef),
- doCreateArtifactAcceptor(moduleDef));
- }
-
- /**
* Can be override to change the default log level in subclasses. JUnit does
* this for example.
*/
@@ -751,11 +546,26 @@
return true;
}
- /**
- * Derived classes can override to set a default port.
- */
- protected ArgHandlerPort getArgHandlerPort() {
- return new ArgHandlerPort();
+ @Override
+ protected void doShutDownServer() {
+ // Stop the HTTP server.
+ //
+ EmbeddedTomcatServer.stop();
+ }
+
+ @Override
+ protected int doStartUpServer() {
+ // TODO(bruce): make tomcat work in terms of the modular launcher
+ String whyFailed = EmbeddedTomcatServer.start(getTopLogger(), getPort(),
+ options);
+
+ // TODO(bruce): test that we can remove this old approach in favor of
+ // a better, logger-based error reporting
+ if (whyFailed != null) {
+ System.err.println(whyFailed);
+ return -1;
+ }
+ return EmbeddedTomcatServer.getPort();
}
/**
@@ -765,10 +575,6 @@
return new ArgHandlerPortHosted();
}
- protected BrowserWidgetHost getBrowserHost() {
- return browserHost;
- }
-
protected void initializeLogger() {
if (mainWnd != null) {
topLogger = mainWnd.getLogger();
@@ -778,73 +584,39 @@
topLogger.setMaxDetail(options.getLogLevel());
}
- /**
- * By default we will open the application window.
- *
- * @return true if we are running in headless mode
- */
- protected boolean isHeadless() {
- return headlessMode;
+ @Override
+ protected boolean initModule(String moduleName) {
+ /*
+ * Not used in legacy mode due to GWTShellServlet playing this role.
+ *
+ * TODO: something smarter here and actually make GWTShellServlet less
+ * magic?
+ */
+ return false;
}
- protected void setHeadless(boolean headlessMode) {
- this.headlessMode = headlessMode;
+ protected void openAppWindow() {
+ ImageIcon gwtIcon = loadImageIcon("icon24.png");
+ frame = new JFrame("GWT Hosted Mode");
+ tabs = new JTabbedPane();
+ boolean checkForUpdates = doShouldCheckForUpdates();
+ mainWnd = new ShellMainWindow(this, checkForUpdates, options.getLogLevel());
+ tabs.addTab("Hosted Mode", gwtIcon, mainWnd, "GWT Hosted-mode");
+ if (runTomcat) {
+ ImageIcon tomcatIcon = loadImageIcon("tomcat24.png");
+ webServerLog = new WebServerPanel(getPort(), options.getLogLevel());
+ tabs.addTab("Tomcat", tomcatIcon, webServerLog);
+ }
+ frame.getContentPane().add(tabs);
+ frame.setSize(950, 700);
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setIconImage(loadImageIcon("icon16.png").getImage());
+ frame.setVisible(true);
}
- /**
- *
- */
- protected void shutDown() {
- if (!runTomcat) {
- return;
- }
-
- // Stop the HTTP server.
- //
- EmbeddedTomcatServer.stop();
- }
-
- protected boolean startUp() {
- if (started) {
- throw new IllegalStateException("Startup code has already been run");
- }
-
- started = true;
-
- // Create the main app window.
- // When it is up and running, it will start the Tomcat server if desired.
- if (!headlessMode) {
- openAppWindow();
- }
-
- // Initialize the logger.
- initializeLogger();
-
+ protected void startUpHook() {
// Accept connections from OOPHM clients
startOophmListener();
-
- if (runTomcat) {
- // Start the HTTP server.
- // Use a new thread so that logging that occurs during startup is
- // displayed immediately.
- //
- final int serverPort = getPort();
-
- PerfLogger.start("GWTShell.startup (Tomcat launch)");
- String whyFailed = EmbeddedTomcatServer.start(headlessMode
- ? getTopLogger() : webServerLog.getLogger(), serverPort, options);
- PerfLogger.end();
-
- if (whyFailed != null) {
- System.err.println(whyFailed);
- return false;
- }
-
- // Record what port Tomcat is actually running on.
- port = EmbeddedTomcatServer.getPort();
- }
-
- return true;
}
@SuppressWarnings("unused")
@@ -889,25 +661,6 @@
// launchExternalBrowser(logger, locationText);
}
- private void openAppWindow() {
- ImageIcon gwtIcon = loadImageIcon("icon24.png");
- frame = new JFrame("GWT Hosted Mode");
- tabs = new JTabbedPane();
- boolean checkForUpdates = doShouldCheckForUpdates();
- mainWnd = new ShellMainWindow(this, checkForUpdates, options.getLogLevel());
- tabs.addTab("Hosted Mode", gwtIcon, mainWnd, "GWT Hosted-mode");
- if (runTomcat) {
- ImageIcon tomcatIcon = loadImageIcon("tomcat24.png");
- webServerLog = new WebServerPanel(getPort(), options.getLogLevel());
- tabs.addTab("Tomcat", tomcatIcon, webServerLog);
- }
- frame.getContentPane().add(tabs);
- frame.setSize(950, 700);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setIconImage(loadImageIcon("icon16.png").getImage());
- frame.setVisible(true);
- }
-
private void startOophmListener() {
listener = new BrowserListener(getTopLogger(), portHosted,
new OophmSessionHandler(browserHost));
diff --git a/dev/windows/src/com/google/gwt/dev/shell/ie/BrowserWidgetIE6.java b/dev/windows/src/com/google/gwt/dev/shell/ie/BrowserWidgetIE6.java
index 2303df1..6e3aa62 100644
--- a/dev/windows/src/com/google/gwt/dev/shell/ie/BrowserWidgetIE6.java
+++ b/dev/windows/src/com/google/gwt/dev/shell/ie/BrowserWidgetIE6.java
@@ -86,6 +86,17 @@
}
}
+ /**
+ * Causes a link to occur for the specified module.
+ *
+ * @param moduleName the module name to link
+ * @return <code>true</code> if this module is stale and should be
+ * reloaded
+ */
+ public boolean initModule(String moduleName) {
+ return getHost().initModule(moduleName);
+ }
+
@Override
protected void getIDsOfNames(String[] names, int[] ids)
throws HResultException {
@@ -98,6 +109,9 @@
if (name.equals("gwtonload")) {
ids[0] = 1;
return;
+ } else if (name.equals("initmodule")) {
+ ids[0] = 2;
+ return;
}
throw new HResultException(DISP_E_UNKNOWNNAME);
@@ -126,15 +140,15 @@
} else if (dispId == 1) {
if ((flags & COM.DISPATCH_METHOD) != 0) {
try {
- if (params.length < 2) {
- reportIncorrectGwtOnLoadInvocation(params.length);
+ if (params.length < 3) {
+ reportIncorrectInvocation("gwtOnLoad", 3, params.length);
throw new HResultException(COM.E_INVALIDARG);
}
IDispatch frameWnd = (params[0].getType() == COM.VT_DISPATCH)
? params[0].getDispatch() : null;
String moduleName = (params[1].getType() == COM.VT_BSTR)
? params[1].getString() : null;
- String version = (params.length > 2 && params[2].getType() == COM.VT_BSTR)
+ String version = (params[2].getType() == COM.VT_BSTR)
? params[2].getString() : null;
boolean success = gwtOnLoad(frameWnd, moduleName, version);
@@ -159,6 +173,38 @@
}
}
throw new HResultException(COM.E_NOTSUPPORTED);
+ } else if (dispId == 2) {
+ if ((flags & COM.DISPATCH_METHOD) != 0) {
+ try {
+ if (params.length < 1) {
+ reportIncorrectInvocation("initModule", 1, params.length);
+ throw new HResultException(COM.E_INVALIDARG);
+ }
+ String moduleName = (params[0].getType() == COM.VT_BSTR)
+ ? params[0].getString() : null;
+ boolean reload = initModule(moduleName);
+
+ // boolean return type
+ return new Variant(reload);
+ } catch (SWTException e) {
+ throw new HResultException(COM.E_INVALIDARG);
+ }
+ } else if ((flags & COM.DISPATCH_PROPERTYGET) != 0) {
+ // property get on the method itself
+ try {
+ Method gwtOnLoadMethod = getClass().getMethod("initModule",
+ new Class[] {String.class});
+ MethodAdaptor methodAdaptor = new MethodAdaptor(gwtOnLoadMethod);
+ IDispatchImpl funcObj = new MethodDispatch(null, methodAdaptor);
+ IDispatch disp = new IDispatch(funcObj.getAddress());
+ disp.AddRef();
+ return new Variant(disp);
+ } catch (Exception e) {
+ // just return VT_EMPTY
+ return new Variant();
+ }
+ }
+ throw new HResultException(COM.E_NOTSUPPORTED);
}
// The specified member id is out of range.
diff --git a/distro-source/linux/build.xml b/distro-source/linux/build.xml
index cb6e9a3..d4fb171 100755
--- a/distro-source/linux/build.xml
+++ b/distro-source/linux/build.xml
@@ -14,6 +14,7 @@
<tarfileset file="${gwt.build.lib}/gwt-servlet.jar" prefix="${project.distname}" />
<tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar" prefix="${project.distname}" />
<tarfileset file="${gwt.build.lib}/gwt-soyc-vis.jar" prefix="${project.distname}" />
+ <tarfileset file="${gwt.build.lib}/gwt-api-checker.jar" prefix="${project.distname}" />
<!-- jni libs-->
<tarfileset dir="${gwt.build.jni}/${dist.platform}" prefix="${project.distname}" />
diff --git a/distro-source/linux/src/projectCreator b/distro-source/linux/src/projectCreator
deleted file mode 100755
index ada82c5..0000000
--- a/distro-source/linux/src/projectCreator
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-HOMEDIR=`dirname $0`;
-java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-linux.jar com.google.gwt.user.tools.ProjectCreator "$@";
diff --git a/distro-source/mac/build.xml b/distro-source/mac/build.xml
index bc49cd3..ca97f73 100755
--- a/distro-source/mac/build.xml
+++ b/distro-source/mac/build.xml
@@ -14,6 +14,7 @@
<tarfileset file="${gwt.build.lib}/gwt-servlet.jar" prefix="${project.distname}" />
<tarfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar" prefix="${project.distname}" />
<tarfileset file="${gwt.build.lib}/gwt-soyc-vis.jar" prefix="${project.distname}" />
+ <tarfileset file="${gwt.build.lib}/gwt-api-checker.jar" prefix="${project.distname}" />
<!-- jni libs-->
<tarfileset dir="${gwt.build.jni}/${dist.platform}" prefix="${project.distname}" />
diff --git a/distro-source/mac/src/projectCreator b/distro-source/mac/src/projectCreator
deleted file mode 100644
index 386ebb6..0000000
--- a/distro-source/mac/src/projectCreator
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-HOMEDIR=`dirname $0`;
-java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-mac.jar com.google.gwt.user.tools.ProjectCreator "$@";
diff --git a/distro-source/windows/build.xml b/distro-source/windows/build.xml
index 4bfb596..0749c6a 100755
--- a/distro-source/windows/build.xml
+++ b/distro-source/windows/build.xml
@@ -14,6 +14,7 @@
<zipfileset file="${gwt.build.lib}/gwt-servlet.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-benchmark-viewer.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-soyc-vis.jar" prefix="${project.distname}" />
+ <zipfileset file="${gwt.build.lib}/gwt-api-checker.jar" prefix="${project.distname}" />
<!-- jni libs-->
<zipfileset dir="${gwt.build.jni}/${dist.platform}" prefix="${project.distname}" />
diff --git a/distro-source/windows/src/projectCreator.cmd b/distro-source/windows/src/projectCreator.cmd
deleted file mode 100755
index 8479144..0000000
--- a/distro-source/windows/src/projectCreator.cmd
+++ /dev/null
@@ -1 +0,0 @@
-@java -cp "%~dp0\gwt-user.jar;%~dp0\gwt-dev-windows.jar" com.google.gwt.user.tools.ProjectCreator %*
diff --git a/eclipse/README.txt b/eclipse/README.txt
index b9a38dc..54955ca 100644
--- a/eclipse/README.txt
+++ b/eclipse/README.txt
@@ -67,6 +67,11 @@
Third, within a category/visibility combination, members should be sorted
alphabetically.
+
+
+------------ Compiler settings ------------
+Window->Preferences->Java->Compiler
+Set the compiler compliance level to 1.5.
== Checkstyle ==
@@ -159,11 +164,11 @@
== Launching 'Hello' ==
-While the 'projectCreator' and 'applicationCreator' scripts are useful for
-setting up projects and launch configurations that target a GWT installation,
-they are not intended for GWT developers working against the source code. You
-will want to run not against .jar files, but against the class files built by
-Eclipse. The following instructions help you do just that.
+While the 'applicationCreator' script is useful for setting up projects and
+launch configurations that target a GWT installation, it is not intended for
+GWT developers working against the source code. You will want to run not
+against .jar files, but against the class files built by Eclipse. The
+following instructions help you do just that.
1) Import the 'Hello' project if you haven't already.
@@ -211,10 +216,9 @@
1) Create or Import a new project
- Using the 'projectCreator' and 'applicationCreator' scripts is
- an easy way to do this, but you cannot use the created launch
- scripts to develop the GWT core source because they are
- configured to run with .jar files from a GWT installation.
+ Using the 'applicationCreator' script is an easy way to do this, but you
+ cannot use the created launch scripts to develop the GWT core source because
+ they are configured to run with .jar files from a GWT installation.
2) Add a project reference to the gwt-user project:
diff --git a/eclipse/reference/code-museum/DefaultMuseum.launch b/eclipse/reference/code-museum/DefaultMuseum.launch
index 063c7eb..11a82895 100644
--- a/eclipse/reference/code-museum/DefaultMuseum.launch
+++ b/eclipse/reference/code-museum/DefaultMuseum.launch
@@ -20,5 +20,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTShell"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out www com.google.gwt.museum.DefaultMuseum/DefaultMuseum.html"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="code-museum"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.devjar="/usr/local/google/jlabanca/gwt_all/gwt15/releases/1.5/build/staging/gwt-linux-0.0.0/gwt-user.jar""/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.devjar=${gwt_devjar}""/>
</launchConfiguration>
diff --git a/eclipse/samples/DynaTable2/.classpath b/eclipse/samples/DynaTable2/.classpath
index 447a770..85b7671 100644
--- a/eclipse/samples/DynaTable2/.classpath
+++ b/eclipse/samples/DynaTable2/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="core/src"/>
+ <classpathentry kind="src" output="war" path="core/src.war"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/gwt-user"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
diff --git a/eclipse/samples/DynaTable2/.project b/eclipse/samples/DynaTable2/.project
index 5ece582..e8b7c7e 100644
--- a/eclipse/samples/DynaTable2/.project
+++ b/eclipse/samples/DynaTable2/.project
@@ -24,7 +24,7 @@
<link>
<name>core</name>
<type>2</type>
- <locationURI>GWT_ROOT/samples/dynatable</locationURI>
+ <locationURI>GWT_ROOT/samples/dynatable2</locationURI>
</link>
</linkedResources>
</projectDescription>
diff --git a/eclipse/samples/DynaTable2/DynaTable2 compile.launch b/eclipse/samples/DynaTable2/DynaTable2 compile.launch
index ff78aaf..7313ae5 100644
--- a/eclipse/samples/DynaTable2/DynaTable2 compile.launch
+++ b/eclipse/samples/DynaTable2/DynaTable2 compile.launch
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/DynaTable2"/>
+<listEntry value="/gwt-dev-windows/core/src/com/google/gwt/dev/Compiler.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
+<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
@@ -16,8 +16,8 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="DynaTable2"/> </runtimeClasspathEntry> "/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTCompiler"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out war -style PRETTY -logLevel INFO -extra extra com.google.gwt.sample.dynatable.DynaTable2"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.Compiler"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-style PRETTY com.google.gwt.sample.dynatable2.DynaTable2"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DynaTable2"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Dgwt.devjar=C:\gwt\releases\1.6\build\staging\gwt-windows-0.0.0\gwt-dev-windows.jar"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
</launchConfiguration>
diff --git a/eclipse/samples/DynaTable2/DynaTable2 hosted.launch b/eclipse/samples/DynaTable2/DynaTable2 hosted.launch
index e25b728..4231f27 100644
--- a/eclipse/samples/DynaTable2/DynaTable2 hosted.launch
+++ b/eclipse/samples/DynaTable2/DynaTable2 hosted.launch
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/DynaTable2"/>
+<listEntry value="/gwt-dev-windows/core/src/com/google/gwt/dev/HostedMode.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
+<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
@@ -16,8 +16,8 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="DynaTable2"/> </runtimeClasspathEntry> "/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTHosted"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out war -style PRETTY -logLevel INFO -extra extra -startupUrl DynaTable2.html com.google.gwt.sample.dynatable.DynaTable2"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.HostedMode"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-style PRETTY -startupUrl DynaTable2.html com.google.gwt.sample.dynatable2.DynaTable2"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DynaTable2"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Dgwt.devjar=C:\gwt\releases\1.6\build\staging\gwt-windows-0.0.0\gwt-dev-windows.jar"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
</launchConfiguration>
diff --git a/jni/linux/ExternalWrapper.cpp b/jni/linux/ExternalWrapper.cpp
index 990fc99..3b2854e 100644
--- a/jni/linux/ExternalWrapper.cpp
+++ b/jni/linux/ExternalWrapper.cpp
@@ -50,8 +50,8 @@
tracer.log("context=%08x", unsigned(cx));
JsRootedValue::ContextManager context(cx);
JsRootedValue::ensureRuntime(cx);
- if (argc < 2) {
- tracer.setFail("less than 2 args");
+ if (argc < 3) {
+ tracer.setFail("less than 3 args");
return JS_FALSE;
}
@@ -69,7 +69,7 @@
}
JSString* version = 0;
- if (argc > 2 && argv[2] != JSVAL_NULL && argv[2] != JSVAL_VOID) {
+ if (argv[2] != JSVAL_NULL && argv[2] != JSVAL_VOID) {
version = JS_ValueToString(cx, argv[2]);
}
@@ -137,6 +137,64 @@
return JS_TRUE;
}
+/*
+ * definition of JavaScript initModule method which maps to the Java
+ * initModule method.
+ */
+static JSBool initModule(JSContext *cx, JSObject *obj, uintN argc,
+ jsval *argv, jsval *rval)
+{
+ Tracer tracer("initModule");
+ tracer.log("context=%08x", unsigned(cx));
+ JsRootedValue::ContextManager context(cx);
+ JsRootedValue::ensureRuntime(cx);
+ if (argc < 1) {
+ tracer.setFail("less than 1 args");
+ return JS_FALSE;
+ }
+
+ JSString* moduleName = 0;
+ if (argv[0] != JSVAL_NULL && argv[0] != JSVAL_VOID) {
+ moduleName = JS_ValueToString(cx, argv[0]);
+ }
+
+ jstring jModuleName(0);
+ if (moduleName) {
+ jModuleName = savedJNIEnv->NewString(JS_GetStringChars(moduleName),
+ JS_GetStringLength(moduleName));
+ if (!jModuleName || savedJNIEnv->ExceptionCheck()) {
+ tracer.setFail("can't get module name in Java string");
+ return JS_FALSE;
+ }
+ tracer.log("module name=%s", JS_GetStringBytes(moduleName));
+ } else {
+ tracer.log("null module name");
+ }
+
+ jobject externalObject = NS_REINTERPRET_CAST(jobject, JS_GetPrivate(cx, obj));
+ jclass objClass = savedJNIEnv->GetObjectClass(externalObject);
+ if (!objClass || savedJNIEnv->ExceptionCheck()) {
+ tracer.setFail("can't get LowLevelMoz.ExternalObject class");
+ return JS_FALSE;
+ }
+
+ jmethodID methodID = savedJNIEnv->GetMethodID(objClass, "initModule",
+ "(Ljava/lang/String;)Z");
+ if (!methodID || savedJNIEnv->ExceptionCheck()) {
+ tracer.setFail("can't get initModule method");
+ return JS_FALSE;
+ }
+
+ jboolean result = savedJNIEnv->CallBooleanMethod(externalObject, methodID,
+ jModuleName);
+ if (savedJNIEnv->ExceptionCheck()) {
+ tracer.setFail("LowLevelMoz.ExternalObject.initModule() threw an exception");
+ return JS_FALSE;
+ }
+ *rval = BOOLEAN_TO_JSVAL((result == JNI_FALSE) ? JS_FALSE : JS_TRUE);
+ return JS_TRUE;
+}
+
/*=======================================================================*/
/* Implementation of the getProperty, setProperty, and finalize methods */
/* for the JavaScript class gwt_external_class. */
@@ -299,6 +357,11 @@
tracer.setFail("can't define gwtOnLoad function on JavaScript object");
return NS_ERROR_UNEXPECTED;
}
+ if (!JS_DefineFunction(cx, newObj, "initModule", initModule, 1,
+ JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)) {
+ tracer.setFail("can't define initModule function on JavaScript object");
+ return NS_ERROR_UNEXPECTED;
+ }
jsWindowExternalObject = newObj;
}
diff --git a/jni/linux/prebuilt/libgwt-ll.so b/jni/linux/prebuilt/libgwt-ll.so
index ac1f72f..97ead651 100755
--- a/jni/linux/prebuilt/libgwt-ll.so
+++ b/jni/linux/prebuilt/libgwt-ll.so
Binary files differ
diff --git a/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml
index dc1f1f3..5de3c03 100644
--- a/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml
+++ b/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml
@@ -2,11 +2,16 @@
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
+ <inherits name='com.google.gwt.museum.Museum'/>
<inherits name="com.google.gwt.user.theme.standard.StandardResources"/>
+ <inherits name="com.google.gwt.user.theme.chrome.ChromeResources"/>
+ <inherits name="com.google.gwt.user.theme.dark.DarkResources"/>
<!-- Specify the app entry point class. -->
- <entry-point class='com.google.gwt.museum.client.defaultmuseum.Issue2703'/>
+ <entry-point class='com.google.gwt.museum.client.defaultmuseum.VisualsForDateBox'/>
<source path="client/common"/>
- <source path="client/defaultmuseum" includes="Issue2703.java"/>
+ <source path="client/defaultmuseum"/>
<source path="client/viewer"/>
+
+ <extend-property name="locale" values="ar"/>
</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
index 58745c5..b49d292 100644
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
@@ -37,6 +37,7 @@
addIssue(new Issue2261());
addIssue(new Issue2290());
addIssue(new Issue2307());
+ addIssue(new Issue2318());
addIssue(new Issue2321());
addIssue(new Issue2331());
addIssue(new Issue2338());
@@ -47,9 +48,12 @@
addIssue(new Issue2443());
addIssue(new Issue2553());
addIssue(new Issue2855());
+ addIssue(new Issue3172());
}
public void addVisuals() {
+ addIssue(new VisualsForDateBox());
+ addIssue(new VisualsForDatePicker());
addIssue(new VisualsForDisclosurePanelEvents());
addIssue(new VisualsForEventsFiring());
addIssue(new VisualsForPopupEvents());
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java
new file mode 100644
index 0000000..9b6a3ff
--- /dev/null
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.museum.client.defaultmuseum;
+
+import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.user.client.ui.NamedFrame;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Warning message in IE6 when using NamedFrame on SSL-secured web-site.
+ */
+public class Issue2318 extends AbstractIssue {
+ @Override
+ public Widget createIssue() {
+ return new NamedFrame("myFrame");
+ }
+
+ @Override
+ public String getInstructions() {
+ return "Open this page in IE6 on an SSL-secured server (https). Verify "
+ + "that you do not see a mixed-content warning.";
+ }
+
+ @Override
+ public String getSummary() {
+ return "Warning message in IE6 when using NamedFrame on SSL-secured site";
+ }
+
+ @Override
+ public boolean hasCSS() {
+ return false;
+ }
+}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java
new file mode 100644
index 0000000..7d9a974
--- /dev/null
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.museum.client.defaultmuseum;
+
+import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.MenuBar;
+import com.google.gwt.user.client.ui.MenuItem;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Verify that IE returns the correct value for getAbsoluteLeft() when zoomed
+ * in. The absolute left coordinate should NOT depend on the zoom. That is, an
+ * elements absoluteLeft position should be the same regardless of zoom (IE
+ * automatically multiplies it by the zoom).
+ */
+public class Issue3172 extends AbstractIssue {
+
+ @Override
+ public Widget createIssue() {
+ // Create a command that will execute on menu item selection
+ Command emptyCommand = new Command() {
+ public void execute() {
+ }
+ };
+
+ // Create a menu bar
+ MenuBar menu = new MenuBar();
+ menu.setWidth("500px");
+ menu.setAutoOpen(true);
+
+ // Create a sub menu of recent documents
+ MenuBar recentDocsMenu = new MenuBar(true);
+ recentDocsMenu.addItem("Document 0", emptyCommand);
+ recentDocsMenu.addItem("Document 1", emptyCommand);
+ recentDocsMenu.addItem("Document 2", emptyCommand);
+
+ // Create the file menu
+ MenuBar fileMenu = new MenuBar(true);
+ menu.addItem(new MenuItem("File", fileMenu));
+ fileMenu.addItem("New", emptyCommand);
+ fileMenu.addItem("Print", emptyCommand);
+ fileMenu.addItem("Recent Docs", recentDocsMenu);
+
+ // Create the edit menu
+ MenuBar editMenu = new MenuBar(true);
+ menu.addItem(new MenuItem("Edit", editMenu));
+ editMenu.addItem("Cut", emptyCommand);
+ editMenu.addItem("Copy", emptyCommand);
+ editMenu.addItem("Paste", emptyCommand);
+
+ // Create the help menu
+ MenuBar helpMenu = new MenuBar(true);
+ menu.addItem(new MenuItem("Help", helpMenu));
+ helpMenu.addItem("Settings", emptyCommand);
+ helpMenu.addItem("About", emptyCommand);
+
+ return menu;
+ }
+
+ @Override
+ public String getInstructions() {
+ return "In IE, press Ctrl++ to zoom in, then verify that the sub menus open"
+ + " in the correct locations.";
+ }
+
+ @Override
+ public String getSummary() {
+ return "getAbsoluteLeft() with zoom in IE";
+ }
+
+ @Override
+ public boolean hasCSS() {
+ return false;
+ }
+}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java
new file mode 100644
index 0000000..132d0f8
--- /dev/null
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.museum.client.defaultmuseum;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.KeyDownEvent;
+import com.google.gwt.event.dom.client.KeyDownHandler;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.datepicker.client.DateBox;
+import com.google.gwt.user.datepicker.client.DatePicker;
+import com.google.gwt.user.datepicker.client.DateBox.DefaultFormat;
+
+import java.util.Date;
+
+/**
+ * Visuals for date box.
+ */
+public class VisualsForDateBox extends AbstractIssue {
+ class FormatWithNewYearsEve extends DefaultFormat {
+ public FormatWithNewYearsEve() {
+ }
+
+ public FormatWithNewYearsEve(DateTimeFormat format) {
+ super(format);
+ }
+
+ @Override
+ public String format(DateBox box, Date d) {
+ if (d == null) {
+ return "Please Change me";
+ } else {
+ return super.format(box, d);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public Date parse(DateBox box, String input, boolean reportError) {
+ if (input.equalsIgnoreCase("new year's eve")) {
+ Date d = new Date();
+ d.setDate(31);
+ d.setMonth(12);
+ return d;
+ } else {
+ return super.parse(box, input, reportError);
+ }
+ }
+ }
+
+ @Override
+ public Widget createIssue() {
+ VerticalPanel v = new VerticalPanel();
+ v.add(new HTML("<div style='height:25px'></div>"));
+ v.add(dateRange());
+ v.add(new HTML("<div style='height:25px'></div>"));
+ return v;
+ }
+
+ @Override
+ public String getInstructions() {
+ return "Instructions <ul><li>Click on first date box, see that date picker is displayed</li> "
+ + "<li>use arrow keys to navigate to second date box, select a date.</li> "
+ + "<li>type in a bad date then click back to the first date box. Your bad date should now be in red</li>"
+ + "<li>get back to the second box, now type in a valid date and tab away, its text should now be black again. </li>"
+ + "<li>Try typing 'New Year's Eve' in on the start datebox)</li>"
+ + "<li> Hit 'Show values' and confirm that you see the correct values</li></ul>";
+ }
+
+ @Override
+ public String getSummary() {
+ return "date box visual test";
+ }
+
+ @Override
+ public boolean hasCSS() {
+ return false;
+ }
+
+ private Widget dateRange() {
+ VerticalPanel v = new VerticalPanel();
+ HorizontalPanel p = new HorizontalPanel();
+ v.add(p);
+ final DateBox start = new DateBox(new DatePicker(), null,
+ new FormatWithNewYearsEve());
+
+ start.setWidth("13em");
+ final DateBox end = new DateBox();
+ end.setWidth("13em");
+
+ end.getDatePicker().addValueChangeHandler(new ValueChangeHandler<Date>() {
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ start.removeStyleName("user-modified");
+ }
+ });
+
+ final TextBox startText = start.getTextBox();
+ startText.addKeyDownHandler(new KeyDownHandler() {
+ public void onKeyDown(KeyDownEvent e) {
+ if (e.isRightArrow()
+ && start.getCursorPos() == startText.getText().length()) {
+ start.hideDatePicker();
+ end.setFocus(true);
+ }
+ }
+ });
+
+ end.getTextBox().addKeyDownHandler(new KeyDownHandler() {
+ public void onKeyDown(KeyDownEvent e) {
+ if ((e.isLeftArrow()) && end.getCursorPos() == 0) {
+ end.hideDatePicker();
+ start.setFocus(true);
+ }
+ }
+ });
+
+ end.setValue(new Date());
+ p.add(start);
+ Label l = new Label(" - ");
+ l.setStyleName("filler");
+ p.add(l);
+ p.add(end);
+ final Label value = new Label();
+ p.add(value);
+ HorizontalPanel h2 = new HorizontalPanel();
+ v.add(h2);
+ h2.add(new Button("Short format", new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ updateFormat(start, end, DateTimeFormat.getShortDateFormat());
+ }
+ }));
+ h2.add(new Button("Long format", new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ updateFormat(start, end, DateTimeFormat.getMediumDateFormat());
+ }
+ }));
+
+ h2.add(new Button("Clear", new ClickHandler() {
+ public void onClick(ClickEvent sender) {
+ start.setValue(null);
+ end.setValue(null);
+ }
+ }));
+
+ h2.add(new Button("Show Values", new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ DateTimeFormat f = DateTimeFormat.getShortDateFormat();
+ Date d1 = start.getValue();
+ Date d2 = end.getValue();
+ value.setText("Start: \"" + (d1 == null ? "null" : f.format(d1))
+ + "\" End: \"" + (d2 == null ? "null" : f.format(d2)) + "\"");
+ }
+ }));
+ return v;
+ }
+
+ private void updateFormat(DateBox start, DateBox end, DateTimeFormat format) {
+ // You can replace the format itself.
+ start.setFormat(new FormatWithNewYearsEve(format));
+ end.setFormat(new DefaultFormat(format));
+ }
+}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java
new file mode 100644
index 0000000..14386b3
--- /dev/null
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.museum.client.defaultmuseum;
+
+import com.google.gwt.event.logical.shared.HighlightEvent;
+import com.google.gwt.event.logical.shared.HighlightHandler;
+import com.google.gwt.event.logical.shared.ShowRangeEvent;
+import com.google.gwt.event.logical.shared.ShowRangeHandler;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.datepicker.client.DatePicker;
+
+import java.util.Date;
+
+/**
+ * Date picker demo.
+ */
+public class VisualsForDatePicker extends AbstractIssue {
+
+ @Override
+ public Widget createIssue() {
+ VerticalPanel p = new VerticalPanel();
+ final DatePicker picker = new DatePicker();
+ p.add(picker);
+ final Label value = new Label("value: ");
+ p.add(value);
+ final Label highlight = new Label("highlight: ");
+ p.add(highlight);
+ final Label range = new Label("range: ");
+ p.add(range);
+ picker.addValueChangeHandler(new ValueChangeHandler<Date>() {
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ value.setText("value: "
+ + DateTimeFormat.getShortDateFormat().format(event.getValue()));
+ }
+ });
+ picker.addHighlightHandler(new HighlightHandler<Date>() {
+
+ @SuppressWarnings("deprecation")
+ // Should never be seen, as highlight should be cloned.
+ public void onHighlight(HighlightEvent<Date> event) {
+ event.getHighlighted().setYear(1);
+ picker.getHighlightedDate().setYear(1);
+ }
+
+ });
+ picker.addHighlightHandler(new HighlightHandler<Date>() {
+ public void onHighlight(HighlightEvent<Date> event) {
+ highlight.setText("highlight: "
+ + DateTimeFormat.getShortDateFormat().format(event.getHighlighted()));
+ }
+ });
+ picker.addShowRangeHandler(new ShowRangeHandler<Date>() {
+ public void onShowRange(ShowRangeEvent<Date> event) {
+ Date start = event.getStart();
+ Date end = event.getEnd();
+ DateTimeFormat format = DateTimeFormat.getShortDateFormat();
+ range.setText("range: " + format.format(start) + " - "
+ + format.format(end));
+ }
+ });
+ return p;
+ };
+
+ @Override
+ public String getInstructions() {
+ return "Go back one month, go forward one month, check that highlighting is working, and try selecting a date.";
+ }
+
+ @Override
+ public String getSummary() {
+ return "Visual test for date picker";
+ }
+
+ @Override
+ public boolean hasCSS() {
+ return false;
+ }
+
+}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java
index fde6b1b..aadc408 100644
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java
+++ b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java
@@ -17,6 +17,8 @@
package com.google.gwt.museum.client.defaultmuseum;
import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.VerticalPanel;
@@ -36,11 +38,16 @@
TreeItem bba = new TreeItem("b.b.a");
TreeItem bc = new TreeItem("b.c");
TreeItem c = new TreeItem("c");
+ TreeItem d = new TreeItem(new RadioButton("myradio",
+ "I should line up nicely"));
+ TreeItem e = new TreeItem(new CheckBox("I should line up nicely"));
t.setSelectedItem(b);
t.addItem(a);
t.addItem(b);
t.addItem(c);
+ t.addItem(d);
+ t.addItem(e);
b.addItem(ba);
b.addItem(bb);
bb.addItem(bba);
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/DefaultMuseum.html b/reference/code-museum/src/com/google/gwt/museum/public/DefaultMuseum.html
index a4ffbdc..210131c 100644
--- a/reference/code-museum/src/com/google/gwt/museum/public/DefaultMuseum.html
+++ b/reference/code-museum/src/com/google/gwt/museum/public/DefaultMuseum.html
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Museum</title>
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/Museum.html b/reference/code-museum/src/com/google/gwt/museum/public/Museum.html
index 6e53528..fa19fea 100644
--- a/reference/code-museum/src/com/google/gwt/museum/public/Museum.html
+++ b/reference/code-museum/src/com/google/gwt/museum/public/Museum.html
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Museum</title>
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/SingleIssue.html b/reference/code-museum/src/com/google/gwt/museum/public/SingleIssue.html
index 8acd8e6..ae5679b 100644
--- a/reference/code-museum/src/com/google/gwt/museum/public/SingleIssue.html
+++ b/reference/code-museum/src/com/google/gwt/museum/public/SingleIssue.html
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Single issue from Museum</title>
diff --git a/samples/dynatable2/build.xml b/samples/dynatable2/build.xml
new file mode 100644
index 0000000..00c96d6
--- /dev/null
+++ b/samples/dynatable2/build.xml
@@ -0,0 +1,5 @@
+<project name="dynatable" default="build" basedir=".">
+ <property name="sample.root" value="dynatable" />
+ <property name="sample.module" value="DynaTable" />
+ <import file="../common.ant.xml" />
+</project>
diff --git a/samples/dynatable2/src.war/DynaTable2.css b/samples/dynatable2/src.war/DynaTable2.css
new file mode 100644
index 0000000..ab81abf
--- /dev/null
+++ b/samples/dynatable2/src.war/DynaTable2.css
@@ -0,0 +1,85 @@
+
+body {
+ background-color: white;
+ color: black;
+ font-family: Arial, sans-serif;
+ font-size: small;
+ margin: 8px;
+ margin-top: 3px;
+}
+
+.DynaTable-DynaTableWidget {
+ width: 100%;
+ border: 1px solid #ACA899;
+}
+
+
+.DynaTable-DynaTableWidget .navbar {
+ width: 100%;
+ background-color: #ECE9D8;
+ vertical-align: middle;
+ border-bottom: 1px solid #ACA899;
+}
+
+.DynaTable-DynaTableWidget .navbar button {
+ width: 3em;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.DynaTable-DynaTableWidget .navbar .status {
+ vertical-align: middle;
+ padding-right: 10px;
+}
+
+.DynaTable-DynaTableWidget .table {
+ margin: 10px;
+}
+
+.DynaTable-DynaTableWidget .table td.header {
+ text-align: left;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+.DynaTable-DynaTableWidget .table td.name {
+ width: 10em;
+}
+
+.DynaTable-DynaTableWidget .table td.desc {
+ width: 20em;
+}
+
+.DynaTable-DynaTableWidget .table td.sched {
+ width: 20em;
+}
+
+.DynaTable-DynaTableWidget .table td {
+ vertical-align: top;
+}
+
+.DynaTable-DayFilterWidget {
+ margin: 3em 1em 1em 0;
+ width: 10em;
+ padding: 0px 8px 0px 8px;
+ border: 1px solid #ACA899;
+}
+
+.DynaTable-DayFilterWidget button {
+ width: 4em;
+ margin: 8px 4px 8px 4px;
+}
+
+.DynaTable-ErrorDialog {
+ border: 2px outset;
+ background-color: white;
+ width: 50%;
+}
+
+.DynaTable-ErrorDialog .Caption {
+ background-color: #C3D9FF;
+ padding: 3px;
+ margin: 2px;
+ font-weight: bold;
+ cursor: default;
+}
diff --git a/samples/dynatable2/src.war/DynaTable2.html b/samples/dynatable2/src.war/DynaTable2.html
new file mode 100644
index 0000000..d4b8b2e
--- /dev/null
+++ b/samples/dynatable2/src.war/DynaTable2.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <link type="text/css" rel="stylesheet" href="DynaTable2.css">
+ <title></title>
+ </head>
+ <body>
+ <iframe src="javascript:''" id='__gwt_historyFrame' tabIndex='-1' style='width:0;height:0;border:0'></iframe>
+ <script type="text/javascript" language='javascript' src='dynatable2/dynatable2.nocache.js'></script>
+ <h1>School Schedule for Professors and Students</h1>
+ <table width="100%" border="0" summary="School Schedule for Professors and Students">
+ <tr valign="top">
+ <td id="calendar" align="center" width="90%">
+ </td>
+ <td id="days" align="center" width="10%">
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/samples/dynatable2/src.war/WEB-INF/classes/marker b/samples/dynatable2/src.war/WEB-INF/classes/marker
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/samples/dynatable2/src.war/WEB-INF/classes/marker
diff --git a/samples/dynatable2/src.war/WEB-INF/web.xml b/samples/dynatable2/src.war/WEB-INF/web.xml
new file mode 100644
index 0000000..1feeb14
--- /dev/null
+++ b/samples/dynatable2/src.war/WEB-INF/web.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app>
+
+ <servlet>
+ <servlet-name>calendar</servlet-name>
+ <servlet-class>
+ com.google.gwt.sample.dynatable2.server.SchoolCalendarServiceImpl
+ </servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>calendar</servlet-name>
+ <url-pattern>/dynatable2/calendar</url-pattern>
+ </servlet-mapping>
+
+</web-app>
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/COPYING b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/COPYING
new file mode 100644
index 0000000..d9a10c0
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/COPYING
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2.gwt.xml b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2.gwt.xml
new file mode 100644
index 0000000..7781947
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2.gwt.xml
@@ -0,0 +1,19 @@
+<!-- -->
+<!-- Copyright 2007 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<module rename-to="dynatable2">
+ <inherits name='com.google.gwt.user.User'/>
+ <entry-point class='com.google.gwt.sample.dynatable2.client.DynaTable'/>
+ <servlet path='/calendar' class='com.google.gwt.sample.dynatable2.server.SchoolCalendarServiceImpl'/>
+</module>
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2Legacy.gwt.xml b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2Legacy.gwt.xml
new file mode 100644
index 0000000..85f806e
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/DynaTable2Legacy.gwt.xml
@@ -0,0 +1,20 @@
+<!-- -->
+<!-- Copyright 2007 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<module>
+ <inherits name='com.google.gwt.user.User'/>
+ <entry-point class='com.google.gwt.sample.dynatable2.client.DynaTable'/>
+ <servlet path='/calendar' class='com.google.gwt.sample.dynatable2.server.SchoolCalendarServiceImpl'/>
+ <public path='legacyPublic'/>
+</module>
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DayFilterWidget.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DayFilterWidget.java
new file mode 100644
index 0000000..7be4cd8
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DayFilterWidget.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * A UI Widget that allows a user to filter the days being displayed in the
+ * dynamic table.
+ */
+public class DayFilterWidget extends Composite {
+
+ private class DayCheckBox extends CheckBox {
+ public final int day;
+
+ public DayCheckBox(String caption, int day) {
+ super(caption);
+
+ // Remember custom data for this widget.
+ this.day = day;
+
+ // Use a shared handler to save memory.
+ addClickHandler(dayCheckBoxHandler);
+
+ // Initialize based on the calendar's current value.
+ setChecked(calendar.getDayIncluded(day));
+ }
+ }
+
+ private class DayCheckBoxHandler implements ClickHandler {
+ public void onClick(ClickEvent event) {
+ onClick((DayCheckBox) event.getSource());
+ }
+
+ public void onClick(DayCheckBox dayCheckBox) {
+ calendar.setDayIncluded(dayCheckBox.day, dayCheckBox.isChecked());
+ }
+ }
+
+ private final SchoolCalendarWidget calendar;
+
+ private final VerticalPanel outer = new VerticalPanel();
+
+ private final DayCheckBoxHandler dayCheckBoxHandler = new DayCheckBoxHandler();
+
+ public DayFilterWidget(SchoolCalendarWidget calendar) {
+ this.calendar = calendar;
+ initWidget(outer);
+ setStyleName("DynaTable-DayFilterWidget");
+ outer.add(new DayCheckBox("Sunday", 0));
+ outer.add(new DayCheckBox("Monday", 1));
+ outer.add(new DayCheckBox("Tuesday", 2));
+ outer.add(new DayCheckBox("Wednesday", 3));
+ outer.add(new DayCheckBox("Thursday", 4));
+ outer.add(new DayCheckBox("Friday", 5));
+ outer.add(new DayCheckBox("Saturday", 6));
+
+ Button buttonAll = new Button("All", new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ setAllCheckBoxes(true);
+ }
+ });
+
+ Button buttonNone = new Button("None", new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ setAllCheckBoxes(false);
+ }
+ });
+
+ HorizontalPanel hp = new HorizontalPanel();
+ hp.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
+ hp.add(buttonAll);
+ hp.add(buttonNone);
+
+ outer.add(hp);
+ outer.setCellVerticalAlignment(hp, HasAlignment.ALIGN_BOTTOM);
+ outer.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_CENTER);
+ }
+
+ private void setAllCheckBoxes(boolean checked) {
+ for (int i = 0, n = outer.getWidgetCount(); i < n; ++i) {
+ Widget w = outer.getWidget(i);
+ if (w instanceof DayCheckBox) {
+ ((DayCheckBox) w).setChecked(checked);
+ dayCheckBoxHandler.onClick((DayCheckBox) w);
+ }
+ }
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTable.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTable.java
new file mode 100644
index 0000000..41e208b
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTable.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+
+/**
+ * The entry point class which performs the initial loading of the DynaTable
+ * application.
+ */
+public class DynaTable implements EntryPoint {
+
+ public void onModuleLoad() {
+ // Find the slot for the calendar widget.
+ //
+ RootPanel slot = RootPanel.get("calendar");
+ if (slot != null) {
+ SchoolCalendarWidget calendar = new SchoolCalendarWidget(15);
+ slot.add(calendar);
+
+ // Find the slot for the days filter widget.
+ //
+ slot = RootPanel.get("days");
+ if (slot != null) {
+ DayFilterWidget filter = new DayFilterWidget(calendar);
+ slot.add(filter);
+ }
+ }
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableDataProvider.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableDataProvider.java
new file mode 100644
index 0000000..6875d63
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableDataProvider.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+/**
+ * An interface for providing row-level updates of data, intended here to used
+ * to update a DynaTableWidget.
+ */
+public interface DynaTableDataProvider {
+
+ /**
+ * An interface allow a widget to accept or report failure when a row data
+ * is issued for update.
+ */
+ interface RowDataAcceptor {
+ void accept(int startRow, String[][] rows);
+ void failed(Throwable caught);
+ }
+
+ void updateRowData(int startRow, int maxRows, RowDataAcceptor acceptor);
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableWidget.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableWidget.java
new file mode 100644
index 0000000..fb96245
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/DynaTableWidget.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.sample.dynatable2.client.DynaTableDataProvider.RowDataAcceptor;
+import com.google.gwt.user.client.rpc.InvocationException;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.DockPanel;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+/**
+ * A composite Widget that implements the main interface for the dynamic table,
+ * including the data table, status indicators, and paging buttons.
+ */
+public class DynaTableWidget extends Composite {
+
+ /**
+ * A dialog box for displaying an error.
+ */
+ private static class ErrorDialog extends DialogBox implements ClickHandler {
+ private HTML body = new HTML("");
+
+ public ErrorDialog() {
+ setStylePrimaryName("DynaTable-ErrorDialog");
+ Button closeButton = new Button("Close", this);
+ VerticalPanel panel = new VerticalPanel();
+ panel.setSpacing(4);
+ panel.add(body);
+ panel.add(closeButton);
+ panel.setCellHorizontalAlignment(closeButton, VerticalPanel.ALIGN_RIGHT);
+ setWidget(panel);
+ }
+
+ public String getBody() {
+ return body.getHTML();
+ }
+
+ public void onClick(ClickEvent event) {
+ hide();
+ }
+
+ public void setBody(String html) {
+ body.setHTML(html);
+ }
+ }
+
+ private class NavBar extends Composite implements ClickHandler {
+
+ public final DockPanel bar = new DockPanel();
+ public final Button gotoFirst = new Button("<<", this);
+ public final Button gotoNext = new Button(">", this);
+ public final Button gotoPrev = new Button("<", this);
+ public final HTML status = new HTML();
+
+ public NavBar() {
+ initWidget(bar);
+ bar.setStyleName("navbar");
+ status.setStyleName("status");
+
+ HorizontalPanel buttons = new HorizontalPanel();
+ buttons.add(gotoFirst);
+ buttons.add(gotoPrev);
+ buttons.add(gotoNext);
+ bar.add(buttons, DockPanel.EAST);
+ bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT);
+ bar.add(status, DockPanel.CENTER);
+ bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
+ bar.setCellHorizontalAlignment(status, HasAlignment.ALIGN_RIGHT);
+ bar.setCellVerticalAlignment(status, HasAlignment.ALIGN_MIDDLE);
+ bar.setCellWidth(status, "100%");
+
+ // Initialize prev & first button to disabled.
+ //
+ gotoPrev.setEnabled(false);
+ gotoFirst.setEnabled(false);
+ }
+
+ public void onClick(ClickEvent event) {
+ Object source = event.getSource();
+ if (source == gotoNext) {
+ startRow += getDataRowCount();
+ refresh();
+ } else if (source == gotoPrev) {
+ startRow -= getDataRowCount();
+ if (startRow < 0) {
+ startRow = 0;
+ }
+ refresh();
+ } else if (source == gotoFirst) {
+ startRow = 0;
+ refresh();
+ }
+ }
+ }
+
+ private class RowDataAcceptorImpl implements RowDataAcceptor {
+ public void accept(int startRow, String[][] data) {
+
+ int destRowCount = getDataRowCount();
+ int destColCount = grid.getCellCount(0);
+ assert (data.length <= destRowCount) : "Too many rows";
+
+ int srcRowIndex = 0;
+ int srcRowCount = data.length;
+ int destRowIndex = 1; // skip navbar row
+ for (; srcRowIndex < srcRowCount; ++srcRowIndex, ++destRowIndex) {
+ String[] srcRowData = data[srcRowIndex];
+ assert (srcRowData.length == destColCount) : " Column count mismatch";
+ for (int srcColIndex = 0; srcColIndex < destColCount; ++srcColIndex) {
+ String cellHTML = srcRowData[srcColIndex];
+ grid.setText(destRowIndex, srcColIndex, cellHTML);
+ }
+ }
+
+ // Clear remaining table rows.
+ //
+ boolean isLastPage = false;
+ for (; destRowIndex < destRowCount + 1; ++destRowIndex) {
+ isLastPage = true;
+ for (int destColIndex = 0; destColIndex < destColCount; ++destColIndex) {
+ grid.clearCell(destRowIndex, destColIndex);
+ }
+ }
+
+ // Synchronize the nav buttons.
+ navbar.gotoNext.setEnabled(!isLastPage);
+ navbar.gotoFirst.setEnabled(startRow > 0);
+ navbar.gotoPrev.setEnabled(startRow > 0);
+
+ // Update the status message.
+ //
+ setStatusText((startRow + 1) + " - " + (startRow + srcRowCount));
+ }
+
+ public void failed(Throwable caught) {
+ setStatusText("Error");
+ if (errorDialog == null) {
+ errorDialog = new ErrorDialog();
+ }
+ if (caught instanceof InvocationException) {
+ errorDialog.setText("An RPC server could not be reached");
+ errorDialog.setBody(NO_CONNECTION_MESSAGE);
+ } else {
+ errorDialog.setText("Unexcepted Error processing remote call");
+ errorDialog.setBody(caught.getMessage());
+ }
+ errorDialog.center();
+ }
+ }
+
+ private static final String NO_CONNECTION_MESSAGE = "<p>The DynaTable example uses a <a href=\"http://code.google.com/"
+ + "webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide."
+ + "RemoteProcedureCalls.html\" target=\"_blank\">Remote Procedure Call</a> "
+ + "(RPC) to request data from the server. In order for the RPC to "
+ + "successfully return data, the server component must be available.</p>"
+ + "<p>If you are running this demo from compiled code, the server "
+ + "component may not be available to respond to the RPC requests from "
+ + "DynaTable. Try running DynaTable in hosted mode to see the demo "
+ + "in action.</p> "
+ + "<p>Click on the Remote Procedure Call link above for more information "
+ + "on GWT's RPC infrastructure.";
+
+ private final RowDataAcceptor acceptor = new RowDataAcceptorImpl();
+
+ private final Grid grid = new Grid();
+
+ private final NavBar navbar = new NavBar();
+
+ private ErrorDialog errorDialog = null;
+
+ private final DockPanel outer = new DockPanel();
+
+ private final DynaTableDataProvider provider;
+
+ private int startRow = 0;
+
+ public DynaTableWidget(DynaTableDataProvider provider, String[] columns,
+ String[] columnStyles, int rowCount) {
+
+ if (columns.length == 0) {
+ throw new IllegalArgumentException(
+ "expecting a positive number of columns");
+ }
+
+ if (columnStyles != null && columns.length != columnStyles.length) {
+ throw new IllegalArgumentException("expecting as many styles as columns");
+ }
+
+ this.provider = provider;
+ initWidget(outer);
+ grid.setStyleName("table");
+ outer.add(navbar, DockPanel.NORTH);
+ outer.add(grid, DockPanel.CENTER);
+ initTable(columns, columnStyles, rowCount);
+ setStyleName("DynaTable-DynaTableWidget");
+ }
+
+ public void clearStatusText() {
+ navbar.status.setHTML(" ");
+ }
+
+ public void refresh() {
+ // Disable buttons temporarily to stop the user from running off the end.
+ //
+ navbar.gotoFirst.setEnabled(false);
+ navbar.gotoPrev.setEnabled(false);
+ navbar.gotoNext.setEnabled(false);
+
+ setStatusText("Please wait...");
+ provider.updateRowData(startRow, grid.getRowCount() - 1, acceptor);
+ }
+
+ public void setRowCount(int rows) {
+ grid.resizeRows(rows);
+ }
+
+ public void setStatusText(String text) {
+ navbar.status.setText(text);
+ }
+
+ private int getDataRowCount() {
+ return grid.getRowCount() - 1;
+ }
+
+ private void initTable(String[] columns, String[] columnStyles, int rowCount) {
+ // Set up the header row. It's one greater than the number of visible rows.
+ //
+ grid.resize(rowCount + 1, columns.length);
+ for (int i = 0, n = columns.length; i < n; i++) {
+ grid.setText(0, i, columns[i]);
+ if (columnStyles != null) {
+ grid.getCellFormatter().setStyleName(0, i, columnStyles[i] + " header");
+ }
+ }
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Person.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Person.java
new file mode 100644
index 0000000..d73702f
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Person.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * Hold relevant data for Person. This class is meant to be serialized in RPC
+ * calls.
+ */
+public abstract class Person implements IsSerializable {
+
+ private String description = "DESC";
+
+ private String name;
+
+ public Person() {
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public abstract String getSchedule(boolean[] daysFilter);
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Professor.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Professor.java
new file mode 100644
index 0000000..932d188
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Professor.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+/**
+ * Holds relevant data for a Professor type Person. This class is intended to be
+ * serialized in RPC calls.
+ */
+public class Professor extends Person {
+
+ private Schedule teachingSchedule = new Schedule();
+
+ public Professor() {
+ }
+
+ @Override
+ public String getSchedule(boolean[] daysFilter) {
+ return teachingSchedule.getDescription(daysFilter);
+ }
+
+ public Schedule getTeachingSchedule() {
+ return teachingSchedule;
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Schedule.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Schedule.java
new file mode 100644
index 0000000..ac0b40e
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Schedule.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Hold the relevant data for a Schedule. This class is meant to be serialized
+ * in RPC calls.
+ */
+public class Schedule implements IsSerializable {
+
+ private List<TimeSlot> timeSlots = new ArrayList<TimeSlot>();
+
+ public Schedule() {
+ }
+
+ public void addTimeSlot(TimeSlot timeSlot) {
+ timeSlots.add(timeSlot);
+ }
+
+ public String getDescription(boolean[] daysFilter) {
+ String s = null;
+ for (TimeSlot timeSlot : timeSlots) {
+ if (daysFilter[timeSlot.getDayOfWeek()]) {
+ if (s == null) {
+ s = timeSlot.getDescription();
+ } else {
+ s += ", " + timeSlot.getDescription();
+ }
+ }
+ }
+
+ if (s != null) {
+ return s;
+ } else {
+ return "";
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getDescription(null);
+ }
+
+}
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarService.java
similarity index 62%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarService.java
index 906258b..fee68f6 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarService.java
@@ -1,32 +1,28 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.event.shared;
-
-/**
- *
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
- */
-public interface HasHandlerManager {
- /**
- * Gets this widget's handler manager.
- *
- * @return the manager
- */
- HandlerManager getHandlerManager();
-}
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+/**
+ * The interface for the RPC server endpoint to get school calendar
+ * information.
+ */
+public interface SchoolCalendarService extends RemoteService {
+
+ Person[] getPeople(int startIndex, int maxCount);
+
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarServiceAsync.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarServiceAsync.java
new file mode 100644
index 0000000..3aa3757
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarServiceAsync.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * The interface for the RPC server endpoint that provides school calendar
+ * information for clients that will be calling asynchronously.
+ */
+public interface SchoolCalendarServiceAsync {
+
+ void getPeople(int startIndex, int maxCount, AsyncCallback<Person[]> callback);
+
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarWidget.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarWidget.java
new file mode 100644
index 0000000..65e4fd2
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/SchoolCalendarWidget.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.ui.Composite;
+
+/**
+ * A Composite widget that abstracts a DynaTableWidget and a data provider tied
+ * to the <@link SchoolCalendarService> RPC endpoint.
+ */
+public class SchoolCalendarWidget extends Composite {
+
+ /**
+ * A data provider that bridges the provides row level updates from the data
+ * available through a <@link SchoolCalendarService>.
+ */
+ public class CalendarProvider implements DynaTableDataProvider {
+
+ private final SchoolCalendarServiceAsync calService;
+
+ private int lastMaxRows = -1;
+
+ private Person[] lastPeople;
+
+ private int lastStartRow = -1;
+
+ public CalendarProvider() {
+ // Initialize the service.
+ //
+ calService = (SchoolCalendarServiceAsync) GWT.create(SchoolCalendarService.class);
+
+ // By default, we assume we'll make RPCs to a servlet, but see
+ // updateRowData(). There is special support for canned RPC responses.
+ // (Which is a totally demo hack, by the way :-)
+ //
+ ServiceDefTarget target = (ServiceDefTarget) calService;
+
+ // Use a module-relative URLs to ensure that this client code can find
+ // its way home, even when the URL changes (as might happen when you
+ // deploy this as a webapp under an external servlet container).
+ String moduleRelativeURL = GWT.getModuleBaseURL() + "calendar";
+ target.setServiceEntryPoint(moduleRelativeURL);
+ }
+
+ public void updateRowData(final int startRow, final int maxRows,
+ final RowDataAcceptor acceptor) {
+ // Check the simple cache first.
+ //
+ if (startRow == lastStartRow) {
+ if (maxRows == lastMaxRows) {
+ // Use the cached batch.
+ //
+ pushResults(acceptor, startRow, lastPeople);
+ return;
+ }
+ }
+
+ // Fetch the data remotely.
+ //
+ calService.getPeople(startRow, maxRows, new AsyncCallback<Person[]>() {
+ public void onFailure(Throwable caught) {
+ acceptor.failed(caught);
+ }
+
+ public void onSuccess(Person[] result) {
+ lastStartRow = startRow;
+ lastMaxRows = maxRows;
+ lastPeople = result;
+ pushResults(acceptor, startRow, result);
+ }
+
+ });
+ }
+
+ private void pushResults(RowDataAcceptor acceptor, int startRow,
+ Person[] people) {
+ String[][] rows = new String[people.length][];
+ for (int i = 0, n = rows.length; i < n; i++) {
+ Person person = people[i];
+ rows[i] = new String[3];
+ rows[i][0] = person.getName();
+ rows[i][1] = person.getDescription();
+ rows[i][2] = person.getSchedule(daysFilter);
+ }
+ acceptor.accept(startRow, rows);
+ }
+ }
+
+ private final CalendarProvider calProvider = new CalendarProvider();
+
+ private final boolean[] daysFilter = new boolean[] {
+ true, true, true, true, true, true, true};
+
+ private final DynaTableWidget dynaTable;
+
+ private Command pendingRefresh;
+
+ public SchoolCalendarWidget(int visibleRows) {
+ String[] columns = new String[] {"Name", "Description", "Schedule"};
+ String[] styles = new String[] {"name", "desc", "sched"};
+ dynaTable = new DynaTableWidget(calProvider, columns, styles, visibleRows);
+ initWidget(dynaTable);
+ }
+
+ protected boolean getDayIncluded(int day) {
+ return daysFilter[day];
+ }
+
+ @Override
+ protected void onLoad() {
+ dynaTable.refresh();
+ }
+
+ protected void setDayIncluded(int day, boolean included) {
+ if (daysFilter[day] == included) {
+ // No change.
+ //
+ return;
+ }
+
+ daysFilter[day] = included;
+ if (pendingRefresh == null) {
+ pendingRefresh = new Command() {
+ public void execute() {
+ pendingRefresh = null;
+ dynaTable.refresh();
+ }
+ };
+ DeferredCommand.addCommand(pendingRefresh);
+ }
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Student.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Student.java
new file mode 100644
index 0000000..ff8d068
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/Student.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+/**
+ * Holds relevant data for a Student type Person. This class is intended to be
+ * serialized in RPC calls.
+ */
+public class Student extends Person {
+
+ private Schedule classSchedule = new Schedule();
+
+ public Schedule getClassSchedule() {
+ return classSchedule;
+ }
+
+ @Override
+ public String getSchedule(boolean[] daysFilter) {
+ return classSchedule.getDescription(daysFilter);
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/TimeSlot.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/TimeSlot.java
new file mode 100644
index 0000000..1a0f130
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/client/TimeSlot.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.client;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * Hold relevant data for a time slot. This class is intended to be serialized
+ * as part of RPC calls.
+ */
+public class TimeSlot implements IsSerializable, Comparable<TimeSlot> {
+
+ private static final transient String[] DAYS = new String[] {
+ "Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"};
+
+ private int endMinutes;
+
+ private int startMinutes;
+
+ private int zeroBasedDayOfWeek;
+
+ public TimeSlot() {
+ }
+
+ public TimeSlot(int zeroBasedDayOfWeek, int startMinutes, int endMinutes) {
+ this.zeroBasedDayOfWeek = zeroBasedDayOfWeek;
+ this.startMinutes = startMinutes;
+ this.endMinutes = endMinutes;
+ }
+
+ public int compareTo(TimeSlot o) {
+ if (zeroBasedDayOfWeek < o.zeroBasedDayOfWeek) {
+ return -1;
+ } else if (zeroBasedDayOfWeek > o.zeroBasedDayOfWeek) {
+ return 1;
+ } else {
+ if (startMinutes < o.startMinutes) {
+ return -1;
+ } else if (startMinutes > o.startMinutes) {
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ public int getDayOfWeek() {
+ return zeroBasedDayOfWeek;
+ }
+
+ public String getDescription() {
+ return DAYS[zeroBasedDayOfWeek] + " " + getHrsMins(startMinutes) + "-"
+ + getHrsMins(endMinutes);
+ }
+
+ public int getEndMinutes() {
+ return endMinutes;
+ }
+
+ public int getStartMinutes() {
+ return startMinutes;
+ }
+
+ public void setDayOfWeek(int zeroBasedDayOfWeek) {
+ if (0 <= zeroBasedDayOfWeek && zeroBasedDayOfWeek < 7) {
+ this.zeroBasedDayOfWeek = zeroBasedDayOfWeek;
+ } else {
+ throw new IllegalArgumentException("day must be in the range 0-6");
+ }
+ }
+
+ public void setEndMinutes(int endMinutes) {
+ this.endMinutes = endMinutes;
+ }
+
+ public void setStartMinutes(int startMinutes) {
+ this.startMinutes = startMinutes;
+ }
+
+ private String getHrsMins(int mins) {
+ int hrs = mins / 60;
+ if (hrs > 12) {
+ hrs -= 12;
+ }
+
+ int remainder = mins % 60;
+
+ return hrs + ":"
+ + (remainder < 10 ? "0" + remainder : String.valueOf(remainder));
+ }
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.css b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.css
new file mode 100644
index 0000000..ab81abf
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.css
@@ -0,0 +1,85 @@
+
+body {
+ background-color: white;
+ color: black;
+ font-family: Arial, sans-serif;
+ font-size: small;
+ margin: 8px;
+ margin-top: 3px;
+}
+
+.DynaTable-DynaTableWidget {
+ width: 100%;
+ border: 1px solid #ACA899;
+}
+
+
+.DynaTable-DynaTableWidget .navbar {
+ width: 100%;
+ background-color: #ECE9D8;
+ vertical-align: middle;
+ border-bottom: 1px solid #ACA899;
+}
+
+.DynaTable-DynaTableWidget .navbar button {
+ width: 3em;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.DynaTable-DynaTableWidget .navbar .status {
+ vertical-align: middle;
+ padding-right: 10px;
+}
+
+.DynaTable-DynaTableWidget .table {
+ margin: 10px;
+}
+
+.DynaTable-DynaTableWidget .table td.header {
+ text-align: left;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+.DynaTable-DynaTableWidget .table td.name {
+ width: 10em;
+}
+
+.DynaTable-DynaTableWidget .table td.desc {
+ width: 20em;
+}
+
+.DynaTable-DynaTableWidget .table td.sched {
+ width: 20em;
+}
+
+.DynaTable-DynaTableWidget .table td {
+ vertical-align: top;
+}
+
+.DynaTable-DayFilterWidget {
+ margin: 3em 1em 1em 0;
+ width: 10em;
+ padding: 0px 8px 0px 8px;
+ border: 1px solid #ACA899;
+}
+
+.DynaTable-DayFilterWidget button {
+ width: 4em;
+ margin: 8px 4px 8px 4px;
+}
+
+.DynaTable-ErrorDialog {
+ border: 2px outset;
+ background-color: white;
+ width: 50%;
+}
+
+.DynaTable-ErrorDialog .Caption {
+ background-color: #C3D9FF;
+ padding: 3px;
+ margin: 2px;
+ font-weight: bold;
+ cursor: default;
+}
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.html b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.html
new file mode 100644
index 0000000..3c5887a
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/legacyPublic/DynaTable2Legacy.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- -->
+<!-- Copyright 2008 Google Inc. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
+<!-- may not use this file except in compliance with the License. You may -->
+<!-- may obtain a copy of the License at -->
+<!-- -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
+<!-- -->
+<!-- Unless required by applicable law or agreed to in writing, software -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
+<!-- implied. License for the specific language governing permissions and -->
+<!-- limitations under the License. -->
+
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <link type="text/css" rel="stylesheet" href="DynaTable2Legacy.css">
+ <title></title>
+ </head>
+ <body>
+ <iframe src="javascript:''" id='__gwt_historyFrame' tabIndex='-1' style='width:0;height:0;border:0'></iframe>
+ <script type="text/javascript" language='javascript' src='com.google.gwt.sample.dynatable2.DynaTable2Legacy.nocache.js'></script>
+ <h1>School Schedule for Professors and Students</h1>
+ <table width="100%" border="0" summary="School Schedule for Professors and Students">
+ <tr valign="top">
+ <td id="calendar" align="center" width="90%">
+ </td>
+ <td id="days" align="center" width="10%">
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/samples/dynatable2/src/com/google/gwt/sample/dynatable2/server/SchoolCalendarServiceImpl.java b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/server/SchoolCalendarServiceImpl.java
new file mode 100644
index 0000000..2705edb
--- /dev/null
+++ b/samples/dynatable2/src/com/google/gwt/sample/dynatable2/server/SchoolCalendarServiceImpl.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.dynatable2.server;
+
+import com.google.gwt.sample.dynatable2.client.Person;
+import com.google.gwt.sample.dynatable2.client.Professor;
+import com.google.gwt.sample.dynatable2.client.Schedule;
+import com.google.gwt.sample.dynatable2.client.SchoolCalendarService;
+import com.google.gwt.sample.dynatable2.client.Student;
+import com.google.gwt.sample.dynatable2.client.TimeSlot;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * The implementation of the RPC service which runs on the server.
+ */
+public class SchoolCalendarServiceImpl extends RemoteServiceServlet implements
+ SchoolCalendarService {
+
+ private static final String[] FIRST_NAMES = new String[] {
+ "Inman", "Sally", "Omar", "Teddy", "Jimmy", "Cathy", "Barney", "Fred",
+ "Eddie", "Carlos"};
+
+ private static final String[] LAST_NAMES = new String[] {
+ "Smith", "Jones", "Epps", "Gibbs", "Webber", "Blum", "Mendez",
+ "Crutcher", "Needler", "Wilson", "Chase", "Edelstein"};
+
+ private static final String[] SUBJECTS = new String[] {
+ "Chemistry", "Phrenology", "Geometry", "Underwater Basket Weaving",
+ "Basketball", "Computer Science", "Statistics", "Materials Engineering",
+ "English Literature", "Geology"};
+
+ private static final Person[] NO_PEOPLE = new Person[0];
+
+ private static final int CLASS_LENGTH_MINS = 50;
+
+ private static final int MAX_SCHED_ENTRIES = 5;
+
+ private static final int MIN_SCHED_ENTRIES = 1;
+
+ private static final int MAX_PEOPLE = 100;
+
+ private static final int STUDENTS_PER_PROF = 5;
+
+ private final List<Person> people = new ArrayList<Person>();
+
+ private final Random rnd = new Random(3);
+
+ public SchoolCalendarServiceImpl() {
+ generateRandomPeople();
+ }
+
+ public Person[] getPeople(int startIndex, int maxCount) {
+ int peopleCount = people.size();
+
+ int start = startIndex;
+ if (start >= peopleCount) {
+ return NO_PEOPLE;
+ }
+
+ int end = Math.min(startIndex + maxCount, peopleCount);
+ if (start == end) {
+ return NO_PEOPLE;
+ }
+
+ int resultCount = end - start;
+ Person[] results = new Person[resultCount];
+ for (int from = start, to = 0; to < resultCount; ++from, ++to) {
+ results[to] = people.get(from);
+ }
+
+ return results;
+ }
+
+ /**
+ * Write the serialized response out to stdout. This is a very unusual thing
+ * to do, but it allows us to create a static file version of the response
+ * without deploying a servlet.
+ */
+ @Override
+ protected void onAfterResponseSerialized(String serializedResponse) {
+ System.out.println(serializedResponse);
+ }
+
+ private void generateRandomPeople() {
+ for (int i = 0; i < MAX_PEOPLE; ++i) {
+ Person person = generateRandomPerson();
+ people.add(person);
+ }
+ }
+
+ private Person generateRandomPerson() {
+ // 1 out of every so many people is a prof.
+ //
+ if (rnd.nextInt(STUDENTS_PER_PROF) == 1) {
+ return generateRandomProfessor();
+ } else {
+ return generateRandomStudent();
+ }
+ }
+
+ private Person generateRandomProfessor() {
+ Professor prof = new Professor();
+
+ String firstName = pickRandomString(FIRST_NAMES);
+ String lastName = pickRandomString(LAST_NAMES);
+ prof.setName("Dr. " + firstName + " " + lastName);
+
+ String subject = pickRandomString(SUBJECTS);
+ prof.setDescription("Professor of " + subject);
+
+ generateRandomSchedule(prof.getTeachingSchedule());
+
+ return prof;
+ }
+
+ private void generateRandomSchedule(Schedule sched) {
+ int range = MAX_SCHED_ENTRIES - MIN_SCHED_ENTRIES + 1;
+ int howMany = MIN_SCHED_ENTRIES + rnd.nextInt(range);
+
+ TimeSlot[] timeSlots = new TimeSlot[howMany];
+
+ for (int i = 0; i < howMany; ++i) {
+ int startHrs = 8 + rnd.nextInt(9); // 8 am - 5 pm
+ int startMins = 15 * rnd.nextInt(4); // on the hour or some quarter
+ int dayOfWeek = 1 + rnd.nextInt(5); // Mon - Fri
+
+ int absStartMins = 60 * startHrs + startMins; // convert to minutes
+ int absStopMins = absStartMins + CLASS_LENGTH_MINS;
+
+ timeSlots[i] = new TimeSlot(dayOfWeek, absStartMins, absStopMins);
+ }
+
+ Arrays.sort(timeSlots);
+
+ for (int i = 0; i < howMany; ++i) {
+ sched.addTimeSlot(timeSlots[i]);
+ }
+ }
+
+ private Person generateRandomStudent() {
+ Student student = new Student();
+
+ String firstName = pickRandomString(FIRST_NAMES);
+ String lastName = pickRandomString(LAST_NAMES);
+ student.setName(firstName + " " + lastName);
+
+ String subject = pickRandomString(SUBJECTS);
+ student.setDescription("Majoring in " + subject);
+
+ generateRandomSchedule(student.getClassSchedule());
+
+ return student;
+ }
+
+ private String pickRandomString(String[] a) {
+ int i = rnd.nextInt(a.length);
+ return a[i];
+ }
+}
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
index f00e966..768e1f3 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java
@@ -62,6 +62,7 @@
import com.google.gwt.sample.showcase.client.content.widgets.CwBasicButton;
import com.google.gwt.sample.showcase.client.content.widgets.CwCheckBox;
import com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton;
+import com.google.gwt.sample.showcase.client.content.widgets.CwDatePicker;
import com.google.gwt.sample.showcase.client.content.widgets.CwFileUpload;
import com.google.gwt.sample.showcase.client.content.widgets.CwHyperlink;
import com.google.gwt.sample.showcase.client.content.widgets.CwRadioButton;
@@ -320,6 +321,8 @@
images.catWidgets());
setupMainMenuOption(catWidgets, new CwFileUpload(constants),
images.catWidgets());
+ setupMainMenuOption(catWidgets, new CwDatePicker(constants),
+ images.catWidgets());
setupMainMenuOption(catWidgets, new CwHyperlink(constants),
images.catWidgets());
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
index 99b7595..68f59ec 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
@@ -49,6 +49,7 @@
import com.google.gwt.sample.showcase.client.content.widgets.CwBasicButton;
import com.google.gwt.sample.showcase.client.content.widgets.CwCheckBox;
import com.google.gwt.sample.showcase.client.content.widgets.CwCustomButton;
+import com.google.gwt.sample.showcase.client.content.widgets.CwDatePicker;
import com.google.gwt.sample.showcase.client.content.widgets.CwFileUpload;
import com.google.gwt.sample.showcase.client.content.widgets.CwHyperlink;
import com.google.gwt.sample.showcase.client.content.widgets.CwRadioButton;
@@ -73,7 +74,7 @@
CwDateTimeFormat.CwConstants, CwMessagesExample.CwConstants,
CwConstantsExample.CwConstants, CwConstantsWithLookupExample.CwConstants,
CwDictionaryExample.CwConstants, CwDecoratorPanel.CwConstants,
- CwAnimation.CwConstants {
+ CwAnimation.CwConstants, CwDatePicker.CwConstants {
/**
* The path to source code for examples, raw files, and style definitions.
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.properties b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.properties
index a049c0b..00b8a7b 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.properties
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.properties
@@ -73,6 +73,10 @@
cwCustomButtonDescription = PushButtons and ToggleButtons allow you to customize the look of your buttons
cwCustomButtonPush = <b>Push Buttons:</b>
cwCustomButtonToggle = <b>Toggle Buttons:</b>
+cwDatePickerName = Date Picker
+cwDatePickerDescription = Let users select a date using the DatePicker.
+cwDatePickerBoxLabel = <br><br><br><b>DateBox with popup DatePicker:</b>
+cwDatePickerLabel = <b>Permanent DatePicker:</b>
cwDateTimeFormatName = Date Time Format
cwDateTimeFormatDescription = Class DateTimeFormat supports locale-sensitive formatting and parsing of date and time values, like NumberFormat, using a flexible pattern-based syntax. Both custom patterns and standard patterns are supported.
cwDateTimeFormatFailedToParseInput = Unable to parse input
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_ar.properties b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_ar.properties
index 6fcfa36..09b106a 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_ar.properties
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_ar.properties
@@ -234,3 +234,7 @@
cwTreeBrahmsWorkSonatas = اثنين السوناتات لكلارينيت -- و قاصر ,لاثنين من السوناتات كلارينيت -- ة - شقة الرئيسية
cwTreeBrahmsWorkSymphonies = رقم 1 -- ج طفيفة ,رقم 2 -- د طفيفة ,رقم 3 -- و الرئيسية ,رقم 4 -- ة طفيفة
cwTreeMozartWorkConcertos = كونشرتو البيانو رقم 12 , كونشرتو البيانو رقم 17 , كونشرتو الكلارينت , كونشرتو الكمان رقم 5 , رقم 4 كونشرتو الكمان
+cwDatePickerName = تاريخ القاطف
+cwDatePickerDescription = اسمحوا المستخدمين اختيار تاريخ باستخدام DatePicker.
+cwDatePickerBoxLabel = <br><br><br><b>DateBox مع قافزة DatePicker : </b>
+cwDatePickerLabel = <b>الدائم DatePicker : </b>
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_fr.properties b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_fr.properties
index 183d0c9..ca4a4a5 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_fr.properties
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_fr.properties
@@ -232,3 +232,7 @@
cwTreeBrahmsWorkSonatas = Deux Sonates pour clarinette - F Minor, deux sonates pour clarinette - mi bémol majeur
cwTreeBrahmsWorkSymphonies = n ° 1 - C Minor, n ° 2 - ré mineur, n ° 3 - F Major, n ° 4 - E Minor
cwTreeMozartWorkConcertos = Concerto pour piano n ° 12, Concerto pour piano n ° 17, Concerto pour clarinette, Concerto pour violon n ° 5, Concerto pour violon n ° 4
+cwDatePickerName = Date Picker
+cwDatePickerDescription = Permettre aux utilisateurs de sélectionner une date à l'aide de la DatePicker.
+cwDatePickerBoxLabel = <br><br><b>DateBox avec popup DatePicker:</b>
+cwDatePickerLabel = <b>DatePicker permanent:</b>
\ No newline at end of file
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_zh.properties b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_zh.properties
index 47586d7..f917536 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_zh.properties
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants_zh.properties
@@ -232,3 +232,7 @@
cwTreeBrahmsWorkSonatas = 2奏鸣曲单簧管-F小调, 2单簧管奏鸣曲- E大调大
cwTreeBrahmsWorkSymphonies =第1号-C小调, 第2号- D小调, 第3号- F大, 第4号- E小调
cwTreeMozartWorkConcertos =钢琴协奏曲第12号, 钢琴协奏曲第17号, 单簧管协奏曲, 小提琴协奏曲第5号, 小提琴协奏曲第4号
+cwDatePickerName =日期选择器
+cwDatePickerDescription =让用户选择日期使用DatePicker 。
+cwDatePickerBoxLabel = <br><br><br><b>DateBox与弹出DatePicker:</b>
+cwDatePickerLabel =<b>常驻DatePicker:</b>
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwDatePicker.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwDatePicker.java
new file mode 100644
index 0000000..5428f13
--- /dev/null
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/widgets/CwDatePicker.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.sample.showcase.client.content.widgets;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.i18n.client.Constants;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.sample.showcase.client.ContentWidget;
+import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseData;
+import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseSource;
+import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseStyle;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.datepicker.client.DateBox;
+import com.google.gwt.user.datepicker.client.DatePicker;
+
+import java.util.Date;
+
+/**
+ * Example file.
+ */
+@ShowcaseStyle({
+ ".gwt-DatePicker", ".datePicker", "td.datePickerMonth", ".gwt-DateBox",
+ ".dateBox"})
+public class CwDatePicker extends ContentWidget {
+ /**
+ * The constants used in this Content Widget.
+ */
+ @ShowcaseSource
+ public static interface CwConstants extends Constants,
+ ContentWidget.CwConstants {
+ String cwDatePickerBoxLabel();
+
+ String cwDatePickerDescription();
+
+ String cwDatePickerLabel();
+
+ String cwDatePickerName();
+ }
+
+ /**
+ * An instance of the constants.
+ */
+ @ShowcaseData
+ private CwConstants constants;
+
+ /**
+ * Constructor.
+ *
+ * @param constants the constants
+ */
+ public CwDatePicker(CwConstants constants) {
+ super(constants);
+ this.constants = constants;
+ }
+
+ @Override
+ public String getDescription() {
+ return constants.cwDatePickerDescription();
+ }
+
+ @Override
+ public String getName() {
+ return constants.cwDatePickerName();
+ }
+
+ /**
+ * Initialize this example.
+ */
+ @ShowcaseSource
+ @Override
+ public Widget onInitialize() {
+ // Create a basic date picker
+ DatePicker datePicker = new DatePicker();
+ final Label text = new Label();
+
+ // Set the value in the text box when the user selects a date
+ datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ Date date = event.getValue();
+ String dateString = DateTimeFormat.getMediumDateFormat().format(date);
+ text.setText(dateString);
+ }
+ });
+
+ // Set the default value
+ datePicker.setValue(new Date(), true);
+
+ // Create a DateBox
+ DateBox dateBox = new DateBox();
+
+ // Combine the widgets into a panel and return them
+ VerticalPanel vPanel = new VerticalPanel();
+ vPanel.add(new HTML(constants.cwDatePickerLabel()));
+ vPanel.add(text);
+ vPanel.add(datePicker);
+ vPanel.add(new HTML(constants.cwDatePickerBoxLabel()));
+ vPanel.add(dateBox);
+ return vPanel;
+ }
+
+ @Override
+ protected void asyncOnInitialize(final AsyncCallback<Widget> callback) {
+ GWT.runAsync(new RunAsyncCallback() {
+
+ public void onFailure(Throwable caught) {
+ callback.onFailure(caught);
+ }
+
+ public void onSuccess() {
+ callback.onSuccess(onInitialize());
+ }
+ });
+ }
+}
diff --git a/tools/api-checker/build.xml b/tools/api-checker/build.xml
index 3259342..8afcaea 100755
--- a/tools/api-checker/build.xml
+++ b/tools/api-checker/build.xml
@@ -54,6 +54,7 @@
<mkdir dir="${junit.out}/reports" />
<junit dir="${junit.out}" fork="yes" printsummary="yes" haltonfailure="true">
+ <sysproperty key="gwt.devjar" value="${gwt.dev.staging.jar}" />
<classpath>
<pathelement location="test" />
<pathelement location="${gwt.build.out}/dev/core/bin"/>
diff --git a/tools/api-checker/config/gwt15_16userApi.conf b/tools/api-checker/config/gwt15_16userApi.conf
index 895be36..e55f642 100644
--- a/tools/api-checker/config/gwt15_16userApi.conf
+++ b/tools/api-checker/config/gwt15_16userApi.conf
@@ -32,3 +32,4 @@
java.lang.StringBuilder::append(Ljava/lang/StringBuffer;) OVERRIDABLE_METHOD_ARGUMENT_TYPE_CHANGE
com.google.gwt.user.client.ui.Button::Button(Ljava/lang/String;Lcom/google/gwt/user/client/ui/ClickListener;) OVERLOADED_METHOD_CALL
com.google.gwt.user.client.ui.ToggleButton::ToggleButton(Lcom/google/gwt/user/client/ui/Image;Lcom/google/gwt/user/client/ui/Image;Lcom/google/gwt/user/client/ui/ClickListener;) OVERLOADED_METHOD_CALL
+com.google.gwt.user.client.ui.Tree::setImageBase(Ljava/lang/String;) MISSING
\ No newline at end of file
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
index 02369ae..30fb98b 100644
--- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
+++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
@@ -16,19 +16,37 @@
package com.google.gwt.tools.apichecker;
import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
+import com.google.gwt.dev.javac.CompilationUnit;
+import com.google.gwt.dev.javac.impl.FileCompilationUnit;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.util.tools.ArgHandlerFlag;
+import com.google.gwt.util.tools.ArgHandlerString;
+import com.google.gwt.util.tools.ToolBase;
+import java.io.BufferedInputStream;
import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
+import java.util.Properties;
import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
/**
* {@link ApiCompatibilityChecker} Main class to check if the new API is
@@ -67,46 +85,349 @@
* adding the 'final' keyword to the API member.
*
*/
-public class ApiCompatibilityChecker {
-
- // TODO(amitmanjhi): use ToolBase for command-line processing
+public class ApiCompatibilityChecker extends ToolBase {
// TODO(amitmanjhi): check gwt's dev/core/src files. Would need the ability to
// build TypeOracle from class files
- // TODO(amitmanjhi): ignore API breakages due to impl package. More generally,
- // white-list of packages that should not be checked.
-
// TODO(amitmanjhi): better handling of exceptions and exception-chaining.
+ static class StaticCompilationUnit extends CompilationUnit {
+
+ private final String source;
+ private final String typeName;
+
+ public StaticCompilationUnit(String typeName, String source) {
+ this.typeName = typeName;
+ this.source = source;
+ }
+
+ @Override
+ public String getDisplayLocation() {
+ return "/mock/" + typeName;
+ }
+
+ @Override
+ public long getLastModified() {
+ return 0;
+ }
+
+ @Override
+ public String getSource() {
+ return String.valueOf(source);
+ }
+
+ @Override
+ public String getTypeName() {
+ return typeName;
+ }
+
+ @Override
+ public boolean isGenerated() {
+ return false;
+ }
+
+ @Override
+ public boolean isSuperSource() {
+ return false;
+ }
+ }
+
+ /**
+ * Abstract internal class that specifies a set of {@link CompilationUnit}.
+ */
+ private abstract static class CompilationUnits {
+ protected final TreeLogger logger;
+
+ CompilationUnits(TreeLogger logger) {
+ this.logger = logger;
+ }
+
+ public abstract Set<CompilationUnit> getCompilationUnits()
+ throws NotFoundException, IOException, UnableToCompleteException;
+
+ // TODO (amitmanjhi): remove this code. use TypeOracle functionality
+ // instead.
+ protected String extractPackageName(Reader reader) throws IOException {
+ BufferedReader br = new BufferedReader(reader);
+ String str = null;
+ while ((str = br.readLine()) != null) {
+ if (str.indexOf("package") != 0) {
+ continue;
+ }
+ String parts[] = str.split("[\b\t\n\r ]+");
+ if ((parts.length == 2) && parts[0].equals("package")) {
+ return parts[1].substring(0, parts[1].length() - 1); // the ; char
+ }
+ }
+ return null;
+ }
+
+ protected File getFileFromName(String tag, String pathName)
+ throws FileNotFoundException {
+ File file = new File(pathName);
+ if (!file.exists()) {
+ throw new FileNotFoundException(tag + "file " + pathName + " not found");
+ }
+ return file;
+ }
+
+ // TODO (amitmanjhi): remove this code. use TypeOracle functionality
+ // instead.
+ protected boolean isValidPackage(String packageName, String filePath) {
+ logger.log(TreeLogger.SPAM, "packageName = " + packageName
+ + ", filePath = " + filePath, null);
+ if (packageName == null) {
+ return false;
+ }
+ int lastSlashPosition = filePath.lastIndexOf("/");
+ if (lastSlashPosition == -1) {
+ return false;
+ }
+ String dirPath = filePath.substring(0, lastSlashPosition);
+ String packageNameAsPath = packageName.replace('.', '/');
+ logger.log(TreeLogger.SPAM, "packageNameAsPath " + packageNameAsPath
+ + ", dirPath = " + dirPath, null);
+ return dirPath.endsWith(packageNameAsPath);
+ }
+ }
+
+ /**
+ * Class that specifies a set of {@link CompilationUnit} read from jar files.
+ */
+ private static class JarFileCompilationUnits extends CompilationUnits {
+ private final Set<String> excludedPaths;
+ private final Set<String> includedPaths;
+ private final JarFile jarFiles[];
+ private Set<CompilationUnit> units = null;
+
+ JarFileCompilationUnits(JarFile[] jarFiles, Set<String> includedPaths,
+ Set<String> excludedPaths, TreeLogger logger) {
+ super(logger);
+ this.jarFiles = jarFiles;
+ this.includedPaths = includedPaths;
+ this.excludedPaths = excludedPaths;
+ }
+
+ @Override
+ public Set<CompilationUnit> getCompilationUnits() throws IOException {
+ if (units != null) {
+ return units;
+ }
+
+ units = new HashSet<CompilationUnit>();
+ for (JarFile jarFile : jarFiles) {
+ Enumeration<JarEntry> entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry jarEntry = entries.nextElement();
+ String fileName = jarEntry.toString();
+ if (fileName.endsWith(".java") && isIncluded(fileName)) {
+ // add this compilation unit
+ String fileContent = getFileContentsFromJar(jarFile, jarEntry);
+ String packageName = extractPackageName(new StringReader(
+ fileContent));
+ if (packageName == null) {
+ logger.log(TreeLogger.WARN, "Not adding file = " + fileName
+ + ", because packageName = null", null);
+ } else {
+ if (isValidPackage(packageName, fileName)) {
+ // Add if package and fileNames are okay
+ units.add(new StaticCompilationUnit(packageName + "."
+ + getClassName(fileName), fileContent));
+ logger.log(TreeLogger.DEBUG, "adding pkgName = " + packageName
+ + ", file = " + fileName, null);
+ } else {
+ logger.log(TreeLogger.SPAM, " not adding file " + fileName,
+ null);
+ }
+ }
+ }
+ }
+ }
+ return units;
+ }
+
+ String getFileContentsFromJar(JarFile jarFile, JarEntry jarEntry)
+ throws IOException {
+ StringBuffer fileContent = new StringBuffer();
+ InputStream is = jarFile.getInputStream(jarEntry);
+ BufferedInputStream bis = new BufferedInputStream(is);
+ int length = 500;
+ byte buf[] = new byte[length];
+ int count = 0;
+ while ((count = bis.read(buf, 0, length)) != -1) {
+ fileContent.append(new String(buf, 0, count));
+ buf = new byte[length];
+ }
+ bis.close();
+ is.close();
+ return fileContent.toString();
+ }
+
+ private String getClassName(String fileName) {
+ int index = fileName.lastIndexOf("/");
+ int endOffset = 0;
+ if (fileName.endsWith(".java")) {
+ endOffset = 5;
+ }
+ return fileName.substring(index + 1, fileName.length() - endOffset);
+ }
+
+ private boolean isIncluded(String fileName) {
+ int index = fileName.length();
+ do {
+ fileName = fileName.substring(0, index);
+ if (includedPaths.contains(fileName)) {
+ return true;
+ }
+ if (excludedPaths.contains(fileName)) {
+ return false;
+ }
+ index = fileName.lastIndexOf("/");
+ } while (index != -1);
+ return false;
+ }
+ }
+
+ /**
+ * Class that specifies a set of {@link CompilationUnit} read from the
+ * file-system.
+ */
+ private static class SourceFileCompilationUnits extends CompilationUnits {
+ private final Set<String> excludedPaths;
+ private final Set<File> includedPaths;
+ private Set<CompilationUnit> units = null;
+
+ SourceFileCompilationUnits(String dirRoot,
+ Set<String> includedPathsAsString, Set<String> excludedPathsAsString,
+ TreeLogger logger) throws FileNotFoundException, IOException {
+ super(logger);
+ if (dirRoot == null) {
+ dirRoot = "";
+ }
+ includedPaths = new HashSet<File>();
+ for (String includedPath : includedPathsAsString) {
+ includedPaths.add(getFileFromName("source file: ", dirRoot
+ + includedPath));
+ }
+
+ excludedPaths = new HashSet<String>();
+ for (String excludedPath : excludedPathsAsString) {
+ excludedPaths.add(getFileFromName("excluded file: ",
+ dirRoot + excludedPath).getCanonicalPath());
+ }
+ }
+
+ @Override
+ public Set<CompilationUnit> getCompilationUnits() throws NotFoundException,
+ IOException, UnableToCompleteException {
+ if (units != null) {
+ return units;
+ }
+
+ units = new HashSet<CompilationUnit>();
+ for (File sourceFile : includedPaths) {
+ updateCompilationUnitsInPath(sourceFile);
+ }
+ return units;
+ }
+
+ private boolean isExcludedFile(String fileName) {
+ String pattern = "file:";
+ if (fileName.indexOf(pattern) == 0) {
+ fileName = fileName.substring(pattern.length());
+ }
+ return excludedPaths.contains(fileName);
+ }
+
+ private void updateCompilationUnitsInPath(File sourcePathEntry)
+ throws NotFoundException, IOException, UnableToCompleteException {
+ logger.log(TreeLogger.SPAM, "entering addCompilationUnitsInPath, file = "
+ + sourcePathEntry, null);
+ File[] files = sourcePathEntry.listFiles();
+ if (files == null) { // No files found.
+ return;
+ }
+
+ for (int i = 0; i < files.length; i++) {
+ final File file = files[i];
+ logger.log(TreeLogger.SPAM, "deciding the fate of file " + file, null);
+ // Ignore files like .svn and .cvs
+ if (file.getName().startsWith(".") || file.getName().equals("CVS")) {
+ continue;
+ }
+ if (isExcludedFile(file.getCanonicalPath())) {
+ // do not process the subtree
+ logger.log(TreeLogger.DEBUG,
+ "not traversing " + file.toURI().toURL(), null);
+ continue;
+ }
+ if (file.isFile()) {
+ String pkgName = null;
+ if (file.getName().endsWith("java")) {
+ pkgName = extractPackageName(new FileReader(file));
+ if (pkgName == null) {
+ logger.log(TreeLogger.WARN, "Not adding file = "
+ + file.toString() + ", because packageName = null", null);
+ } else {
+ if (isValidPackage(pkgName,
+ sourcePathEntry.toURI().toURL().toString())) {
+ // Add if the package and fileNames are okay
+ units.add(new FileCompilationUnit(file, pkgName));
+ logger.log(TreeLogger.DEBUG, "adding pkgName = " + pkgName
+ + ", file = " + file.toString(), null);
+ } else {
+ logger.log(TreeLogger.SPAM, " not adding file "
+ + file.toURI().toURL(), null);
+ }
+ }
+ }
+ } else {
+ // Recurse into subDirs
+ updateCompilationUnitsInPath(file);
+ }
+ }
+ }
+ }
+
// currently doing only source_compatibility. true by default.
public static final boolean API_SOURCE_COMPATIBILITY = true;
- // prints which class the member was declared in plus the string message in
- // ApiChange, false by default
- public static final boolean DEBUG = false;
-
- // prints the API of the two containers, false by default.
- public static final boolean DEBUG_PRINT_ALL_API = false;
-
- // these two parameters print APIs common in the two repositories. Should be
- // false by default.
- public static final boolean PRINT_COMPATIBLE = false;
-
- public static final boolean PRINT_COMPATIBLE_WITH = false;
- // for debugging. To see if TypeOracle builds
- public static final boolean PROCESS_EXISTING_API = true;
-
- public static final boolean PROCESS_NEW_API = true;
- // true by default
- public static final boolean REMOVE_NON_SUBCLASSABLE_ABSTRACT_CLASS_FROM_API = true;
-
- public static final boolean FILTER_DUPLICATES = true;
+ /**
+ * prints which class the member was declared in plus the string message in
+ * ApiChange, false by default
+ */
+ public static boolean DEBUG = false;
public static final boolean DEBUG_DUPLICATE_REMOVAL = false;
- // Tweak for log output.
- public static final TreeLogger.Type type = TreeLogger.WARN;
+ /**
+ * Flag for filtering duplicates, true by default. Just for debugging in rare
+ * cases.
+ */
+ public static final boolean FILTER_DUPLICATES = true;
+
+ /**
+ * Print APIs common in the two repositories. Should be false by default.
+ */
+ public static final boolean PRINT_COMPATIBLE = false;
+ /**
+ * Print APIs common in the two repositories. Should be false by default.
+ */
+ public static final boolean PRINT_COMPATIBLE_WITH = false;
+
+ /**
+ * Flag for debugging whether typeOracle builds.
+ */
+ public static final boolean PROCESS_EXISTING_API = true;
+
+ /**
+ * Flag for debugging whether typeOracle builds.
+ */
+ public static final boolean PROCESS_NEW_API = true;
+
+ // true by default
+ public static final boolean REMOVE_NON_SUBCLASSABLE_ABSTRACT_CLASS_FROM_API = true;
// remove duplicates by default
public static Collection<ApiChange> getApiDiff(ApiContainer newApi,
@@ -115,45 +436,70 @@
return getApiDiff(apiDiff, whiteList, FILTER_DUPLICATES);
}
- // Call APIBuilders for each of the 2 source trees
public static void main(String args[]) {
-
try {
- ApiContainer newApi = null, existingApi = null;
+ ApiCompatibilityChecker checker = new ApiCompatibilityChecker();
+ if (checker.processArgs(args)) {
+ ApiContainer newApi = null, existingApi = null;
- if (args.length < 1) {
- printHelp();
- System.exit(-1);
- }
+ AbstractTreeLogger logger = new PrintWriterTreeLogger();
+ logger.setMaxDetail(checker.type);
+ logger.log(TreeLogger.INFO, "gwtDevJar = " + checker.gwtDevJar
+ + ", userJar = " + checker.gwtUserJar + ", refjars = "
+ + checker.refJars + ", logLevel = " + checker.type
+ + ", printAllApi = " + checker.printAllApi, null);
- AbstractTreeLogger logger = new PrintWriterTreeLogger();
- logger.setMaxDetail(type);
- if (PROCESS_NEW_API) {
- newApi = new ApiContainer(args[0], "_new", logger);
- if (ApiCompatibilityChecker.DEBUG_PRINT_ALL_API) {
- logger.log(TreeLogger.INFO, newApi.getApiAsString()); // print the API
+ Set<String> excludedPackages = checker.getSetOfExcludedPackages(checker.configProperties);
+ if (PROCESS_NEW_API) {
+ Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+ units.addAll(new SourceFileCompilationUnits(
+ checker.configProperties.getProperty("dirRoot_new"),
+ checker.getConfigPropertyAsSet("sourceFiles_new"),
+ checker.getConfigPropertyAsSet("excludedFiles_new"), logger).getCompilationUnits());
+ units.addAll(checker.getGwtCompilationUnits(logger));
+ newApi = new ApiContainer(
+ checker.configProperties.getProperty("name_new"), units,
+ excludedPackages, logger);
+ if (checker.printAllApi) {
+ logger.log(TreeLogger.INFO, newApi.getApiAsString());
+ }
}
- }
- if (PROCESS_EXISTING_API) {
- existingApi = new ApiContainer(args[0], "_old", logger);
- if (ApiCompatibilityChecker.DEBUG_PRINT_ALL_API) {
- logger.log(TreeLogger.INFO, existingApi.getApiAsString());
+ if (PROCESS_EXISTING_API) {
+ Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+ if (checker.refJars == null) {
+ units.addAll(new SourceFileCompilationUnits(
+ checker.configProperties.getProperty("dirRoot_old"),
+ checker.getConfigPropertyAsSet("sourceFiles_old"),
+ checker.getConfigPropertyAsSet("excludedFiles_old"), logger).getCompilationUnits());
+ } else {
+ units.addAll(new JarFileCompilationUnits(checker.refJars,
+ checker.getConfigPropertyAsSet("sourceFiles_old"),
+ checker.getConfigPropertyAsSet("excludedFiles_old"), logger).getCompilationUnits());
+ }
+ units.addAll(checker.getGwtCompilationUnits(logger));
+ existingApi = new ApiContainer(
+ checker.configProperties.getProperty("name_old"), units,
+ excludedPackages, logger);
+ if (checker.printAllApi) {
+ logger.log(TreeLogger.INFO, existingApi.getApiAsString());
+ }
+ }
+
+ if (PROCESS_NEW_API && PROCESS_EXISTING_API) {
+ Collection<ApiChange> apiDifferences = getApiDiff(newApi,
+ existingApi, checker.whiteList);
+ for (ApiChange apiChange : apiDifferences) {
+ System.out.println(apiChange);
+ }
+ if (apiDifferences.size() == 0) {
+ System.out.println("API compatibility check SUCCESSFUL");
+ } else {
+ System.out.println("API compatibility check FAILED");
+ }
+ System.exit(apiDifferences.size() == 0 ? 0 : 1);
}
}
- if (PROCESS_NEW_API && PROCESS_EXISTING_API) {
- Collection<ApiChange> apiDifferences = getApiDiff(newApi, existingApi,
- readWhiteListFromFile(args[0]));
- for (ApiChange apiChange : apiDifferences) {
- System.out.println(apiChange);
- }
- if (apiDifferences.size() == 0) {
- System.out.println("API compatibility check SUCCESSFUL");
- } else {
- System.out.println("API compatibility check FAILED");
- }
- System.exit(apiDifferences.size() == 0 ? 0 : 1);
- }
} catch (Exception e) {
// intercepting all exceptions in main, because I have to exit with -1 so
// that the build breaks.
@@ -163,44 +509,6 @@
}
}
- public static void printHelp() {
- StringBuffer sb = new StringBuffer();
- sb.append("java ApiCompatibilityChecker configFile\n");
- sb.append("The ApiCompatibilityChecker tool requires a config file as an argument. ");
- sb.append("The config file must specify two repositories of java source files: ");
- sb.append("'_old' and '_new', which are to be compared for API source compatibility.\n");
- sb.append("An optional whitelist is present at the end of ");
- sb.append("the config file. The format of the whitelist is same as the output of ");
- sb.append("the tool without the whitelist.\n");
- sb.append("Each repository is specified by the following four properties:\n");
- sb.append("name specifies how the api should be refered to in the output\n");
- sb.append("dirRoot optional argument that specifies the base directory of all other file/directory names\n");
- sb.append("sourceFiles a colon-separated list of files/directories that specify the roots of the the filesystem trees to be included.\n");
- sb.append("excludeFiles a colon-separated lists of files/directories that specify the roots of the filesystem trees to be excluded");
-
- sb.append("\n\n");
- sb.append("Example api.conf file:\n");
- sb.append("name_old gwtEmulator");
- sb.append("\n");
- sb.append("dirRoot_old ./");
- sb.append("\n");
- sb.append("sourceFiles_old dev/core/super:user/super:user/src");
- sb.append("\n");
- sb.append("excludeFiles_old user/super/com/google/gwt/junit");
- sb.append("\n\n");
-
- sb.append("name_new gwtEmulatorCopy");
- sb.append("\n");
- sb.append("dirRoot_new ../gwt-14/");
- sb.append("\n");
- sb.append("sourceFiles_new dev/core:user/super:user/src");
- sb.append("\n");
- sb.append("excludeFiles_new user/super/com/google/gwt/junit");
- sb.append("\n\n");
-
- System.out.println(sb.toString());
- }
-
// interface for testing, since do not want to build ApiDiff frequently
static Collection<ApiChange> getApiDiff(ApiDiffGenerator apiDiff,
Set<String> whiteList, boolean removeDuplicates) throws NotFoundException {
@@ -244,6 +552,330 @@
return apiChangeList;
}
+ private Properties configProperties;
+
+ private JarFile gwtDevJar;
+ private JarFile gwtUserJar;
+
+ // prints the API of the two containers, false by default.
+ private boolean printAllApi = false;
+ private JarFile refJars[];
+ // default log output
+ private TreeLogger.Type type = TreeLogger.WARN;
+ private Set<String> whiteList;
+
+ protected ApiCompatibilityChecker() {
+
+ /*
+ * register handlers for gwtDevJar, gwtUserJar, refJar, logLevel,
+ * printAllApi, configProperties
+ */
+
+ // handler for gwtDevJar
+ registerHandler(new ArgHandlerString() {
+
+ @Override
+ public String getPurpose() {
+ return "Path of the gwt dev jar";
+ }
+
+ @Override
+ public String getTag() {
+ return "-gwtDevJar";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"gwt_dev_jar_path"};
+ }
+
+ @Override
+ public boolean setString(String str) {
+ gwtDevJar = getJarFromString(str);
+ return gwtDevJar != null;
+ }
+ });
+
+ // handler for gwtUserJar
+ registerHandler(new ArgHandlerString() {
+
+ @Override
+ public String getPurpose() {
+ return "Path of the gwt user jar";
+ }
+
+ @Override
+ public String getTag() {
+ return "-gwtUserJar";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"gwt_user_jar_path"};
+ }
+
+ @Override
+ public boolean setString(String str) {
+ gwtUserJar = getJarFromString(str);
+ return gwtUserJar != null;
+ }
+ });
+
+ // handler for refJar
+ registerHandler(new ArgHandlerString() {
+ @Override
+ public String getPurpose() {
+ return "Path of the reference jar";
+ }
+
+ @Override
+ public String getTag() {
+ return "-refJar";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"reference_jar_path"};
+ }
+
+ @Override
+ public boolean setString(String str) {
+ String refJarStrings[] = str.split(":");
+ refJars = new JarFile[refJarStrings.length];
+ int count = 0;
+ for (String refJarString : refJarStrings) {
+ refJars[count++] = getJarFromString(refJarString);
+ if (refJars[count - 1] == null) {
+ return false; // bail-out early
+ }
+ }
+ return refJars != null;
+ }
+ });
+
+ // handler for logLevel
+ registerHandler(new ArgHandlerString() {
+
+ @Override
+ public String getPurpose() {
+ return "Sets the log level of the TreeLogger";
+ }
+
+ @Override
+ public String getTag() {
+ return "-logLevel";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ String values[] = new String[TreeLogger.Type.values().length];
+ int count = 0;
+ for (TreeLogger.Type tempType : TreeLogger.Type.values()) {
+ values[count++] = tempType.name();
+ }
+ return values;
+ }
+
+ @Override
+ public boolean setString(String str) {
+ for (TreeLogger.Type tempType : TreeLogger.Type.values()) {
+ if (tempType.name().equals(str)) {
+ type = tempType;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ });
+
+ // handler for printAllApi
+ registerHandler(new ArgHandlerFlag() {
+
+ @Override
+ public String getPurpose() {
+ return "Prints all api";
+ }
+
+ @Override
+ public String getTag() {
+ return "-printAllApi";
+ }
+
+ @Override
+ public boolean setFlag() {
+ printAllApi = true;
+ return true;
+ }
+
+ });
+
+ // handler for configFile
+ registerHandler(new ArgHandlerString() {
+
+ @Override
+ public String getPurpose() {
+ return "Path of the configuration file";
+ }
+
+ @Override
+ public String getTag() {
+ return "-configFile";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"config_file_path"};
+ }
+
+ @Override
+ public boolean isRequired() {
+ return true;
+ }
+
+ @Override
+ public boolean setString(String str) {
+ setPropertiesAndWhitelist(str);
+ return configProperties != null && whiteList != null;
+ }
+ });
+ }
+
+ @Override
+ public void printHelp() {
+ super.printHelp();
+ StringBuffer sb = new StringBuffer();
+ sb.append("\n");
+ sb.append("The config file must specify two repositories of java source files: ");
+ sb.append("'_old' and '_new', which are to be compared for API source compatibility.\n");
+ sb.append("An optional whitelist is present at the end of ");
+ sb.append("the config file. The format of the whitelist is same as the output of ");
+ sb.append("the tool without the whitelist.\n");
+ sb.append("Each repository is specified by the following four properties:\n");
+ sb.append("name specifies how the api should be refered to in the output\n");
+ sb.append("dirRoot optional argument that specifies the base directory of all other file/directory names\n");
+ sb.append("sourceFiles a colon-separated list of files/directories that specify the roots of the the filesystem trees to be included.\n");
+ sb.append("excludeFiles a colon-separated lists of files/directories that specify the roots of the filesystem trees to be excluded");
+
+ sb.append("\n\n");
+ sb.append("Example api.conf file:\n");
+ sb.append("name_old gwtEmulator");
+ sb.append("\n");
+ sb.append("dirRoot_old ./");
+ sb.append("\n");
+ sb.append("sourceFiles_old dev/core/super:user/super:user/src");
+ sb.append("\n");
+ sb.append("excludeFiles_old user/super/com/google/gwt/junit");
+ sb.append("\n\n");
+
+ sb.append("name_new gwtEmulatorCopy");
+ sb.append("\n");
+ sb.append("dirRoot_new ../gwt-14/");
+ sb.append("\n");
+ sb.append("sourceFiles_new dev/core:user/super:user/src");
+ sb.append("\n");
+ sb.append("excludeFiles_new user/super/com/google/gwt/junit");
+ sb.append("\n\n");
+
+ System.err.println(sb.toString());
+ }
+
+ protected JarFile getJarFromString(String str) {
+ try {
+ return new JarFile(str);
+ } catch (IOException ex) {
+ System.err.println("exception in getting jar from name "
+ + ex.getMessage());
+ return null;
+ }
+ }
+
+ protected void setPropertiesAndWhitelist(String fileName)
+ throws IllegalArgumentException {
+ try {
+ // load config properties
+ FileInputStream fis = new FileInputStream(fileName);
+ configProperties = new Properties();
+ configProperties.load(fis);
+ fis.close();
+
+ // load whitelist
+ FileReader fr = new FileReader(fileName);
+ whiteList = readWhiteListFromFile(fr);
+ fr.close();
+ } catch (IOException ex) {
+ System.err.println("Have you specified the path of the config file correctly?");
+ throw new IllegalArgumentException(ex);
+ }
+ }
+
+ private Set<String> getConfigPropertyAsSet(String key) {
+ Set<String> set = new HashSet<String>();
+ String propertyValue = configProperties.getProperty(key);
+ if (propertyValue == null) {
+ return set;
+ }
+ for (String element : propertyValue.split(":")) {
+ element = element.trim();
+ set.add(element);
+ }
+ return set;
+ }
+
+ private Set<CompilationUnit> getGwtCompilationUnits(TreeLogger logger)
+ throws FileNotFoundException, IOException, NotFoundException,
+ UnableToCompleteException {
+ Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+ if (gwtDevJar == null || gwtUserJar == null) {
+ if (gwtDevJar != null) {
+ System.err.println("Argument gwtUserJar must be provided for gwtDevJar to be used");
+ }
+ if (gwtUserJar != null) {
+ System.err.println("Argument gwtDevJar must be provided for gwtUserJar to be used");
+ }
+ return units;
+ }
+ // gwt-user.jar
+ Set<String> gwtIncludedPaths = new HashSet<String>(
+ Arrays.asList(new String[] {"com/google/gwt"}));
+ Set<String> gwtExcludedPaths = new HashSet<String>(
+ Arrays.asList(new String[] {
+ "com/google/gwt/benchmarks",
+ "com/google/gwt/i18n/rebind",
+ "com/google/gwt/i18n/tools",
+ "com/google/gwt/json",
+ "com/google/gwt/junit",
+ "com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java",
+ "com/google/gwt/user/rebind", "com/google/gwt/user/server",
+ "com/google/gwt/user/tools",}));
+ CompilationUnits cu = new JarFileCompilationUnits(
+ new JarFile[] {gwtUserJar}, gwtIncludedPaths, gwtExcludedPaths, logger);
+ units.addAll(cu.getCompilationUnits());
+
+ // gwt-dev-*.jar
+ gwtIncludedPaths = new HashSet<String>(Arrays.asList(new String[] {
+ "com/google/gwt/core/client",
+ "com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang",
+ "com/google/gwt/lang",}));
+ cu = new JarFileCompilationUnits(new JarFile[] {gwtDevJar},
+ gwtIncludedPaths, null, logger);
+ units.addAll(cu.getCompilationUnits());
+ return units;
+ }
+
+ /*
+ * excludedPackages is used in only one place: to determine whether some class
+ * is an api class or not
+ */
+ private Set<String> getSetOfExcludedPackages(Properties config) {
+ String allExcludedPackages = config.getProperty("excludedPackages");
+ if (allExcludedPackages == null) {
+ allExcludedPackages = "";
+ }
+ String excludedPackagesArray[] = allExcludedPackages.split(":");
+ return new HashSet<String>(Arrays.asList(excludedPackagesArray));
+ }
+
/**
* Each whiteList element is an {@link ApiElement} and
* {@link ApiChange.Status} separated by space. For example,
@@ -252,13 +884,8 @@
* method on {@link ApiElement}.
*
*/
- private static Set<String> readWhiteListFromFile(String fileName)
- throws IOException {
- if (fileName == null) {
- throw new IllegalArgumentException("fileName is null");
- }
+ private Set<String> readWhiteListFromFile(FileReader fr) throws IOException {
Set<String> hashSet = new HashSet<String>();
- FileReader fr = new FileReader(fileName);
BufferedReader br = new BufferedReader(fr);
String str = null;
while ((str = br.readLine()) != null) {
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java
index 8aeb887..40319b4 100644
--- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java
+++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java
@@ -27,26 +27,17 @@
import com.google.gwt.dev.javac.CompilationUnitInvalidator;
import com.google.gwt.dev.javac.JdtCompiler;
import com.google.gwt.dev.javac.TypeOracleMediator;
-import com.google.gwt.dev.javac.impl.FileCompilationUnit;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import java.io.FileReader;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
-import java.util.Vector;
/**
* {@link ApiContainer} Encapsulates an API.
@@ -57,91 +48,32 @@
private final Map<JClassType, Boolean> apiClassCache = new HashMap<JClassType, Boolean>();
private final Map<String, ApiPackage> apiPackages = new HashMap<String, ApiPackage>();
- private final Set<String> excludedFiles = new HashSet<String>();
- private final Set<String> excludedPackages = new HashSet<String>();
+ private final Set<String> excludedPackages;
private final TreeLogger logger;
-
private final String name;
- private int numFilesCount = 0;
- private Collection<File> sourceTrees = null;
private final TypeOracle typeOracle;
/**
- * A public constructor to create an {@code ApiContainer} from a config file.
+ * A public constructor used for programmatic invocation and testing.
*
- * @param fileName the config file
- * @param suffix The code looks for the values of the properties: dirRoot,
- * name, sourceFiles, excludedFiles, ending in "suffix"
- * @param logger The logger for the code.
+ * @param name Api name
+ * @param units a set of CompilationUnits
+ * @param excludedPackages a set of excludedPackages
+ * @param logger TreeLogger for logging messages
* @throws IllegalArgumentException if one of the arguments is illegal
* @throws UnableToCompleteException if there is a TypeOracle exception
*/
- public ApiContainer(String fileName, String suffix, TreeLogger logger)
- throws IllegalArgumentException, UnableToCompleteException {
+ ApiContainer(String name, Set<CompilationUnit> units,
+ Set<String> excludedPackages, TreeLogger logger)
+ throws UnableToCompleteException {
+ this.name = name;
this.logger = logger;
- FileInputStream fis = null;
- if (fileName == null) {
- throw new IllegalArgumentException("fileName is null");
- }
+ logger.log(TreeLogger.INFO, "name = " + name + ", units.size = " + units.size(), null);
try {
- fis = new FileInputStream(fileName);
- Properties config = new Properties();
- config.load(fis);
- String apiName = config.getProperty("name" + suffix);
- String allSourceFiles = config.getProperty("sourceFiles" + suffix);
- String allExcludedFiles = config.getProperty("excludedFiles" + suffix);
- if (allExcludedFiles == null) {
- allExcludedFiles = "";
- }
- String allExcludedPackages = config.getProperty("excludedPackages");
- if (allExcludedPackages == null) {
- allExcludedPackages = "";
- }
-
- if (apiName == null || allSourceFiles == null) {
- throw new IllegalArgumentException(
- "in apiContainer constructor, either name (" + apiName
- + ") or sourceFiles (" + allSourceFiles + ") is null");
- }
- logger.log(TreeLogger.DEBUG, "read from config file " + fileName
- + ", name = " + apiName + ", allSourceFiles = " + allSourceFiles
- + ", allExcludedFiles = " + allExcludedFiles
- + ", allExcludedPackages = " + allExcludedPackages, null);
-
- String dirRoot = config.getProperty("dirRoot" + suffix);
- if (dirRoot == null) {
- dirRoot = "";
- }
- String sourceFilesArray[] = allSourceFiles.split(":");
- Collection<File> fileCollection = new Vector<File>();
- for (String tempStr : sourceFilesArray) {
- tempStr = tempStr.trim();
- checkFileExistence("source file: ", dirRoot + tempStr);
- fileCollection.add(new File(dirRoot + tempStr));
- }
- logger.log(TreeLogger.DEBUG, "fileCollection " + fileCollection, null);
- this.sourceTrees = fileCollection;
-
- String excludedFilesArray[] = allExcludedFiles.split(":");
- for (String excludedFile : excludedFilesArray) {
- checkFileExistence("excluded file: ", dirRoot + excludedFile);
- }
- generateCanonicalFileSet(excludedFilesArray, dirRoot, excludedFiles);
-
- String excludedPackagesArray[] = allExcludedPackages.split(":");
- excludedPackages.addAll(Arrays.asList(excludedPackagesArray));
- this.name = apiName;
- this.typeOracle = createTypeOracleFromSources();
- initializeApiPackages();
- } catch (MalformedURLException e1) {
- throw new IllegalArgumentException(e1);
+ this.typeOracle = getTypeOracleFromCompilationUnits(units);
} catch (FileNotFoundException e2) {
- if (fis == null) {
- System.err.println("Have you specified the path of the config file correctly?");
- } else {
- System.err.println("Do you have a reference version of the API checked out?");
- }
+ System.err.println("Do you have a reference version of the API checked out?");
throw new IllegalArgumentException(e2);
} catch (IOException e3) {
throw new IllegalArgumentException(e3);
@@ -149,19 +81,7 @@
logger.log(TreeLogger.ERROR, "logged a NotFoundException", e4);
throw new UnableToCompleteException();
}
- }
-
- /**
- * Another public constructor. Used for programmatic invocation and testing.
- *
- * @param name
- * @param logger
- * @param typeOracle
- */
- ApiContainer(String name, TreeLogger logger, TypeOracle typeOracle) {
- this.name = name;
- this.logger = logger;
- this.typeOracle = typeOracle;
+ this.excludedPackages = excludedPackages;
initializeApiPackages();
}
@@ -241,65 +161,6 @@
return isApiClass(classType) && isSubclassable(classType);
}
- private void addCompilationUnitsInPath(Set<CompilationUnit> units,
- File sourcePathEntry) throws NotFoundException, IOException,
- UnableToCompleteException {
- logger.log(TreeLogger.SPAM, "entering addCompilationUnitsInPath, file = "
- + sourcePathEntry, null);
- File[] files = sourcePathEntry.listFiles();
- if (files == null) {
- // No files found.
- return;
- }
-
- for (int i = 0; i < files.length; i++) {
- final File file = files[i];
- logger.log(TreeLogger.SPAM, "deciding the fate of file " + file, null);
- // Ignore files like .svn and .cvs
- if (file.getName().startsWith(".") || file.getName().equals("CVS")) {
- continue;
- }
- if (isExcludedFile(file.getCanonicalPath())) {
- // do not process the subtree
- logger.log(TreeLogger.DEBUG, "not traversing "
- + file.toURL().toString(), null);
- continue;
- }
- if (file.isFile()) {
- String pkgName = null;
- if (file.getName().endsWith("java")) {
- pkgName = extractPackageNameFromFile(file);
- if (pkgName == null) {
- logger.log(TreeLogger.WARN, "Not adding file = " + file.toString()
- + ", because packageName = null", null);
- } else {
- logger.log(TreeLogger.DEBUG, "adding pkgName = " + pkgName
- + ", file = " + file.toString(), null);
- }
- }
- if (isValidPackage(pkgName, sourcePathEntry.toURL().toString())) {
- // Add if it's a source file and the package and fileNames are okay
- CompilationUnit unit = new FileCompilationUnit(file, pkgName);
- units.add(unit);
- numFilesCount++;
- } else {
- logger.log(TreeLogger.SPAM, " not adding file " + file.toURL(), null);
- }
- } else {
- // Recurse into subDirs
- addCompilationUnitsInPath(units, file);
- }
- }
- }
-
- private void checkFileExistence(String tag, String pathName)
- throws FileNotFoundException {
- File tempFile = new File(pathName);
- if (!tempFile.exists()) {
- throw new FileNotFoundException(tag + "file " + pathName + " not found");
- }
- }
-
/**
* Assumption: Clients may subclass an API class, but they will not add their
* class to the package.
@@ -330,13 +191,9 @@
return false;
}
- private TypeOracle createTypeOracleFromSources() throws NotFoundException,
- IOException, UnableToCompleteException {
- numFilesCount = 0;
- Set<CompilationUnit> units = new HashSet<CompilationUnit>();
- for (File tempFile : sourceTrees) {
- addCompilationUnitsInPath(units, tempFile);
- }
+ private TypeOracle getTypeOracleFromCompilationUnits(
+ Set<CompilationUnit> units) throws NotFoundException, IOException,
+ UnableToCompleteException {
JdtCompiler.compile(units);
if (CompilationUnitInvalidator.invalidateUnitsWithErrors(logger, units)) {
logger.log(TreeLogger.ERROR, "Unable to build typeOracle for "
@@ -347,55 +204,11 @@
TypeOracleMediator mediator = new TypeOracleMediator();
mediator.refresh(logger, units);
logger.log(TreeLogger.INFO, "API " + name
- + ", Finished with building typeOracle, added " + numFilesCount
+ + ", Finished with building typeOracle, added " + units.size()
+ " files", null);
return mediator.getTypeOracle();
}
- private String extractPackageNameFromFile(File file) {
- if (!file.exists()) {
- return null;
- }
- String fileName = null;
- try {
- fileName = file.toURL().toString();
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- String str = null;
- while ((str = br.readLine()) != null) {
- if (str.indexOf("package") != 0) {
- continue;
- }
- String parts[] = str.split("[\b\t\n\r ]+");
- if ((parts.length == 2) && parts[0].equals("package")) {
- return parts[1].substring(0, parts[1].length() - 1); // the ; char
- }
- }
- return null;
- } catch (Exception ex) {
- logger.log(TreeLogger.ERROR,
- "error in parsing and obtaining the packageName from file "
- + fileName + "error's message " + ex.getMessage(), ex);
- return null;
- }
- }
-
- /**
- * Convert a set into a HashMap for faster lookups.
- */
- private void generateCanonicalFileSet(String strArray[], String dirRoot,
- Set<String> result) throws IOException {
- if (strArray == null) {
- return;
- }
- for (String str : strArray) {
- str = str.trim();
- File tempFile = new File(dirRoot + str);
- str = tempFile.getCanonicalPath();
- result.add(str);
- }
- }
-
private boolean hasPublicOrProtectedConstructor(JClassType classType) {
JConstructor[] constructors = classType.getConstructors();
for (JConstructor constructor : constructors) {
@@ -431,6 +244,8 @@
}
}
+
+
private boolean isAnySubtypeAnApiClass(JClassType classType) {
JClassType subTypes[] = classType.getSubtypes();
for (JClassType tempType : subTypes) {
@@ -469,14 +284,6 @@
return false;
}
- private boolean isExcludedFile(String fileName) {
- String pattern = "file:";
- if (fileName.indexOf(pattern) == 0) {
- fileName = fileName.substring(pattern.length());
- }
- return excludedFiles.contains(fileName);
- }
-
/**
* @return returns true if classType is public AND an outer class
*/
@@ -488,20 +295,4 @@
return !classType.isFinal() && hasPublicOrProtectedConstructor(classType);
}
- private boolean isValidPackage(String packageName, String filePath) {
- logger.log(TreeLogger.SPAM, "packageName = " + packageName
- + ", filePath = " + filePath, null);
- if (packageName == null) {
- return false;
- }
- int lastSlashPosition = filePath.lastIndexOf("/");
- if (lastSlashPosition == -1) {
- return false;
- }
- String dirPath = filePath.substring(0, lastSlashPosition);
- String packageNameAsPath = packageName.replace('.', '/');
- logger.log(TreeLogger.SPAM, "packageNameAsPath " + packageNameAsPath
- + ", dirPath = " + dirPath, null);
- return dirPath.endsWith(packageNameAsPath);
- }
}
diff --git a/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiCompatibilityTest.java b/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiCompatibilityTest.java
index cc4cba9..54117a9 100644
--- a/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiCompatibilityTest.java
+++ b/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiCompatibilityTest.java
@@ -18,12 +18,14 @@
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
+import com.google.gwt.dev.javac.CompilationUnit;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
-import com.google.gwt.tools.apichecker.ApiContainerTest.StaticCompilationUnit;
+import com.google.gwt.tools.apichecker.ApiCompatibilityChecker.StaticCompilationUnit;
import junit.framework.TestCase;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
@@ -59,7 +61,7 @@
getSourceForRuntimeException()),};
}
- private static char[] getSourceForApiClass() {
+ private static String getSourceForApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("public class ApiClass extends NonApiClass {\n");
@@ -67,10 +69,10 @@
sb.append("\tpublic void checkParametersAndReturnTypes(java.lang.Object x) throws java.lang.Throwable { };\n");
sb.append("\tpublic final void checkParametersAndReturnTypesFinalVersion(java.lang.Object x) throws java.lang.Throwable { };\n");
sb.append("};\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForNonApiClass() {
+ private static String getSourceForNonApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("class NonApiClass extends java.lang.Object {\n");
@@ -81,10 +83,10 @@
sb.append("\tprotected ApiClassInNonApiClass() { }\n");
sb.append("\t}\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForObject() {
+ private static String getSourceForObject() {
StringBuffer sb = new StringBuffer();
sb.append("package java.lang;\n");
sb.append("public class Object {\n");
@@ -97,10 +99,10 @@
sb.append("\tprivate int internalField = 0;\n");
sb.append("\tprotected static int protectedField=2;\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForOneMoreApiClass() {
+ private static String getSourceForOneMoreApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("public class OneMoreApiClass extends java.lang.Object {\n");
@@ -108,32 +110,32 @@
sb.append("\tprotected final void checkOverloadedMethodAccounted(test.apicontainer.ApiClass b) throws java.lang.Throwable { }\n");
sb.append("\tpublic void testUncheckedExceptions() throws RuntimeException { }\n");
sb.append("};\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForRuntimeException() {
+ private static String getSourceForRuntimeException() {
StringBuffer sb = new StringBuffer();
sb.append("package java.lang;\n");
sb.append("public class RuntimeException extends Throwable {\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForTestClass() {
+ private static String getSourceForTestClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.nonapipackage;\n");
sb.append("class TestClass extends java.lang.Object {\n");
sb.append("\tpublic void method() { }\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForThrowable() {
+ private static String getSourceForThrowable() {
StringBuffer sb = new StringBuffer();
sb.append("package java.lang;\n");
sb.append("public class Throwable extends Object {\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
ApiContainer api1 = null;
@@ -145,15 +147,14 @@
AbstractTreeLogger logger = new PrintWriterTreeLogger();
logger.setMaxDetail(TreeLogger.ERROR);
- api1 = new ApiContainer("Api1", logger,
- ApiContainerTest.getNewTypeOracleFromCompilationUnits(
- ApiContainerTest.getScuArray(), logger));
- apiSameAs1 = new ApiContainer("Api2", logger,
- ApiContainerTest.getNewTypeOracleFromCompilationUnits(
- ApiContainerTest.getScuArray(), logger));
- api2 = new ApiContainer("Api2", logger,
- ApiContainerTest.getNewTypeOracleFromCompilationUnits(getScuArray(),
- logger));
+ api1 = new ApiContainer("Api1", new HashSet<CompilationUnit>(
+ Arrays.asList(ApiContainerTest.getScuArray())), new HashSet<String>(),
+ logger);
+ apiSameAs1 = new ApiContainer("ApiSameAs1", new HashSet<CompilationUnit>(
+ Arrays.asList(ApiContainerTest.getScuArray())), new HashSet<String>(),
+ logger);
+ api2 = new ApiContainer("Api2", new HashSet<CompilationUnit>(
+ Arrays.asList(getScuArray())), new HashSet<String>(), logger);
}
// setup is called before every test*. To avoid the overhead of setUp() each
diff --git a/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java b/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java
index bf21c88..8bba24c 100644
--- a/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java
+++ b/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java
@@ -17,12 +17,10 @@
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JAbstractMethod;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.dev.javac.CompilationUnit;
-import com.google.gwt.dev.javac.JdtCompiler;
-import com.google.gwt.dev.javac.TypeOracleMediator;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.tools.apichecker.ApiCompatibilityChecker.StaticCompilationUnit;
import junit.framework.TestCase;
@@ -31,51 +29,10 @@
import java.util.Set;
/**
- * Test ApiContainer.
+ * Test {@link ApiContainer}.
*/
public class ApiContainerTest extends TestCase {
- static class StaticCompilationUnit extends CompilationUnit {
- private final char[] source;
- private final String typeName;
-
- public StaticCompilationUnit(String typeName, char[] source) {
- this.typeName = typeName;
- this.source = source;
- }
-
- @Override
- public String getDisplayLocation() {
- return "/mock/" + typeName;
- }
-
- @Override
- public long getLastModified() {
- return 0;
- }
-
- @Override
- public String getSource() {
- return String.valueOf(source);
- }
-
- @Override
- public String getTypeName() {
- return typeName;
- }
-
- @Override
- public boolean isGenerated() {
- return false;
- }
-
- @Override
- public boolean isSuperSource() {
- return false;
- }
- }
-
- @SuppressWarnings("unused")
class TestA {
public TestA(String args) {
}
@@ -104,19 +61,6 @@
}
}
- // TODO (amitmanjhi): Try using UnitTestTreeLogger to capture log messages
- public static TypeOracle getNewTypeOracleFromCompilationUnits(
- StaticCompilationUnit tempScuArray[], AbstractTreeLogger logger)
- throws UnableToCompleteException {
-
- TypeOracleMediator mediator = new TypeOracleMediator();
- Set<CompilationUnit> units = new HashSet<CompilationUnit>(
- Arrays.asList(tempScuArray));
- JdtCompiler.compile(units);
- mediator.refresh(logger, units);
- return mediator.getTypeOracle();
- }
-
public static StaticCompilationUnit[] getScuArray() {
return new StaticCompilationUnit[] {
new StaticCompilationUnit("test.apicontainer.ApiClass",
@@ -136,7 +80,7 @@
new ApiAbstractMethod[0])[0]).getMethod();
}
- private static char[] getSourceForApiClass() {
+ private static String getSourceForApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("public class ApiClass extends NonApiClass {\n");
@@ -144,10 +88,10 @@
sb.append("\tpublic java.lang.Object checkParametersAndReturnTypes(ApiClass a) { return this; };\n");
sb.append("\tpublic final java.lang.Object checkParametersAndReturnTypesFinalVersion(ApiClass a) { return this; };\n");
sb.append("};\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForNewObject() {
+ private static String getSourceForNewObject() {
StringBuffer sb = new StringBuffer();
sb.append("package java.lang;\n");
sb.append("public class Object {\n");
@@ -156,10 +100,10 @@
sb.append("}\n");
sb.append("class Temp {\n");
sb.append("}");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForNonApiClass() {
+ private static String getSourceForNonApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("class NonApiClass extends java.lang.Object {\n");
@@ -172,10 +116,10 @@
sb.append("\tprivate AnotherApiClassInNonApiClass() { }\n");
sb.append("\t}\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForObject() {
+ private static String getSourceForObject() {
StringBuffer sb = new StringBuffer();
sb.append("package java.lang;\n");
sb.append("public class Object {\n");
@@ -189,33 +133,33 @@
sb.append("\tprivate int internalField = 0;\n");
sb.append("\tprotected int protectedField=2;\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForOneMoreApiClass() {
+ private static String getSourceForOneMoreApiClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.apicontainer;\n");
sb.append("public class OneMoreApiClass extends java.lang.Object {\n");
sb.append("\tprotected final void checkOverloadedMethodAccounted(test.apicontainer.OneMoreApiClass b) { }\n");
sb.append("\tpublic void testUncheckedExceptions () { }\n");
sb.append("};\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForTest() {
+ private static String getSourceForTest() {
StringBuffer sb = new StringBuffer();
sb.append("package java.newpackage;\n");
sb.append("public class Test { }\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
- private static char[] getSourceForTestClass() {
+ private static String getSourceForTestClass() {
StringBuffer sb = new StringBuffer();
sb.append("package test.nonapipackage;\n");
sb.append("class TestClass extends java.lang.Object {\n");
sb.append("\tpublic void method() { }\n");
sb.append("}\n");
- return sb.toString().toCharArray();
+ return sb.toString();
}
ApiContainer apiCheck = null;
@@ -230,13 +174,15 @@
public void setUp() throws UnableToCompleteException {
AbstractTreeLogger logger = new PrintWriterTreeLogger();
logger.setMaxDetail(com.google.gwt.core.ext.TreeLogger.ERROR);
- apiCheckLoop = new ApiContainer("ApiClassTest", logger,
- getNewTypeOracleFromCompilationUnits(
- new StaticCompilationUnit[] {new StaticCompilationUnit(
- "java.lang.Object", getSourceForNewObject()),}, logger));
-
- apiCheck = new ApiContainer("ApiContainerTest", logger,
- getNewTypeOracleFromCompilationUnits(getScuArray(), logger));
+ apiCheckLoop = new ApiContainer(
+ "ApiClassTest",
+ new HashSet<CompilationUnit>(
+ Arrays.asList(new StaticCompilationUnit[] {new StaticCompilationUnit(
+ "java.lang.Object", getSourceForNewObject()),})),
+ new HashSet<String>(), logger);
+ apiCheck = new ApiContainer("ApiContainerTest",
+ new HashSet<CompilationUnit>(Arrays.asList(getScuArray())),
+ new HashSet<String>(), logger);
}
public void testEverything() {
diff --git a/user/build.xml b/user/build.xml
index 6bc6113..0539253 100755
--- a/user/build.xml
+++ b/user/build.xml
@@ -78,7 +78,7 @@
<target name="remoteweb-test" description="Run a remoteweb test at the given host and path" if="gwt.remote.browsers">
<echo message="Performing remote browser testing at ${gwt.remote.browsers}" />
- <gwt.junit test.args="${test.args} -out www -workDir ${junit.out}/remoteweb/workdir -remoteweb ${gwt.remote.browsers}" test.out="${junit.out}/remoteweb" test.cases="default.web.tests" >
+ <gwt.junit test.args="${test.args} -out www -remoteweb ${gwt.remote.browsers}" test.out="${junit.out}/remoteweb" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
@@ -87,7 +87,7 @@
<target name="selenium-test" description="Run a remote test using Selenium RC test at the given host and path" if="gwt.selenium.hosts">
<echo message="Performing remote browser testing using Selenium RC at ${gwt.selenium.hosts}" />
- <gwt.junit test.args="${test.args} -out www -workDir ${junit.out}/selenium/workdir -selenium ${gwt.selenium.hosts}" test.out="${junit.out}/selenium" test.cases="default.web.tests" >
+ <gwt.junit test.args="${test.args} -out www -selenium ${gwt.selenium.hosts}" test.out="${junit.out}/selenium" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
@@ -95,7 +95,7 @@
</target>
<target name="test.hosted" depends="compile, compile.tests" description="Run only hosted-mode tests for this project.">
- <gwt.junit test.args="${test.args} -workDir ${junit.out}/${build.host.platform}-hosted-mode/workdir" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.tests" >
+ <gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
@@ -103,7 +103,7 @@
</target>
<target name="test.web" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
- <gwt.junit test.args="${test.args} -out www -workDir ${junit.out}/${build.host.platform}-web-mode/workdir -web" test.out="${junit.out}/${build.host.platform}-web-mode" test.cases="default.web.tests" >
+ <gwt.junit test.args="${test.args} -out www -web" test.out="${junit.out}/${build.host.platform}-web-mode" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
diff --git a/user/javadoc/com/google/gwt/examples/DateBoxExample.java b/user/javadoc/com/google/gwt/examples/DateBoxExample.java
new file mode 100644
index 0000000..8e65035
--- /dev/null
+++ b/user/javadoc/com/google/gwt/examples/DateBoxExample.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.examples;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.datepicker.client.DateBox;
+
+import java.util.Date;
+
+public class DateBoxExample implements EntryPoint {
+
+ public void onModuleLoad() {
+ DateBox dateBox = new DateBox();
+ dateBox.setValue(new Date());
+ RootPanel.get().add(dateBox);
+ }
+}
diff --git a/user/javadoc/com/google/gwt/examples/DatePickerExample.java b/user/javadoc/com/google/gwt/examples/DatePickerExample.java
new file mode 100644
index 0000000..88adac9
--- /dev/null
+++ b/user/javadoc/com/google/gwt/examples/DatePickerExample.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.examples;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.datepicker.client.DatePicker;
+
+import java.util.Date;
+
+public class DatePickerExample implements EntryPoint {
+
+ public void onModuleLoad() {
+ // Create a date picker
+ DatePicker datePicker = new DatePicker();
+ final Label text = new Label();
+
+ // Set the value in the text box when the user selects a date
+ datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ Date date = event.getValue();
+ String dateString = DateTimeFormat.getMediumDateFormat().format(date);
+ text.setText(dateString);
+ }
+ });
+
+ // Set the default value
+ datePicker.setValue(new Date(), true);
+
+ // Add the widgets to the page
+ RootPanel.get().add(text);
+ RootPanel.get().add(datePicker);
+ }
+}
diff --git a/user/javadoc/com/google/gwt/examples/LazyPanelExample.java b/user/javadoc/com/google/gwt/examples/LazyPanelExample.java
index 6dead55..a340bda 100644
--- a/user/javadoc/com/google/gwt/examples/LazyPanelExample.java
+++ b/user/javadoc/com/google/gwt/examples/LazyPanelExample.java
@@ -26,10 +26,7 @@
public class LazyPanelExample implements EntryPoint {
- /**
- * A friendly little LazyPanel.
- */
- static class HelloLazy extends LazyPanel {
+ private static class HelloLazyPanel extends LazyPanel {
@Override
protected Widget createWidget() {
return new Label("Well hello there!");
@@ -37,7 +34,10 @@
}
public void onModuleLoad() {
- final Widget lazy = new HelloLazy();
+ final Widget lazy = new HelloLazyPanel();
+
+ // Not strictly necessary, but keeps the empty outer div
+ // from effecting layout before it is of any use
lazy.setVisible(false);
PushButton b = new PushButton("Click me");
diff --git a/user/src/com/google/gwt/core/public/history.html b/user/src/com/google/gwt/core/public/history.html
deleted file mode 100644
index b06f46a..0000000
--- a/user/src/com/google/gwt/core/public/history.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<head>
-<script>
-function hst() {
- var search = location.search;
- var historyToken = '';
- if (search.length > 0)
- historyToken = search.substring(1);
-
- document.getElementById('__gwt_historyToken').value = historyToken;
- if (parent.__gwt_onHistoryLoad) {
- parent.__gwt_onHistoryLoad(historyToken);
- }
-}
-</script></head>
-<body onload='hst()'>
-
-<input type='text' id='__gwt_historyToken' tabIndex='-1'>
-
-</body>
-</html>
diff --git a/user/src/com/google/gwt/dom/client/DOMImplIE6.java b/user/src/com/google/gwt/dom/client/DOMImplIE6.java
index 14baeb8..36fad77 100644
--- a/user/src/com/google/gwt/dom/client/DOMImplIE6.java
+++ b/user/src/com/google/gwt/dom/client/DOMImplIE6.java
@@ -41,13 +41,15 @@
@Override
public native int getAbsoluteLeft(Element elem) /*-{
- return elem.getBoundingClientRect().left +
+ return (elem.getBoundingClientRect().left /
+ this.@com.google.gwt.dom.client.DOMImplIE6::getZoomMultiple()()) +
@com.google.gwt.user.client.impl.DocumentRootImpl::documentRoot.scrollLeft;
}-*/;
@Override
public native int getAbsoluteTop(Element elem) /*-{
- return elem.getBoundingClientRect().top +
+ return (elem.getBoundingClientRect().top /
+ this.@com.google.gwt.dom.client.DOMImplIE6::getZoomMultiple()()) +
@com.google.gwt.user.client.impl.DocumentRootImpl::documentRoot.scrollTop;
}-*/;
@@ -112,4 +114,15 @@
public native void setInnerText(Element elem, String text) /*-{
elem.innerText = text || '';
}-*/;
+
+ /**
+ * Get the zoom multiple based on the current IE zoom level. A multiple of
+ * 2.0 means that the user has zoomed in to 200%.
+ *
+ * @return the zoom multiple
+ */
+ @SuppressWarnings("unused")
+ private native double getZoomMultiple() /*-{
+ return $doc.body.parentElement.offsetWidth / $doc.body.offsetWidth;
+ }-*/;
}
diff --git a/user/src/com/google/gwt/event/dom/client/HasBlurHandlers.java b/user/src/com/google/gwt/event/dom/client/HasBlurHandlers.java
index 2892059..ba7b7d8 100644
--- a/user/src/com/google/gwt/event/dom/client/HasBlurHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasBlurHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link BlurHandler} instances.
*/
-public interface HasBlurHandlers {
+public interface HasBlurHandlers extends HasHandlers {
/**
* Adds a {@link BlurEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasChangeHandlers.java b/user/src/com/google/gwt/event/dom/client/HasChangeHandlers.java
index 8b9b8da..c037892 100644
--- a/user/src/com/google/gwt/event/dom/client/HasChangeHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasChangeHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link ChangeHandler} instances.
*/
-public interface HasChangeHandlers {
+public interface HasChangeHandlers extends HasHandlers {
/**
* Adds a {@link ChangeEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasClickHandlers.java b/user/src/com/google/gwt/event/dom/client/HasClickHandlers.java
index 26c1a9a..cdc6ce3 100644
--- a/user/src/com/google/gwt/event/dom/client/HasClickHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasClickHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link ClickHandler} instances.
*/
-public interface HasClickHandlers {
+public interface HasClickHandlers extends HasHandlers {
/**
* Adds a {@link ClickEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasContextMenuHandlers.java b/user/src/com/google/gwt/event/dom/client/HasContextMenuHandlers.java
index 669ed5d..5ed947d 100644
--- a/user/src/com/google/gwt/event/dom/client/HasContextMenuHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasContextMenuHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link ContextMenuHandler} instances.
*/
-public interface HasContextMenuHandlers {
+public interface HasContextMenuHandlers extends HasHandlers {
/**
* Adds a {@link ContextMenuEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasDoubleClickHandlers.java b/user/src/com/google/gwt/event/dom/client/HasDoubleClickHandlers.java
index 35f6d7b..646294b 100644
--- a/user/src/com/google/gwt/event/dom/client/HasDoubleClickHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasDoubleClickHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link DoubleClickHandler} instances.
*/
-public interface HasDoubleClickHandlers {
+public interface HasDoubleClickHandlers extends HasHandlers {
/**
* Adds a {@link DoubleClickEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasErrorHandlers.java b/user/src/com/google/gwt/event/dom/client/HasErrorHandlers.java
index 00b741c..3d4b473 100644
--- a/user/src/com/google/gwt/event/dom/client/HasErrorHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasErrorHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link ErrorHandler} instances.
*/
-public interface HasErrorHandlers {
+public interface HasErrorHandlers extends HasHandlers {
/**
* Adds a {@link ErrorEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasFocusHandlers.java b/user/src/com/google/gwt/event/dom/client/HasFocusHandlers.java
index a7d3dfd..6c19dc2 100644
--- a/user/src/com/google/gwt/event/dom/client/HasFocusHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasFocusHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link FocusHandler} instances.
*/
-public interface HasFocusHandlers {
+public interface HasFocusHandlers extends HasHandlers {
/**
* Adds a {@link FocusEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasKeyDownHandlers.java b/user/src/com/google/gwt/event/dom/client/HasKeyDownHandlers.java
index 5d584d7..6736da6 100644
--- a/user/src/com/google/gwt/event/dom/client/HasKeyDownHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasKeyDownHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link KeyDownHandler} instances.
*/
-public interface HasKeyDownHandlers {
+public interface HasKeyDownHandlers extends HasHandlers {
/**
* Adds a {@link KeyDownEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasKeyPressHandlers.java b/user/src/com/google/gwt/event/dom/client/HasKeyPressHandlers.java
index 7d55449..1fd5cfd 100644
--- a/user/src/com/google/gwt/event/dom/client/HasKeyPressHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasKeyPressHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link KeyPressHandler} instances.
*/
-public interface HasKeyPressHandlers {
+public interface HasKeyPressHandlers extends HasHandlers {
/**
* Adds a {@link KeyPressEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasKeyUpHandlers.java b/user/src/com/google/gwt/event/dom/client/HasKeyUpHandlers.java
index 0b6bc92..3e95ac9 100644
--- a/user/src/com/google/gwt/event/dom/client/HasKeyUpHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasKeyUpHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link KeyUpHandler} instances.
*/
-public interface HasKeyUpHandlers {
+public interface HasKeyUpHandlers extends HasHandlers {
/**
* Adds a {@link KeyUpEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasLoadHandlers.java b/user/src/com/google/gwt/event/dom/client/HasLoadHandlers.java
index efe2892..20903cd 100644
--- a/user/src/com/google/gwt/event/dom/client/HasLoadHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasLoadHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link LoadHandler} instances.
*/
-public interface HasLoadHandlers {
+public interface HasLoadHandlers extends HasHandlers {
/**
* Adds a {@link LoadEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasLoseCaptureHandlers.java b/user/src/com/google/gwt/event/dom/client/HasLoseCaptureHandlers.java
index dac1c4b..48b6a72 100644
--- a/user/src/com/google/gwt/event/dom/client/HasLoseCaptureHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasLoseCaptureHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link LoseCaptureHandler} instances.
*/
-public interface HasLoseCaptureHandlers {
+public interface HasLoseCaptureHandlers extends HasHandlers {
/**
* Adds a {@link LoseCaptureEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseDownHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseDownHandlers.java
index 71853a1..ea99a82 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseDownHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseDownHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseDownHandler} instances.
*/
-public interface HasMouseDownHandlers {
+public interface HasMouseDownHandlers extends HasHandlers {
/**
* Adds a {@link MouseDownEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseMoveHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseMoveHandlers.java
index 90f6e55..19168b7 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseMoveHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseMoveHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseMoveHandler} instances.
*/
-public interface HasMouseMoveHandlers {
+public interface HasMouseMoveHandlers extends HasHandlers {
/**
* Adds a {@link MouseMoveEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseOutHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseOutHandlers.java
index e993c67..e4cf37a 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseOutHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseOutHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseOutHandler} instances.
*/
-public interface HasMouseOutHandlers {
+public interface HasMouseOutHandlers extends HasHandlers {
/**
* Adds a {@link MouseOutEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseOverHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseOverHandlers.java
index dab97b6..acc52b7 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseOverHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseOverHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseOverHandler} instances.
*/
-public interface HasMouseOverHandlers {
+public interface HasMouseOverHandlers extends HasHandlers {
/**
* Adds a {@link MouseOverEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseUpHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseUpHandlers.java
index e04a391..b9f0bc4 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseUpHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseUpHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseUpHandler} instances.
*/
-public interface HasMouseUpHandlers {
+public interface HasMouseUpHandlers extends HasHandlers {
/**
* Adds a {@link MouseUpEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/HasMouseWheelHandlers.java b/user/src/com/google/gwt/event/dom/client/HasMouseWheelHandlers.java
index 7aaaa41..b681162 100644
--- a/user/src/com/google/gwt/event/dom/client/HasMouseWheelHandlers.java
+++ b/user/src/com/google/gwt/event/dom/client/HasMouseWheelHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.dom.client;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface provides registration for
* {@link MouseWheelHandler} instances.
*/
-public interface HasMouseWheelHandlers {
+public interface HasMouseWheelHandlers extends HasHandlers {
/**
* Adds a {@link MouseWheelEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/dom/client/KeyEvent.java b/user/src/com/google/gwt/event/dom/client/KeyEvent.java
index 6d73bdc..18e7d2c 100644
--- a/user/src/com/google/gwt/event/dom/client/KeyEvent.java
+++ b/user/src/com/google/gwt/event/dom/client/KeyEvent.java
@@ -36,6 +36,17 @@
}
/**
+ * Does this event have any modifier keys down? Specifically. is the control,
+ * meta, shift, or alt key currently pressed?
+ *
+ * @return whether this event have any modifier key down
+ */
+ public boolean isAnyModifierKeyDown() {
+ return isControlKeyDown() || isShiftKeyDown() || isMetaKeyDown()
+ || isAltKeyDown();
+ }
+
+ /**
* Gets the key-repeat state of this event.
*
* @return <code>true</code> if this key event was an auto-repeat
diff --git a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
index d81a715..556335a 100644
--- a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
@@ -36,14 +36,13 @@
* manager. If no such handlers exist, this method will do nothing.
*
* @param <I> the item type
- * @param <S> The event source type
* @param source the source of the handlers
* @param item the item
* @return the event so that the caller can check if it was canceled, or null
- * if no handlers of this event type have been registered
+ * if no handlers of this event type have been registered
*/
- public static <I, S extends HasBeforeSelectionHandlers<I> & HasHandlers> BeforeSelectionEvent<I> fire(
- S source, I item) {
+ public static <I> BeforeSelectionEvent<I> fire(
+ HasBeforeSelectionHandlers<I> source, I item) {
// If no handlers exist, then type can be null.
if (TYPE != null) {
HandlerManager handlers = source.getHandlers();
@@ -80,7 +79,7 @@
}
/**
- * Cancel the before selection event.
+ * Cancel the before selection event.
*
* Classes overriding this method should still call super.cancel().
*/
diff --git a/user/src/com/google/gwt/event/logical/shared/CloseEvent.java b/user/src/com/google/gwt/event/logical/shared/CloseEvent.java
index 25ceaba..c68536b 100644
--- a/user/src/com/google/gwt/event/logical/shared/CloseEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/CloseEvent.java
@@ -35,12 +35,10 @@
* no such handlers exist, this method will do nothing.
*
* @param <T> the target type
- * @param <S> The event source
* @param source the source of the handlers
* @param target the target
*/
- public static <T, S extends HasCloseHandlers<T> & HasHandlers> void fire(
- S source, T target) {
+ public static <T> void fire(HasCloseHandlers<T> source, T target) {
fire(source, target, false);
}
@@ -48,13 +46,12 @@
* Fires a close event on all registered handlers in the handler manager.
*
* @param <T> the target type
- * @param <S> The event source
* @param source the source of the handlers
* @param target the target
* @param autoClosed was the target closed automatically
*/
- public static <T, S extends HasCloseHandlers<T> & HasHandlers> void fire(
- S source, T target, boolean autoClosed) {
+ public static <T> void fire(
+ HasCloseHandlers<T> source, T target, boolean autoClosed) {
if (TYPE != null) {
HandlerManager handlers = source.getHandlers();
if (handlers != null) {
diff --git a/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
index 96a6d71..f88119d 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
@@ -16,6 +16,7 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
@@ -23,7 +24,7 @@
*
* @param <I> the type about to be selected
*/
-public interface HasBeforeSelectionHandlers<I> {
+public interface HasBeforeSelectionHandlers<I> extends HasHandlers {
/**
* Adds a {@link BeforeSelectionEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HasCloseHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasCloseHandlers.java
index fecdb4d..f9d3dfe 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasCloseHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasCloseHandlers.java
@@ -16,6 +16,7 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
@@ -23,7 +24,7 @@
*
* @param <T> the type being closed
*/
-public interface HasCloseHandlers<T> {
+public interface HasCloseHandlers<T> extends HasHandlers {
/**
* Adds a {@link CloseEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HasHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasHandlers.java
index ea36461..f16eb52 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasHandlers.java
@@ -16,18 +16,14 @@
package com.google.gwt.event.logical.shared;
-import com.google.gwt.event.shared.HandlerManager;
-
/**
- * An object that implements this interface has a collection of handlers stored
- * in a {@link HandlerManager}.
+ * This is a placeholder to avoid breaking projects depending on GWT trunk,
+ * HasHandlers has moved to com.google.gwt.event.shared.HasHandlers. This
+ * interface will be removed before the first GWT 1.6 milestone.
+ *
+ * @deprecated use com.google.gwt.event.shared.HasHandlers instead.
*/
+@Deprecated
+public interface HasHandlers extends com.google.gwt.event.shared.HasHandlers {
-public interface HasHandlers {
- /**
- * Gets this object's handlers. May return null if there are no handlers.
- *
- * @return the handlers
- */
- HandlerManager getHandlers();
}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasHighlightHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasHighlightHandlers.java
new file mode 100644
index 0000000..a875031
--- /dev/null
+++ b/user/src/com/google/gwt/event/logical/shared/HasHighlightHandlers.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.event.logical.shared;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+/**
+ * A widget that implements this interface is a public source of
+ * {@link HighlightEvent} events.
+ *
+ * @param <V> the highlighted value type
+ */
+public interface HasHighlightHandlers<V> extends HasHandlers {
+ /**
+ * Adds a {@link HighlightEvent} handler.
+ *
+ * @param handler the handler
+ * @return the registration for the event
+ */
+ HandlerRegistration addHighlightHandler(HighlightHandler<V> handler);
+}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasOpenHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasOpenHandlers.java
index 647f270..67139c1 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasOpenHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasOpenHandlers.java
@@ -16,6 +16,7 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
@@ -23,7 +24,7 @@
*
* @param <T> the type being opened
*/
-public interface HasOpenHandlers<T> {
+public interface HasOpenHandlers<T> extends HasHandlers {
/**
* Adds a {@link OpenEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HasResizeHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasResizeHandlers.java
index a5cff3f..e32795e 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasResizeHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasResizeHandlers.java
@@ -16,12 +16,13 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
* {@link ResizeEvent} events.
*/
-public interface HasResizeHandlers {
+public interface HasResizeHandlers extends HasHandlers {
/**
* Adds a {@link ResizeEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
index 3d310c6..7598e05 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
@@ -16,6 +16,7 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
@@ -23,7 +24,7 @@
*
* @param <I> the type being selected
*/
-public interface HasSelectionHandlers<I> {
+public interface HasSelectionHandlers<I> extends HasHandlers {
/**
* Adds a {@link SelectionEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HasShowRangeHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasShowRangeHandlers.java
new file mode 100644
index 0000000..ccedac3
--- /dev/null
+++ b/user/src/com/google/gwt/event/logical/shared/HasShowRangeHandlers.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.event.logical.shared;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+/**
+ * A widget that implements this interface is a public source of
+ * {@link ShowRangeEvent} events.
+ *
+ * @param <V> the type of range
+ */
+public interface HasShowRangeHandlers<V> extends HasHandlers {
+ /**
+ * Adds a {@link ShowRangeEvent} handler.
+ *
+ * @param handler the handler
+ * @return the registration for the event
+ */
+ HandlerRegistration addShowRangeHandler(ShowRangeHandler<V> handler);
+}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
index 2ea1f12..e893092 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
@@ -16,6 +16,7 @@
package com.google.gwt.event.logical.shared;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* A widget that implements this interface is a public source of
@@ -23,7 +24,7 @@
*
* @param <I> the value about to be changed
*/
-public interface HasValueChangeHandlers<I> {
+public interface HasValueChangeHandlers<I> extends HasHandlers {
/**
* Adds a {@link ValueChangeEvent} handler.
*
diff --git a/user/src/com/google/gwt/event/logical/shared/HighlightEvent.java b/user/src/com/google/gwt/event/logical/shared/HighlightEvent.java
new file mode 100644
index 0000000..ad1b514
--- /dev/null
+++ b/user/src/com/google/gwt/event/logical/shared/HighlightEvent.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.event.logical.shared;
+
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerManager;
+import com.google.gwt.event.shared.HasHandlers;
+
+/**
+ * Represents a highlight event.
+ *
+ * @param <V> the highlighted value type
+ */
+public class HighlightEvent<V> extends GwtEvent<HighlightHandler<V>> {
+
+ /**
+ * Handler type.
+ */
+ private static Type<HighlightHandler<?>> TYPE;
+
+ /**
+ * Fires a highlight event on all registered handlers in the handler manager.
+ *
+ * @param <V> the highlighted value type
+ * @param <S> The event source
+ * @param source the source of the handlers
+ * @param highlighted the value highlighted
+ */
+ public static <V, S extends HasHighlightHandlers<V> & HasHandlers> void fire(
+ S source, V highlighted) {
+ if (TYPE != null) {
+ HandlerManager handlers = source.getHandlers();
+ if (handlers != null) {
+ HighlightEvent<V> event = new HighlightEvent<V>(highlighted);
+ handlers.fireEvent(event);
+ }
+ }
+ }
+
+ /**
+ * Gets the type associated with this event.
+ *
+ * @return returns the handler type
+ */
+ public static Type<HighlightHandler<?>> getType() {
+ if (TYPE == null) {
+ TYPE = new Type<HighlightHandler<?>>();
+ }
+ return TYPE;
+ }
+
+ private final V highlighted;
+
+ /**
+ * Creates a new highlight event.
+ *
+ * @param highlighted value highlighted
+ */
+ protected HighlightEvent(V highlighted) {
+ this.highlighted = highlighted;
+ }
+
+ /**
+ * Gets the value highlighted.
+ *
+ * @return value highlighted
+ */
+ public V getHighlighted() {
+ return highlighted;
+ }
+
+ @Override
+ protected void dispatch(HighlightHandler<V> handler) {
+ handler.onHighlight(this);
+ }
+
+ // Because of type erasure, our static type is
+ // wild carded, yet the "real" type should use our I param.
+ @SuppressWarnings("unchecked")
+ @Override
+ protected final Type<HighlightHandler<V>> getAssociatedType() {
+ return (Type) TYPE;
+ }
+}
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/user/src/com/google/gwt/event/logical/shared/HighlightHandler.java
similarity index 60%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to user/src/com/google/gwt/event/logical/shared/HighlightHandler.java
index 906258b..effc2ce 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/user/src/com/google/gwt/event/logical/shared/HighlightHandler.java
@@ -13,20 +13,21 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
+package com.google.gwt.event.logical.shared;
-package com.google.gwt.event.shared;
+import com.google.gwt.event.shared.EventHandler;
/**
+ * Handler interface for {@link HighlightEvent} events.
*
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
+ * @param <V> the highlighted value type
*/
-public interface HasHandlerManager {
+public interface HighlightHandler<V> extends EventHandler {
+
/**
- * Gets this widget's handler manager.
+ * Called when {@link HighlightEvent} is fired.
*
- * @return the manager
+ * @param event the {@link HighlightEvent} that was fired
*/
- HandlerManager getHandlerManager();
+ void onHighlight(HighlightEvent<V> event);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/OpenEvent.java b/user/src/com/google/gwt/event/logical/shared/OpenEvent.java
index 34026f2..ca8c1a6 100644
--- a/user/src/com/google/gwt/event/logical/shared/OpenEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/OpenEvent.java
@@ -35,12 +35,10 @@
* such handlers exist, this method will do nothing.
*
* @param <T> the target type
- * @param <S> The event source
* @param source the source of the handlers
* @param target the target
*/
- public static <T, S extends HasOpenHandlers<T> & HasHandlers> void fire(
- S source, T target) {
+ public static <T> void fire(HasOpenHandlers<T> source, T target) {
if (TYPE != null) {
HandlerManager handlers = source.getHandlers();
if (handlers != null) {
diff --git a/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java b/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java
index ff731e8..351b86c 100644
--- a/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java
@@ -18,6 +18,7 @@
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
+import com.google.gwt.event.shared.HasHandlers;
/**
* Fired when the event source is resized.
diff --git a/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java b/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
index 40a8423..c43ab56 100644
--- a/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
@@ -39,8 +39,7 @@
* @param source the source of the handlers
* @param selectedItem the selected item
*/
- public static <I, S extends HasSelectionHandlers<I> & HasHandlers> void fire(
- S source, I selectedItem) {
+ public static <I> void fire(HasSelectionHandlers<I> source, I selectedItem) {
if (TYPE != null) {
HandlerManager handlers = source.getHandlers();
if (handlers != null) {
diff --git a/user/src/com/google/gwt/event/logical/shared/ShowRangeEvent.java b/user/src/com/google/gwt/event/logical/shared/ShowRangeEvent.java
new file mode 100644
index 0000000..34d3c88
--- /dev/null
+++ b/user/src/com/google/gwt/event/logical/shared/ShowRangeEvent.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.event.logical.shared;
+
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerManager;
+import com.google.gwt.event.shared.HasHandlers;
+
+/**
+ * Represents a show range event. This logical event should be used when a
+ * widget displays a range of values to the user. This event should not be fired until a widget is displaying t
+ *
+ * @param <V> the type of range
+ */
+public class ShowRangeEvent<V> extends GwtEvent<ShowRangeHandler<V>> {
+
+ /**
+ * Handler type.
+ */
+ private static Type<ShowRangeHandler<?>> TYPE;
+
+ /**
+ * Fires a show range event on all registered handlers in the handler manager.
+ *
+ * @param <V> the type of range
+ * @param <S> the event source
+ * @param source the source of the handlers
+ * @param start the start of the range
+ * @param end the end of the range
+ */
+ public static <V, S extends HasShowRangeHandlers<V> & HasHandlers> void fire(
+ S source, V start, V end) {
+ if (TYPE != null) {
+ HandlerManager handlers = source.getHandlers();
+ if (handlers != null) {
+ ShowRangeEvent<V> event = new ShowRangeEvent<V>(start, end);
+ handlers.fireEvent(event);
+ }
+ }
+ }
+
+ /**
+ * Gets the type associated with this event.
+ *
+ * @return returns the handler type
+ */
+ public static Type<ShowRangeHandler<?>> getType() {
+ if (TYPE == null) {
+ TYPE = new Type<ShowRangeHandler<?>>();
+ }
+ return TYPE;
+ }
+
+ private final V start;
+
+ private final V end;
+
+ /**
+ * Creates a new show range event.
+ *
+ * @param start start of the range
+ * @param end end of the range
+ */
+ protected ShowRangeEvent(V start, V end) {
+ this.start = start;
+ this.end = end;
+ }
+
+ /**
+ * Gets the end of the range.
+ *
+ * @return end of the range
+ */
+ public V getEnd() {
+ return end;
+ }
+
+ /**
+ * Gets the start of the range.
+ *
+ * @return start of the range
+ */
+ public V getStart() {
+ return start;
+ }
+
+ @Override
+ protected void dispatch(ShowRangeHandler<V> handler) {
+ handler.onShowRange(this);
+ }
+
+ // Because of type erasure, our static type is
+ // wild carded, yet the "real" type should use our I param.
+ @SuppressWarnings("unchecked")
+ @Override
+ protected final Type<ShowRangeHandler<V>> getAssociatedType() {
+ return (Type) TYPE;
+ }
+}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/user/src/com/google/gwt/event/logical/shared/ShowRangeHandler.java
similarity index 60%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to user/src/com/google/gwt/event/logical/shared/ShowRangeHandler.java
index 906258b..bde468f 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/user/src/com/google/gwt/event/logical/shared/ShowRangeHandler.java
@@ -13,20 +13,21 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
+package com.google.gwt.event.logical.shared;
-package com.google.gwt.event.shared;
+import com.google.gwt.event.shared.EventHandler;
/**
+ * Handler interface for {@link ShowRangeEvent} events.
*
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
+ * @param <V> the type of range
*/
-public interface HasHandlerManager {
+public interface ShowRangeHandler<V> extends EventHandler {
+
/**
- * Gets this widget's handler manager.
+ * Called when {@link ShowRangeEvent} is fired.
*
- * @return the manager
+ * @param event the {@link ShowRangeEvent} that was fired
*/
- HandlerManager getHandlerManager();
+ void onShowRange(ShowRangeEvent<V> event);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java b/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
index 52376e8..5a769dc 100644
--- a/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
@@ -35,12 +35,10 @@
* manager.If no such handlers exist, this method will do nothing.
*
* @param <I> the old value type
- * @param <S> The event source
* @param source the source of the handlers
* @param value the value
*/
- public static <I, S extends HasValueChangeHandlers<I> & HasHandlers> void fire(
- S source, I value) {
+ public static <I> void fire(HasValueChangeHandlers<I> source, I value) {
if (TYPE != null) {
HandlerManager handlers = source.getHandlers();
if (handlers != null && handlers.isEventHandled(TYPE)) {
@@ -61,13 +59,11 @@
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
- public static <I, S extends HasValueChangeHandlers<I> & HasHandlers> void fireIfNotEqual(
- S source, I oldValue, I newValue) {
- if (TYPE != null) {
- if (oldValue != newValue
- && (oldValue == null || !oldValue.equals(newValue))) {
- fire(source, newValue);
- }
+ public static <I> void fireIfNotEqual(HasValueChangeHandlers<I> source,
+ I oldValue, I newValue) {
+ if (shouldFire(source, oldValue, newValue)) {
+ ValueChangeEvent<I> event = new ValueChangeEvent<I>(newValue);
+ source.getHandlers().fireEvent(event);
}
}
@@ -83,10 +79,27 @@
return TYPE;
}
+ /**
+ * Convenience method to allow subtypes to know when they should fire a value
+ * change event in a null-safe manner.
+ *
+ * @param <I> value type
+ * @param source the source
+ * @param oldValue the old value
+ * @param newValue the new value
+ * @return whether the event should be fired
+ */
+ protected static <I> boolean shouldFire(HasValueChangeHandlers<I> source,
+ I oldValue, I newValue) {
+ return TYPE != null && source.getHandlers() != null && oldValue != newValue
+ && (oldValue == null || !oldValue.equals(newValue));
+ }
+
private final I value;
/**
* Creates a value change event.
+ *
* @param value the value
*/
protected ValueChangeEvent(I value) {
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/user/src/com/google/gwt/event/shared/HasHandlers.java
similarity index 70%
rename from user/src/com/google/gwt/event/shared/HasHandlerManager.java
rename to user/src/com/google/gwt/event/shared/HasHandlers.java
index 906258b..b57a40d 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/user/src/com/google/gwt/event/shared/HasHandlers.java
@@ -16,17 +16,17 @@
package com.google.gwt.event.shared;
+
/**
- *
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
+ * An object that implements this interface has a collection of handlers stored
+ * in a {@link HandlerManager}.
*/
-public interface HasHandlerManager {
+
+public interface HasHandlers {
/**
- * Gets this widget's handler manager.
+ * Gets this object's handlers. May return null if there are no handlers.
*
- * @return the manager
+ * @return the handlers
*/
- HandlerManager getHandlerManager();
+ HandlerManager getHandlers();
}
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa.properties
index 986e49a..4c49b72 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = DJF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_DJ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_DJ.properties
deleted file mode 100644
index f2fbffa..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_DJ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = DJF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER.properties
index c57298d..ed143a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER_SAAHO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER_SAAHO.properties
deleted file mode 100644
index c57298d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ER_SAAHO.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ET.properties
index 8ac04de..4be1443 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ET.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_aa_ET.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af.properties
index 2c95e90..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_NA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_NA.properties
index 2c95e90..a176a65 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_NA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_NA.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_ZA.properties
deleted file mode 100644
index 6440596..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_af_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak.properties
index d51c175..897ee2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak_GH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak_GH.properties
deleted file mode 100644
index 840dd53..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ak_GH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am.properties
index b4b7d23..0769a41 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am_ET.properties
deleted file mode 100644
index 8ac04de..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_am_ET.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar.properties
index c024507..8986d2f27 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = AED
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_AE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_AE.properties
deleted file mode 100644
index c024507..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_AE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = \u066B
-groupingSeparator = \u066C
-percent = \u066A
-zeroDigit = \u0660
-plusSign = +
-minusSign = -
-exponentialSymbol = \u0627\u0633
-perMill = \u2030
-infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
-monetarySeparator = \u066B
-monetaryGroupingSeparator = \u066C
-decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
-defCurrencyCode = AED
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_BH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_BH.properties
index 433ba31..88ecf28 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_BH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_BH.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = BHD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_DZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_DZ.properties
index e4f4cba..f7b040b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_DZ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_DZ.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = DZD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_EG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_EG.properties
index 11f1d2a..92dca5a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_EG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_EG.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = EGP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_IQ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_IQ.properties
index 3e7faf6..e15fd9a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_IQ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_IQ.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = IQD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_JO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_JO.properties
index 679a70b..0aa17f6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_JO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_JO.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = JOD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_KW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_KW.properties
index f3190e1..0a55d6c 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_KW.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_KW.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = KWD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LB.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LB.properties
index bc7b7a7..ce6bf92 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LB.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LB.properties
@@ -4,14 +4,14 @@
zeroDigit = \u0660
plusSign = +
minusSign = -
-exponentialSymbol = \u0627\u0633
+exponentialSymbol = E
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = LBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LY.properties
index 19d12f0..dbfd125 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_LY.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = LYD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_MA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_MA.properties
index 2f16985..346aabb 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_MA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_MA.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = MAD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_OM.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_OM.properties
index 30c093c..0d012ec 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_OM.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_OM.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = OMR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_QA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_QA.properties
index e64f947..febd54d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_QA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_QA.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #0.###;#0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#0.00
defCurrencyCode = QAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SA.properties
index b9f2167..8718908 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SA.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #0.###;#0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#0.00
defCurrencyCode = SAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SD.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SD.properties
index d5837da..95c45a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SD.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SD.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
defCurrencyCode = SDD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SY.properties
index 05310b2..8398ba8 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_SY.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #0.###;#0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#0.00
defCurrencyCode = SYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_TN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_TN.properties
index 01b2ae4..1c07787 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_TN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_TN.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = \u0627\u0633
+exponentialSymbol = E
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #0.###;#0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#0.00
defCurrencyCode = TND
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_YE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_YE.properties
index 0690065..cfd3222 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_YE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ar_YE.properties
@@ -7,11 +7,11 @@
exponentialSymbol = \u0627\u0633
perMill = \u2030
infinity = \u221E
-notANumber = \u0644\u064a\u0633 \u0631\u0642\u0645
+notANumber = \u0644\u064A\u0633 \u0631\u0642\u0645
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #0.###;#0.###-
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#0.00
defCurrencyCode = YER
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as.properties
index 0960b84..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = BDT
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as_IN.properties
deleted file mode 100644
index a75628b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_as_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az.properties
index 694c49e..b3f49bc 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az.properties
@@ -1,5 +1,5 @@
decimalSeparator = ,
-groupingSeparator = \u00A0
+groupingSeparator = .
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
+monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = AZM
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = AZN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_AZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_AZ.properties
deleted file mode 100644
index 694c49e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_AZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = AZM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl.properties
deleted file mode 100644
index 1e21fa6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl_AZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl_AZ.properties
deleted file mode 100644
index 694c49e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Cyrl_AZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = AZM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn.properties
deleted file mode 100644
index 1e21fa6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn_AZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn_AZ.properties
deleted file mode 100644
index 694c49e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_az_Latn_AZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = AZM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be.properties
index 1e21fa6..9ad3f9f 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = BYR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg.properties
index 1e21fa6..aa4b388 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg.properties
@@ -7,11 +7,11 @@
exponentialSymbol = E
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = \u041D/\u0427
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+scientificPattern = #E0
+percentPattern = #0%
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = BGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg_BG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg_BG.properties
deleted file mode 100644
index f058105..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bg_BG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = BGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn.properties
index 0960b84..af33df6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u09E6
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = #,##,##0.00\u00A4;(#,##,##0.00\u00A4)
defCurrencyCode = BDT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_IN.properties
index a75628b..c76784b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_IN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_IN.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u09E6
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
+currencyPattern = #,##,##0.00\u00A4;(#,##,##0.00\u00A4)
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs.properties
index 688a751..a2b791f 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = HRK
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs_BA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs_BA.properties
deleted file mode 100644
index 99df0ab..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bs_BA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn.properties
index d51c175..ed143a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn_ER.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn_ER.properties
deleted file mode 100644
index c57298d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_byn_ER.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca.properties
index cc30f6e..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca_ES.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca_ES.properties
deleted file mode 100644
index 8aa09b5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ca_ES.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cch_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_characters.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_characters.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_characters.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cop.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_cop.properties
index f1dea5d..2296123 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cop.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = EGP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs.properties
index 1e21fa6..5daca26 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = CZK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs_CZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs_CZ.properties
deleted file mode 100644
index 934c42c..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cs_CZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = CZK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy.properties
index bb646a3..39341ca 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = USD
+defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy_GB.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy_GB.properties
deleted file mode 100644
index acbbb18..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_cy_GB.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da.properties
index 086dc19..255c919 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da.properties
@@ -3,7 +3,7 @@
percent = %
zeroDigit = 0
plusSign = +
-minusSign = \u2212
+minusSign = -
exponentialSymbol = E
perMill = \u2030
infinity = \u221E
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da_DK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da_DK.properties
deleted file mode 100644
index e6aef73..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_da_DK.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = \u2212
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00;\u00A4 -#,##0.00
-defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de.properties
index 64cdf3b..694bb51 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_AT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_AT.properties
index 64cdf3b..423343d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_AT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_AT.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_BE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_BE.properties
deleted file mode 100644
index 4a5671b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_BE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_CH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_CH.properties
index e541345..3b7c39c 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_CH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_CH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = '
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00;\u00A4-#,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4-#,##0.00
defCurrencyCode = CHF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_DE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_DE.properties
deleted file mode 100644
index 4a5671b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_DE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LI.properties
index 156e0ec..0bc3ee5 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LI.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = '
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CHF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LU.properties
deleted file mode 100644
index 4a5671b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_de_LU.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv.properties
index a6ca53d..5d40206 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = MVR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv_MV.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv_MV.properties
deleted file mode 100644
index 565e661..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dv_MV.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0660
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = MVR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz.properties
index d51c175..eeffd29 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz.properties
@@ -1,17 +1,17 @@
decimalSeparator = .
groupingSeparator = ,
-percent = %
-zeroDigit = 0
+percent = \u0F56\u0F62\u0F92\u0F0B\u0F46\u0F71
+zeroDigit = \u0F20
plusSign = +
minusSign = -
exponentialSymbol = E
perMill = \u2030
-infinity = \u221E
-notANumber = NaN
+infinity = \u0F42\u0FB2\u0F44\u0F66\u0F0B\u0F58\u0F7A\u0F51
+notANumber = \u0F68\u0F44\u0F0B\u0F58\u0F51
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E+00
+percentPattern = #,##,##0\u00A0%
+currencyPattern = \u00A4#,##,##0.00
+defCurrencyCode = BTN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz_BT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz_BT.properties
deleted file mode 100644
index 7ebe9a2..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_dz_BT.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = \u0F56\u0F62\u0F92\u0F0B\u0F46\u0F71
-zeroDigit = \u0F20
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u0F42\u0FB2\u0F44\u0F66\u0F0B\u0F58\u0F7A\u0F51
-notANumber = \u0F68\u0F44\u0F0B\u0F58\u0F51
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee.properties
index 840dd53..897ee2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_GH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_GH.properties
deleted file mode 100644
index 840dd53..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_GH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_TG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_TG.properties
index 5d85b22..3731b56 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_TG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ee_TG.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el.properties
index 19bcd98..9b73f11 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4;-#,##0.00\u00A0\u00A4
defCurrencyCode = CYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_CY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_CY.properties
index a4d704a..4cbe248 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_CY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_CY.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = CYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_GR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_GR.properties
index f9172aa..d1840fe 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_GR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_GR.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00\u00A4;-\u00A4#,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4;-#,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en.properties
index bb646a3..d05b2fc 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
+currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AS.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AS.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AU.properties
index 43c858e..d4a879a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_AU.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = AUD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BE.properties
index 8aa09b5..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BE.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BW.properties
index c5ac389..9855191 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BW.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BW.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = BWP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BZ.properties
index cc3cd0d..6f40292 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BZ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_BZ.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = BZD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_CA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_CA.properties
index 3768d20..7900b19 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_CA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_CA.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = CAD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GB.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GB.properties
index acbbb18..39341ca 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GB.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GB.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GU.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_GU.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_HK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_HK.properties
index 6f71b32..c862eab 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_HK.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_HK.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = HKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IE.properties
index bca4588..7c5b062 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IN.properties
index a75628b..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_IN.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_JM.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_JM.properties
index 3e37bb5..4fedc8a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_JM.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_JM.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = JMD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MH.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MP.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MP.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MP.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MT.properties
index c275926..765d5d1 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_MT.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = MTL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NA.properties
index de0eee8..6c6d44a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NA.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NZ.properties
index 435dcc9..cbc8d36 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NZ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_NZ.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = NZD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PH.properties
index 194f860..14ad3df 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = PHP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PK.properties
index 8af92f4..0190a0c 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PK.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_PK.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = PKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_SG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_SG.properties
index 4c79239..8fcb184 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_SG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_SG.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = SGD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_TT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_TT.properties
index f831fe6..9b28176 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_TT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_TT.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = TTD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_UM.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_UM.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_UM.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US_POSIX.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US_POSIX.properties
deleted file mode 100644
index 147463b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_US_POSIX.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = 0/00
-infinity = INF
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #0.######
-scientificPattern = 0.000000E+000
-percentPattern = #0%
-currencyPattern = \u00A4 #0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_VI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_VI.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_VI.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZA.properties
index de0eee8..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZA.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZW.properties
index d97c98d..5cce9c9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZW.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_en_ZW.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZWD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eo.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eo.properties
index 1e21fa6..a246956 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eo.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eo.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es.properties
index c531d7d..910d51d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = ARS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_AR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_AR.properties
deleted file mode 100644
index c531d7d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_AR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = ARS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_BO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_BO.properties
index c77bb80..970b703 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_BO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_BO.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = BOB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CL.properties
index cf55313..5f33920 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CL.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CL.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
defCurrencyCode = CLP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CO.properties
index a314082..b2f4a9b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CO.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = COP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CR.properties
index 7c5993d..e54d7a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_CR.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CRC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_DO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_DO.properties
index 543b745..b5215fa 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_DO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_DO.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = DOP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_EC.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_EC.properties
index 7aebd83..ada6782 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_EC.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_EC.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_ES.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_ES.properties
index 8aa09b5..2762ff3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_ES.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_ES.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_GT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_GT.properties
index 83fbf56..2e82b1b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_GT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_GT.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = GTQ
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_HN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_HN.properties
index 580ee4d..2d10a8d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_HN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_HN.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = HNL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_MX.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_MX.properties
index dd4a304..f5bfdee 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_MX.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_MX.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = MXN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_NI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_NI.properties
index f4cc918..13ef644 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_NI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_NI.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = NIO
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PA.properties
index d48bd0f..9e1ff92 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PA.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = PAB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PE.properties
index d8483cf..8d8457d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PE.properties
@@ -1,5 +1,5 @@
-decimalSeparator = ,
-groupingSeparator = .
+decimalSeparator = .
+groupingSeparator = ,
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
+monetarySeparator = .
+monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = PEN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PR.properties
index 4a36ec6..d05fe8d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PR.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PY.properties
index 1d42c90..e6e7d48 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_PY.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 -#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0-#,##0.00
defCurrencyCode = PYG
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_SV.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_SV.properties
index e94b856..c523711 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_SV.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_SV.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = SVC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_US.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_US.properties
index 4a36ec6..d05fe8d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_US.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_US.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_UY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_UY.properties
index 745ab16..9c9659b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_UY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_UY.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4\u00A0#,##0.00;(\u00A4\u00A0#,##0.00)
defCurrencyCode = UYU
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_VE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_VE.properties
index 2c0f361..177450d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_VE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_es_VE.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;\u00A4 -#,##0.00
+currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
defCurrencyCode = VEB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et.properties
index 1e21fa6..c7d9b64 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = EEK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et_EE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et_EE.properties
deleted file mode 100644
index 479e326..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_et_EE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EEK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu.properties
index 04df231..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu_ES.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu_ES.properties
deleted file mode 100644
index 8aa09b5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_eu_ES.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa.properties
index 6e6e122..5dbe4b3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa.properties
@@ -11,7 +11,7 @@
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;'\u202A'-#,##0.###'\u202C'
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = '\u202A'%#,##0'\u202C'
-currencyPattern = #,##0.00 \u00A4;'\u202A'-#,##0.00'\u202C' \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4;'\u202A'-#,##0.00'\u202C'\u00A0\u00A4
defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_AF.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_AF.properties
index 2a338e2..dacadd3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_AF.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_AF.properties
@@ -11,7 +11,7 @@
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;'\u202A'-#,##0.###'\u202C'
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = '\u202A'#,##0%'\u202C'
-currencyPattern = #,##0.00 \u00A4;'\u202A'-#,##0.00'\u202C' \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4;'\u202A'-#,##0.00'\u202C'\u00A0\u00A4
defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_IR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_IR.properties
index 1b9b70a..76113fb 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_IR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fa_IR.properties
@@ -11,7 +11,7 @@
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###;'\u202A'-#,##0.###'\u202C'
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = '\u202A'%#,##0'\u202C'
-currencyPattern = #,##0.00 \u00A4;'\u202A'-#,##0.00'\u202C' \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4;'\u202A'-#,##0.00'\u202C'\u00A0\u00A4
defCurrencyCode = IRR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi.properties
index b4e13f8..97136b4 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi.properties
@@ -7,11 +7,11 @@
exponentialSymbol = E
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = ep\u00E4luku
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fil.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_fil.properties
index f1dea5d..0202b42 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fil.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = PHP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo.properties
index 04df231..0a3f664 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo.properties
@@ -3,15 +3,15 @@
percent = %
zeroDigit = 0
plusSign = +
-minusSign = -
-exponentialSymbol = E
+minusSign = \u2212
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
+defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo_FO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo_FO.properties
deleted file mode 100644
index 8e007b2..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fo_FO.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;\u00A4 -#,##0.00
-defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr.properties
index 0fdb920..0e9601b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_BE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_BE.properties
index 35b6750..694bb51 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_BE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_BE.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CA.properties
index 704ae58..b63e97d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CA.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4;(#,##0.00\u00A4)
+currencyPattern = #,##0.00\u00A0\u00A4;(#,##0.00\u00A0\u00A4)
defCurrencyCode = CAD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CH.properties
index 49011df..3b7c39c 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_CH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = '
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = \u00A4 #,##0.00;\u00A4-#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4-#,##0.00
defCurrencyCode = CHF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_FR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_FR.properties
deleted file mode 100644
index 0fdb920..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_FR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_LU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_LU.properties
index 35b6750..694bb51 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_LU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_LU.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_MC.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_MC.properties
deleted file mode 100644
index 0fdb920..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_MC.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_SN.properties
similarity index 77%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_SN.properties
index 0fdb920..5d6f740 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fr_SN.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur.properties
index f867d15..0d9d3ca 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur.properties
@@ -1,5 +1,5 @@
-decimalSeparator = ,
-groupingSeparator = .
+decimalSeparator = .
+groupingSeparator = ,
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
+monetarySeparator = .
+monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur_IT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur_IT.properties
deleted file mode 100644
index 8aa09b5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fur_IT.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga.properties
index d51c175..7c5b062 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga_IE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga_IE.properties
deleted file mode 100644
index bca4588..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ga_IE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa.properties
index d51c175..897ee2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa_GH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa_GH.properties
deleted file mode 100644
index 840dd53..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gaa_GH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez.properties
index c4d98a2..f30f617 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez.properties
@@ -1,5 +1,5 @@
decimalSeparator = .
-groupingSeparator = ,
+groupingSeparator = \u12C8
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u12C8
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ER.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ER.properties
deleted file mode 100644
index 4265ab2..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ER.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = \u12C8
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = \u12C8
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ET.properties
index 3df47f9..6488ed4 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ET.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gez_ET.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = \u12C8
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl.properties
index 04df231..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl_ES.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl_ES.properties
deleted file mode 100644
index 8aa09b5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gl_ES.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu.properties
index 1f3cd51..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = \u0AE6
+zeroDigit = 0
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu_IN.properties
deleted file mode 100644
index e1c943c..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gu_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0AE6
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv.properties
index d51c175..39341ca 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv_GB.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv_GB.properties
deleted file mode 100644
index acbbb18..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_gv_GB.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha.properties
index 5d85b22..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = XOF
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_SD.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_SD.properties
index f1dea5d..78433dd 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Arab_SD.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = SDD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_GH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_GH.properties
index 840dd53..897ee2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_GH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_GH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_GH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_GH.properties
index 840dd53..897ee2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_GH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_GH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = GHC
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NE.properties
index 5d85b22..3731b56 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_Latn_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NE.properties
index 5d85b22..3731b56 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_SD.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_SD.properties
index f1dea5d..78433dd 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ha_SD.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = SDD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw.properties
index d51c175..d05b2fc 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw_US.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw_US.properties
deleted file mode 100644
index 4a36ec6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_haw_US.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he.properties
index d51c175..48ac096 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = ILS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi.properties
index f3f51a3..278f0d8 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi_IN.properties
deleted file mode 100644
index cefccb7..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hi_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0966
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr.properties
index 99df0ab..b4028a6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = BAM
+currencyPattern = #,##0.00\u00A0\u00A4;-#,##0.00\u00A0\u00A4
+defCurrencyCode = HRK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr_HR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr_HR.properties
deleted file mode 100644
index 688a751..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hr_HR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = HRK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu.properties
index 2e01b78..9fe1f5a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = SIT
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = HUF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu_HU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu_HU.properties
deleted file mode 100644
index 25305b5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hu_HU.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = HUF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy.properties
index f109315..7fad01f 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #0%
-currencyPattern = #0.00 \u00A4
-defCurrencyCode = AZM
+currencyPattern = #0.00\u00A0\u00A4
+defCurrencyCode = AMD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM.properties
deleted file mode 100644
index cb086ac..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #0.###
-scientificPattern = 0.###E0
-percentPattern = #0%
-currencyPattern = #0.00 \u00A4
-defCurrencyCode = AMD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM_REVISED.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM_REVISED.properties
deleted file mode 100644
index cb086ac..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_hy_AM_REVISED.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #0.###
-scientificPattern = 0.###E0
-percentPattern = #0%
-currencyPattern = #0.00 \u00A4
-defCurrencyCode = AMD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ia.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ia.properties
index 04df231..80c3966 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ia.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ia.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id.properties
index e716216..8d6aa89 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = USD
+defCurrencyCode = IDR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ig_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ii.properties
similarity index 82%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ii.properties
index aeff2ab..5bffc72 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ii.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id_ID.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_in.properties
similarity index 91%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_id_ID.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_in.properties
index a20f87c..8d6aa89 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_id_ID.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_in.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = IDR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is.properties
index 04df231..80a4a81 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is.properties
@@ -3,15 +3,15 @@
percent = %
zeroDigit = 0
plusSign = +
-minusSign = -
-exponentialSymbol = E
+minusSign = \u2212
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = EiTa
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = ISK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it.properties
index 12acdca..a60b388 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CHF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_CH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_CH.properties
index fe27114..9c0d9fa 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_CH.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_CH.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = '
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4-#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4-#,##0.00
defCurrencyCode = CHF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_IT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_IT.properties
index cc30f6e..2762ff3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_IT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_it_IT.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iu.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iu.properties
index cf45d3a..ff5c2cd 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iu.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iu.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CAD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he_IL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iw.properties
similarity index 82%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_he_IL.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_iw.properties
index 7152d11..48ac096 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_he_IL.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_iw.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = ILS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja.properties
index d51c175..cc3ca2d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = JPY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja_JP.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja_JP.properties
deleted file mode 100644
index 147867a..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ja_JP.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = JPY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka.properties
index 1e21fa6..9facf81 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka.properties
@@ -1,5 +1,5 @@
decimalSeparator = ,
-groupingSeparator = \u00A0
+groupingSeparator = .
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
+monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = GEL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka_GE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka_GE.properties
deleted file mode 100644
index e659811..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ka_GE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = GEL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kaj_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam.properties
index d51c175..b6ada55 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam_KE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam_KE.properties
deleted file mode 100644
index 253d780..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kam_KE.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kcg_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_CI.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_CI.properties
index f1dea5d..3731b56 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_CI.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kfo_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk.properties
index 1e21fa6..22664ec 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4;-#,##0.00\u00A0\u00A4
+defCurrencyCode = KZT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk_KZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk_KZ.properties
deleted file mode 100644
index 2cddcba..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kk_KZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4;-\u00A4 #,##0.00
-defCurrencyCode = KZT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl.properties
index 04df231..b5d4705 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
+defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl_GL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl_GL.properties
deleted file mode 100644
index 8e007b2..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kl_GL.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;\u00A4 -#,##0.00
-defCurrencyCode = DKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km.properties
index 04df231..6a49fec 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A4
+defCurrencyCode = KHR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km_KH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km_KH.properties
deleted file mode 100644
index f59e572..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_km_KH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00\u00A4
-defCurrencyCode = KHR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn.properties
index d51c175..f294114 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u0CE6
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn_IN.properties
deleted file mode 100644
index a75628b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kn_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko.properties
index c4fe25a..d766767 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = KPW
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko_KR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko_KR.properties
index da9f591..985c9cf 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko_KR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ko_KR.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = KRW
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok.properties
index d51c175..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok_IN.properties
deleted file mode 100644
index a75628b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kok_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe.properties
index f1dea5d..1ddf6d3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = GNF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe_LR.properties
similarity index 76%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe_LR.properties
index f1dea5d..6ac2afe 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kpe_LR.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = LRD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku.properties
index 4e299d1..51e376d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = IQD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Arab.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Arab.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Arab.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IQ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IQ.properties
deleted file mode 100644
index 4e299d1..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IQ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = IQD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IR.properties
deleted file mode 100644
index 388a282..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_IR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = IRR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IQ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IQ.properties
deleted file mode 100644
index 4e299d1..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IQ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = IQD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IR.properties
deleted file mode 100644
index 388a282..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_IR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = IRR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_SY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_SY.properties
deleted file mode 100644
index 48cfc8f..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_SY.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = SYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_TR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_TR.properties
index 0a50486..6532228 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_TR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_Latn_TR.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = TRY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_SY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_SY.properties
deleted file mode 100644
index 48cfc8f..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_SY.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = SYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_TR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_TR.properties
index 0a50486..6532228 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_TR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ku_TR.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = TRY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw.properties
index d51c175..39341ca 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw_GB.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw_GB.properties
deleted file mode 100644
index acbbb18..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_kw_GB.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = GBP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky.properties
index 1e21fa6..288ac45 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = KGS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky_KG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky_KG.properties
deleted file mode 100644
index 2bd7bae..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ky_KG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = KGS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln.properties
index 1b2950e..e397abc 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln.properties
@@ -1,4 +1,4 @@
-decimalSeparator = ,
+decimalSeparator = .
groupingSeparator = ,
percent = %
zeroDigit = 0
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = ,
+monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = CDF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CD.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CD.properties
deleted file mode 100644
index aaf9fdf..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CD.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = CDF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CG.properties
index 05d5bb6..a5caa7b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ln_CG.properties
@@ -1,4 +1,4 @@
-decimalSeparator = ,
+decimalSeparator = .
groupingSeparator = ,
percent = %
zeroDigit = 0
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = ,
+monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = XAF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo.properties
index d51c175..e48e02a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
+defCurrencyCode = LAK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo_LA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo_LA.properties
deleted file mode 100644
index f565b1b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lo_LA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
-defCurrencyCode = LAK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt.properties
index 04df231..5028046 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt.properties
@@ -3,15 +3,15 @@
percent = %
zeroDigit = 0
plusSign = +
-minusSign = -
-exponentialSymbol = E
+minusSign = \u2212
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = LTL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt_LT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt_LT.properties
deleted file mode 100644
index ffb3686..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lt_LT.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = LTL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv.properties
index 1e21fa6..f7197b9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = LVL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv_LV.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv_LV.properties
deleted file mode 100644
index c582703..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_lv_LV.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = LVL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk.properties
index 04df231..abcc976 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+decimalPattern = #,##0.###;(#,##0.###)
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = MKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk_MK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk_MK.properties
deleted file mode 100644
index 96f8c8c..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mk_MK.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###;(#,##0.###)
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = MKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml.properties
index 099a90a..dc6ac8a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml.properties
@@ -1,17 +1,17 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = \u0D66
+zeroDigit = 0
plusSign = +
minusSign = -
exponentialSymbol = E
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = \u0D38\u0D02\u0D16\u0D4D\u0D2F\u0D2F\u0D32\u0D4D\u0D32
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = #,##,##0.00\u00A4
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml_IN.properties
deleted file mode 100644
index 9f80f12..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ml_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0D66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn.properties
index 1e21fa6..3425e87 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = MNT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_CN.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_CN.properties
index e777ce7..7d87a49 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_CN.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = BYR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_MN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_MN.properties
deleted file mode 100644
index 2f90c40..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_MN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = MNT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_Mong_CN.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_Mong_CN.properties
index e777ce7..7d87a49 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mn_Mong_CN.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = BYR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is_IS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mo.properties
similarity index 76%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_is_IS.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_mo.properties
index 571a9a3..76362ce 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_is_IS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mo.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = ISK
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = MDL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr.properties
index d51c175..278f0d8 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u0966
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr_IN.properties
deleted file mode 100644
index a75628b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mr_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms.properties
index c00f6b9..b2e0a31 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = BND
+currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+defCurrencyCode = AUD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_BN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_BN.properties
index a67c245..14930fe 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_BN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_BN.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = BND
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_MY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_MY.properties
index b410e11..289b933 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_MY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ms_MY.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = MYR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt.properties
index d51c175..765d5d1 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = MTL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_my.properties
similarity index 71%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_my.properties
index f1dea5d..4046c42 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_my.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u1040
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = MMK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb.properties
index d01e423..6d2a3bf 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb_NO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb_NO.properties
deleted file mode 100644
index 22202a5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nb_NO.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne.properties
index d51c175..792db75 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u0966
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NPR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_IN.properties
similarity index 71%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_IN.properties
index f1dea5d..79839a4 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_IN.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = 0
+zeroDigit = \u0966
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_NP.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_NP.properties
deleted file mode 100644
index 10a1a56..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ne_NP.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NPR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl.properties
index 8304ae3..d04f433 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ANG
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_BE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_BE.properties
index 8aa09b5..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_BE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_BE.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_NL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_NL.properties
deleted file mode 100644
index ea998d6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nl_NL.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn.properties
index d01e423..383b52a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn.properties
@@ -3,15 +3,15 @@
percent = %
zeroDigit = 0
plusSign = +
-minusSign = -
-exponentialSymbol = E
+minusSign = \u2212
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = \u00A4 #,##0.00
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn_NO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn_NO.properties
deleted file mode 100644
index 22202a5..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nn_NO.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_no.properties
similarity index 77%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_no.properties
index 0fdb920..6d2a3bf 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_fi_FI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_no.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0\u00A0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr.properties
index d51c175..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso.properties
index d51c175..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso_ZA.properties
deleted file mode 100644
index f1dea5d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nso_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny.properties
index fd23137..2352c25 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = MZM
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = MWK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny_MW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny_MW.properties
deleted file mode 100644
index c4bb9c9..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ny_MW.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = MWK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om.properties
index 2d76cf5..4be1443 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_ET.properties
deleted file mode 100644
index 8ac04de..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_ET.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_KE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_KE.properties
index ae0d8b5..7022999 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_KE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_om_KE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or.properties
index 36cfe7c..b361e30 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or_IN.properties
deleted file mode 100644
index 1947c1e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_or_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0B66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa.properties
index 66a66ef..7232496 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = PKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab.properties
deleted file mode 100644
index c030797..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0A66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab_PK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab_PK.properties
deleted file mode 100644
index fb0b323..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Arab_PK.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0A66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = PKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru.properties
index c030797..5cc501d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru_IN.properties
deleted file mode 100644
index 66a66ef..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_Guru_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0A66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_IN.properties
index 9b0f5bb..5cc501d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_IN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_IN.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4#,##,##0.00
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_PK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_PK.properties
deleted file mode 100644
index fb0b323..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pa_PK.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0A66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = PKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl.properties
index 1e21fa6..37cbe1d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = PLN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl_PL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl_PL.properties
deleted file mode 100644
index 238a3bd..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pl_PL.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = PLN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps.properties
index 7a93944..e2632e6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps.properties
@@ -1,17 +1,17 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
+decimalSeparator = \u066B
+groupingSeparator = \u066C
+percent = \u066A
+zeroDigit = \u06F0
plusSign = +
-minusSign = -
-exponentialSymbol = E
+minusSign = \u2212
+exponentialSymbol = \u00D7\u06F1\u06F0^
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = \u066B
+monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps_AF.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps_AF.properties
deleted file mode 100644
index bf44057..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ps_AF.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = \u066B
-groupingSeparator = \u066C
-percent = \u066A
-zeroDigit = \u06F0
-plusSign = +
-minusSign = \u2212
-exponentialSymbol = \u00D7\u06F1\u06F0^
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = \u066B
-monetaryGroupingSeparator = \u066C
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt.properties
index aafb2df..7d9f38b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = AOA
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_BR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_BR.properties
index d6199cf..f90c99a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_BR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_BR.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = BRL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_PT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_PT.properties
index 8aa09b5..b20eafd 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_PT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_pt_PT.properties
@@ -1,5 +1,5 @@
decimalSeparator = ,
-groupingSeparator = .
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
-monetaryGroupingSeparator = .
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro.properties
index 04df231..76362ce 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = MDL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro_RO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro_RO.properties
index 9417e08..b252b02 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro_RO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ro_RO.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = ROL
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = RON
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_root.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_root.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_root.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru.properties
index 810e636..963fed1 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00\u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = BYR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_RU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_RU.properties
index 588b61b..a10233d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_RU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_RU.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00\u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = RUB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_UA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_UA.properties
index 1334c6e..ef7dcc7 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_UA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ru_UA.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = UAH
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw.properties
index 04df231..61091d0 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = RWF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw_RW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw_RW.properties
deleted file mode 100644
index 1f3f4e6..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_rw_RW.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = RWF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa.properties
index 78b87ac..3ed3526 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
currencyPattern = \u00A4#,##,##0.00
-defCurrencyCode = USD
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa_IN.properties
deleted file mode 100644
index b02baaa..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sa_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0966
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4#,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se.properties
index 7655c8a..0f7d937 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se.properties
@@ -1,17 +1,17 @@
decimalSeparator = ,
-groupingSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
minusSign = \u2212
-exponentialSymbol = E
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = \u00A4\u00A4\u00A4
monetarySeparator = ,
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se_NO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se_NO.properties
index bb4ca92..bf6a32c 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se_NO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_se_NO.properties
@@ -1,17 +1,17 @@
decimalSeparator = ,
-groupingSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
minusSign = \u2212
-exponentialSymbol = E
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = \u00A4\u00A4\u00A4
monetarySeparator = ,
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = NOK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh.properties
index 99df0ab..b16b1c2 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = BAM
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = RSD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_BA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_BA.properties
index 71efe9c..7480039 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_BA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_BA.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 km
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_CS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_CS.properties
index cc30f6e..6a08b80 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_CS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_CS.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_YU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_YU.properties
index 3f70f32..55db468 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_YU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sh_YU.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = YUM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_BD.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_si.properties
similarity index 73%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_BD.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_si.properties
index 680f645..69b0238 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_bn_BD.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_si.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = BDT
+currencyPattern = \u00A4#,##,##0.00;(\u00A4#,##,##0.00)
+defCurrencyCode = LKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid.properties
index d51c175..4be1443 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid_ET.properties
deleted file mode 100644
index 8ac04de..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sid_ET.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk.properties
index 1e21fa6..e6c907d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = SKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk_SK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk_SK.properties
deleted file mode 100644
index ba4cd8d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sk_SK.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = SKK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl.properties
index 04df231..4d6d904 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl_SI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl_SI.properties
deleted file mode 100644
index 2153c4f..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sl_SI.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = SIT
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so.properties
index 986e49a..4c49b72 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = DJF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_DJ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_DJ.properties
deleted file mode 100644
index f2fbffa..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_DJ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = DJF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_ET.properties
index 8ac04de..4be1443 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_ET.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_ET.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_KE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_KE.properties
index ae0d8b5..7022999 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_KE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_KE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_SO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_SO.properties
index 43a47e0..86a6404 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_SO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_so_SO.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = SOS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq.properties
index 719accd..e16bf54 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ALL
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = MKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq_AL.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq_AL.properties
index dc9a3a9..77c6357 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq_AL.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sq_AL.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ALL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr.properties
index 99df0ab..7480039 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_BA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_BA.properties
deleted file mode 100644
index 4c90b6e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_BA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u043A\u043C
-defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_CS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_CS.properties
index cc30f6e..6a08b80 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_CS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_CS.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl.properties
index 04df231..6a08b80 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_BA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_BA.properties
index 4c90b6e..7480039 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_BA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_BA.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u043A\u043C
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_RS.properties
similarity index 75%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_RS.properties
index 04df231..ebdea96 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_RS.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_YU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_YU.properties
index 3f70f32..55db468 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_YU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_YU.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = YUM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn.properties
index 04df231..ebdea96 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_BA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_BA.properties
index 71efe9c..7480039 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_BA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_BA.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 km
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = BAM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_CS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_CS.properties
index cc30f6e..6a08b80 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_CS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_CS.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_ME.properties
similarity index 75%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_ME.properties
index cc30f6e..01b059a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_ME.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_YU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_YU.properties
index 3f70f32..55db468 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_YU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Latn_YU.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = YUM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_ME.properties
similarity index 75%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_ME.properties
index cc30f6e..6a08b80 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_Cyrl_CS.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_ME.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_RS.properties
similarity index 75%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_RS.properties
index 04df231..ebdea96 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_el_POLYTONI.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_RS.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_YU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_YU.properties
index 3f70f32..55db468 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_YU.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sr_YU.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0435
perMill = \u2030
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = YUM
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss.properties
index c5309fa..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = SZL
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_SZ.properties
similarity index 86%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_SZ.properties
index e777ce7..fffcaf2 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_SZ.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = BYR
+defCurrencyCode = SZL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_ZA.properties
deleted file mode 100644
index f1dea5d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ss_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st.properties
index f1dea5d..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_LS.properties
similarity index 86%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_LS.properties
index e777ce7..d3b42b6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_be_BY.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_LS.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = BYR
+defCurrencyCode = LSL
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_ZA.properties
deleted file mode 100644
index f1dea5d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_st_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_supplementalData.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_supplementalData.properties
deleted file mode 100644
index 36afe2e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_supplementalData.properties
+++ /dev/null
@@ -1 +0,0 @@
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv.properties
index 43f6829..0f7d937 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = \u2212
-exponentialSymbol = E
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = \u00A4\u00A4\u00A4
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_FI.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_FI.properties
deleted file mode 100644
index 43f6829..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_FI.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = \u2212
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = \u00A4\u00A4\u00A4
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = EUR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_SE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_SE.properties
index 9fc31b7..a91b39a 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_SE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sv_SE.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = \u2212
-exponentialSymbol = E
+exponentialSymbol = \u00D710^
perMill = \u2030
infinity = \u221E
notANumber = \u00A4\u00A4\u00A4
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0 %
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = #,##0\u00A0%
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = SEK
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw.properties
index 253d780..6c55e32 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_KE.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_KE.properties
index ae0d8b5..7022999 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_KE.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_KE.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = KES
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_TZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_TZ.properties
index fa35300..9c077a3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_TZ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_sw_TZ.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = TZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr.properties
index d51c175..1cfbd48 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr.properties
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+decimalPattern = #,##0.###;#,##0.###-
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00;\u00A4\u00A0#,##0.00-
+defCurrencyCode = SYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr_SY.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr_SY.properties
deleted file mode 100644
index eec0586..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_syr_SY.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###;#,##0.###-
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00;\u00A4 #,##0.00-
-defCurrencyCode = SYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta.properties
index a75628b..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta_IN.properties
deleted file mode 100644
index a75628b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ta_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te.properties
index d295487..378782b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te.properties
@@ -1,7 +1,7 @@
decimalSeparator = .
groupingSeparator = ,
percent = %
-zeroDigit = \u0C66
+zeroDigit = 0
plusSign = +
minusSign = -
exponentialSymbol = E
@@ -10,8 +10,8 @@
notANumber = NaN
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
+defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te_IN.properties
deleted file mode 100644
index 8a1383a..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_te_IN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = \u0C66
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##,##0%
-currencyPattern = \u00A4 #,##,##0.00
-defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg.properties
index d51c175..fcd4257 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = TJS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg_TJ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg_TJ.properties
deleted file mode 100644
index 0c35ce8..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tg_TJ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = TJS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th.properties
index d51c175..391b96d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
+defCurrencyCode = THB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th_TH.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th_TH.properties
deleted file mode 100644
index 1f8013d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_th_TH.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;\u00A4-#,##0.00
-defCurrencyCode = THB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti.properties
index c4d98a2..ed143a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ER.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ER.properties
deleted file mode 100644
index c57298d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ER.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ET.properties
index 8ac04de..4be1443 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ET.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ti_ET.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig.properties
index d51c175..ed143a9 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig_ER.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig_ER.properties
deleted file mode 100644
index c57298d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tig_ER.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ERN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tl.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_tl.properties
index f1dea5d..0202b42 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tl.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = PHP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn.properties
index 7047ca7..21174c3 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = BWP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn_ZA.properties
index f1dea5d..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tn_ZA.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_to.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_to.properties
index f1dea5d..b4c7c84 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_to.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = TOP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr.properties
index 7f23b4b..ab01c8d 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = % #,##0
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = %\u00A0#,##0
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = CYP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr_TR.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr_TR.properties
index d14b33d..aa4810e 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr_TR.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tr_TR.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = % #,##0
-currencyPattern = #,##0.00 \u00A4
+scientificPattern = #E0
+percentPattern = %\u00A0#,##0
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = TRY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_TW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_trv.properties
similarity index 82%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_TW.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_trv.properties
index a5a3ec7..a9cb110 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_TW.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_trv.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = TWD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts.properties
index d51c175..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts_ZA.properties
deleted file mode 100644
index f1dea5d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ts_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt.properties
index 1e21fa6..fabc021 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A4
+defCurrencyCode = RUB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt_RU.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt_RU.properties
deleted file mode 100644
index 588b61b..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_tt_RU.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00\u00A4
-defCurrencyCode = RUB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ug.properties
similarity index 82%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_ug.properties
index aeff2ab..5bffc72 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_CN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ug.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk.properties
index 1e21fa6..980c752 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = UAH
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk_UA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk_UA.properties
deleted file mode 100644
index 1334c6e..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uk_UA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = UAH
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur.properties
index 43572b8..4850fc7 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0642
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = \u06CC\u06C1 \u0639\u062F\u062F \u0646\u06C1\u06CC\u06BA
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_IN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_IN.properties
index 43572b8..1409887 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_IN.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_IN.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0642
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = \u06CC\u06C1 \u0639\u062F\u062F \u0646\u06C1\u06CC\u06BA
monetarySeparator = .
monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+decimalPattern = #,##,##0.###
+scientificPattern = #E0
+percentPattern = #,##,##0%
+currencyPattern = \u00A4\u00A0#,##,##0.00
defCurrencyCode = INR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_PK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_PK.properties
index 22a5a26..01c9ef4 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_PK.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ur_PK.properties
@@ -4,14 +4,14 @@
zeroDigit = 0
plusSign = +
minusSign = -
-exponentialSymbol = E
+exponentialSymbol = \u0642
perMill = \u2030
infinity = \u221E
-notANumber = NaN
+notANumber = \u06CC\u06C1 \u0639\u062F\u062F \u0646\u06C1\u06CC\u06BA
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = PKR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz.properties
index 1e21fa6..7f8dd02 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_AF.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_AF.properties
index bf44057..e2632e6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_AF.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_AF.properties
@@ -11,7 +11,7 @@
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
+currencyPattern = #,##0.00\u00A0\u00A4
defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab.properties
index f15a260..e2632e6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab.properties
@@ -11,7 +11,7 @@
monetarySeparator = \u066B
monetaryGroupingSeparator = \u066C
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab_AF.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab_AF.properties
deleted file mode 100644
index bf44057..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Arab_AF.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = \u066B
-groupingSeparator = \u066C
-percent = \u066A
-zeroDigit = \u06F0
-plusSign = +
-minusSign = \u2212
-exponentialSymbol = \u00D7\u06F1\u06F0^
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = \u066B
-monetaryGroupingSeparator = \u066C
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = AFN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl.properties
index 1e21fa6..edf580b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = UZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl_UZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl_UZ.properties
deleted file mode 100644
index 23c2380..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Cyrl_UZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = UZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn.properties
index 1e21fa6..edf580b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = UZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn_UZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn_UZ.properties
deleted file mode 100644
index 23c2380..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_Latn_UZ.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = \u00A0
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = \u00A0
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = UZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_UZ.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_UZ.properties
index 23c2380..edf580b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_UZ.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_uz_UZ.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4\u00A0#,##0.00
defCurrencyCode = UZS
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve.properties
index d51c175..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve.properties
@@ -1,5 +1,5 @@
-decimalSeparator = .
-groupingSeparator = ,
+decimalSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -8,10 +8,10 @@
perMill = \u2030
infinity = \u221E
notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetarySeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve_ZA.properties
deleted file mode 100644
index f1dea5d..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_ve_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi.properties
index f867d15..559093e 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi.properties
@@ -11,7 +11,7 @@
monetarySeparator = ,
monetaryGroupingSeparator = .
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = USD
+currencyPattern = #,##0.00\u00A0\u00A4
+defCurrencyCode = VND
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi_VN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi_VN.properties
deleted file mode 100644
index 4721cea..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_vi_VN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = .
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = .
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = #,##0.00 \u00A4
-defCurrencyCode = VND
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal.properties
index d51c175..6488ed4 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal.properties
@@ -1,5 +1,5 @@
decimalSeparator = .
-groupingSeparator = ,
+groupingSeparator = \u12C8
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = .
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u12C8
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal_ET.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal_ET.properties
deleted file mode 100644
index 3df47f9..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wal_ET.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = \u12C8
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = \u12C8
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = ETB
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wo.properties
similarity index 76%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_wo.properties
index f1dea5d..3731b56 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_nr_ZA.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_wo.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = XOF
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh.properties
index 2592557..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh.properties
@@ -1,5 +1,5 @@
decimalSeparator = ,
-groupingSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh_ZA.properties
deleted file mode 100644
index 2592557..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_xh_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo.properties
index d51c175..a948721 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4\u00A0#,##0.00
+defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo_NG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo_NG.properties
deleted file mode 100644
index 94b21f3..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_yo_NG.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = NGN
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh.properties
index bfe2cc3..ea823d6 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_HK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_HK.properties
index 6f71b32..c862eab 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_HK.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_HK.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = HKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans.properties
deleted file mode 100644
index d51c175..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_CN.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_CN.properties
deleted file mode 100644
index aeff2ab..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_CN.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = .
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = .
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00
-defCurrencyCode = CNY
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_HK.properties
similarity index 85%
rename from user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties
rename to user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_HK.properties
index c275926..47fe03b 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_HK.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = MTL
+defCurrencyCode = HKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_MO.properties
similarity index 85%
copy from user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties
copy to user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_MO.properties
index c275926..1f77e38 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_mt_MT.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_MO.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
-defCurrencyCode = MTL
+defCurrencyCode = MOP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_SG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_SG.properties
index 4c79239..8fcb184 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_SG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hans_SG.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = SGD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant.properties
index d51c175..d8776b0 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = USD
+currencyPattern = \u00A4#,##0.00
+defCurrencyCode = TWD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_HK.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_HK.properties
index 6f71b32..c862eab 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_HK.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_HK.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
defCurrencyCode = HKD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_MO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_MO.properties
index 78c9204..1f77e38 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_MO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_Hant_MO.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = MOP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_MO.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_MO.properties
index 78c9204..1f77e38 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_MO.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_MO.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4#,##0.00;(\u00A4#,##0.00)
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = MOP
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_SG.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_SG.properties
index 4c79239..8fcb184 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_SG.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_SG.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = SGD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_TW.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_TW.properties
index a5a3ec7..d8776b0 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_TW.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zh_TW.properties
@@ -11,7 +11,7 @@
monetarySeparator = .
monetaryGroupingSeparator = ,
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
currencyPattern = \u00A4#,##0.00
defCurrencyCode = TWD
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu.properties
index 2592557..18a7817 100644
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu.properties
+++ b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu.properties
@@ -1,5 +1,5 @@
decimalSeparator = ,
-groupingSeparator = ,
+groupingSeparator = \u00A0
percent = %
zeroDigit = 0
plusSign = +
@@ -9,9 +9,9 @@
infinity = \u221E
notANumber = NaN
monetarySeparator = ,
-monetaryGroupingSeparator = ,
+monetaryGroupingSeparator = \u00A0
decimalPattern = #,##0.###
-scientificPattern = 0.###E0
+scientificPattern = #E0
percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
+currencyPattern = \u00A4#,##0.00
defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu_ZA.properties b/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu_ZA.properties
deleted file mode 100644
index 2592557..0000000
--- a/user/src/com/google/gwt/i18n/client/constants/NumberConstants_zu_ZA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-decimalSeparator = ,
-groupingSeparator = ,
-percent = %
-zeroDigit = 0
-plusSign = +
-minusSign = -
-exponentialSymbol = E
-perMill = \u2030
-infinity = \u221E
-notANumber = NaN
-monetarySeparator = ,
-monetaryGroupingSeparator = ,
-decimalPattern = #,##0.###
-scientificPattern = 0.###E0
-percentPattern = #,##0%
-currencyPattern = \u00A4 #,##0.00
-defCurrencyCode = ZAR
diff --git a/user/src/com/google/gwt/i18n/tools/I18NSync.java b/user/src/com/google/gwt/i18n/tools/I18NSync.java
index 06bed9a..2bb7cfb 100644
--- a/user/src/com/google/gwt/i18n/tools/I18NSync.java
+++ b/user/src/com/google/gwt/i18n/tools/I18NSync.java
@@ -64,11 +64,6 @@
}
@Override
- public String[] getDefaultArgs() {
- return null;
- }
-
- @Override
public String getPurpose() {
return "Identifies the Constants/Messages class to be created. For example com.google.sample.i18n.client.Colors";
}
@@ -86,12 +81,6 @@
}
private class outDirHandler extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return null;
- }
-
@Override
public String getPurpose() {
return "Java source directory, defaults to the resource's class path.";
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 396df3d..bb6f721 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Google Inc.
+* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -28,7 +28,7 @@
import com.google.gwt.dev.cfg.Properties;
import com.google.gwt.dev.cfg.Property;
import com.google.gwt.dev.javac.CompilationUnit;
-import com.google.gwt.dev.shell.BrowserWidgetHost;
+import com.google.gwt.dev.util.arg.ArgHandlerLogLevel;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
import com.google.gwt.junit.client.TimeoutException;
import com.google.gwt.junit.client.impl.GWTRunner;
@@ -77,6 +77,7 @@
* {@link JUnitMessageQueue}, thus closing the loop.
* </p>
*/
+@SuppressWarnings("deprecation")
public class JUnitShell extends GWTShell {
/**
@@ -90,6 +91,199 @@
void processResult(TestCase testCase, JUnitResult result);
}
+ class ArgProcessor extends GWTShell.ArgProcessor {
+
+ public ArgProcessor() {
+ super(options, true, true);
+
+ // Override port to set auto by default.
+ registerHandler(new ArgHandlerPort(options) {
+ @Override
+ public String[] getDefaultArgs() {
+ return new String[] {"-port", "auto"};
+ }
+ });
+
+ // Override log level to set WARN by default..
+ registerHandler(new ArgHandlerLogLevel(options) {
+ @Override
+ protected Type getDefaultLogLevel() {
+ return TreeLogger.WARN;
+ }
+ });
+
+ registerHandler(new ArgHandlerFlag() {
+ @Override
+ public String getPurpose() {
+ return "Causes your test to run in web (compiled) mode (defaults to hosted mode)";
+ }
+
+ @Override
+ public String getTag() {
+ return "-web";
+ }
+
+ @Override
+ public boolean setFlag() {
+ runStyle = new RunStyleLocalWeb(JUnitShell.this);
+ numClients = 1;
+ return true;
+ }
+ });
+
+ registerHandler(new ArgHandlerString() {
+ @Override
+ public String getPurpose() {
+ return "Runs web mode via RMI to a set of BrowserManagerServers; "
+ + "e.g. rmi://localhost/ie6,rmi://localhost/firefox";
+ }
+
+ @Override
+ public String getTag() {
+ return "-remoteweb";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"rmiUrl"};
+ }
+
+ @Override
+ public boolean isUndocumented() {
+ return true;
+ }
+
+ @Override
+ public boolean setString(String str) {
+ String[] urls = str.split(",");
+ runStyle = RunStyleRemoteWeb.create(JUnitShell.this, urls);
+ numClients = urls.length;
+ return runStyle != null;
+ }
+ });
+
+ registerHandler(new ArgHandlerString() {
+ @Override
+ public String getPurpose() {
+ return "Runs web mode via HTTP to a set of Selenium servers; "
+ + "e.g. localhost:4444/*firefox,remotehost:4444/*iexplore";
+ }
+
+ @Override
+ public String getTag() {
+ return "-selenium";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"seleniumHost"};
+ }
+
+ @Override
+ public boolean setString(String str) {
+ String[] targets = str.split(",");
+ numClients = targets.length;
+ runStyle = RunStyleSelenium.create(JUnitShell.this, targets);
+ return runStyle != null;
+ }
+ });
+
+ registerHandler(new ArgHandlerString() {
+ @Override
+ public String getPurpose() {
+ return "Run external browsers in web mode (pass a comma separated list of executables.)";
+ }
+
+ @Override
+ public String getTag() {
+ return "-externalbrowser";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"browserPaths"};
+ }
+
+ @Override
+ public boolean isUndocumented() {
+ return true;
+ }
+
+ @Override
+ public boolean setString(String str) {
+ String[] paths = str.split(",");
+ runStyle = new RunStyleExternalBrowser(JUnitShell.this, paths);
+ numClients = paths.length;
+ return runStyle != null;
+ }
+ });
+
+ registerHandler(new ArgHandler() {
+ @Override
+ public String[] getDefaultArgs() {
+ return null;
+ }
+
+ @Override
+ public String getPurpose() {
+ return "Causes the system to wait for a remote browser to connect";
+ }
+
+ @Override
+ public String getTag() {
+ return "-manual";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"[numClients]"};
+ }
+
+ @Override
+ public int handle(String[] args, int tagIndex) {
+ int value = 1;
+ if (tagIndex + 1 < args.length) {
+ try {
+ // See if the next item is an integer.
+ value = Integer.parseInt(args[tagIndex + 1]);
+ if (value >= 1) {
+ setInt(value);
+ return 1;
+ }
+ } catch (NumberFormatException e) {
+ // fall-through
+ }
+ }
+ setInt(1);
+ return 0;
+ }
+
+ public void setInt(int value) {
+ runStyle = new RunStyleManual(JUnitShell.this, value);
+ numClients = value;
+ }
+ });
+
+ registerHandler(new ArgHandlerFlag() {
+ @Override
+ public String getPurpose() {
+ return "Causes the log window and browser windows to be displayed; useful for debugging";
+ }
+
+ @Override
+ public String getTag() {
+ return "-notHeadless";
+ }
+
+ @Override
+ public boolean setFlag() {
+ setHeadless(false);
+ return true;
+ }
+ });
+ }
+ }
+
private static class JUnitStrategy implements Strategy {
public String getModuleInherit() {
return "com.google.gwt.junit.JUnit";
@@ -212,8 +406,8 @@
unitTestShell = new JUnitShell();
unitTestShell.lastLaunchFailed = true;
String[] args = unitTestShell.synthesizeArgs();
- if (!unitTestShell.processArgs(args)) {
-
+ ArgProcessor argProcessor = unitTestShell.new ArgProcessor();
+ if (!argProcessor.processArgs(args)) {
throw new JUnitFatalLaunchException("Error processing shell arguments");
}
@@ -223,6 +417,7 @@
if (!unitTestShell.startUp()) {
throw new JUnitFatalLaunchException("Shell failed to start");
}
+ // TODO: install a shutdown hook? Not necessary with GWTShell.
unitTestShell.lastLaunchFailed = false;
}
@@ -250,6 +445,16 @@
private boolean lastLaunchFailed;
/**
+ * We need to keep a hard reference to the last module that was launched until
+ * all client browsers have successfully transitioned to the current module.
+ * Failure to do so allows the last module to be GC'd, which transitively
+ * kills the {@link com.google.gwt.junit.server.JUnitHostImpl} servlet. If the
+ * servlet dies, the client browsers will be unable to transition.
+ */
+ @SuppressWarnings("unused")
+ private ModuleDef lastModule;
+
+ /**
* Portal to interact with the servlet.
*/
private JUnitMessageQueue messageQueue;
@@ -278,208 +483,18 @@
private long testBeginTimeout;
/**
- * Timeout for individual test method. If System.currentTimeMillis() is later
- * than this timestamp, then we need to pack up and go home. Zero for "not
- * yet set" (at the start of a test). This interval begins when the
+ * Timeout for individual test method. If System.currentTimeMillis() is later
+ * than this timestamp, then we need to pack up and go home. Zero for "not
+ * yet set" (at the start of a test). This interval begins when the
* testBeginTimeout interval is done.
*/
private long testMethodTimeout;
-
- /**
- * We need to keep a hard reference to the last module that was launched until
- * all client browsers have successfully transitioned to the current module.
- * Failure to do so allows the last module to be GC'd, which transitively
- * kills the {@link com.google.gwt.junit.server.JUnitHostImpl} servlet. If the
- * servlet dies, the client browsers will be unable to transition.
- */
- @SuppressWarnings("unused")
- private ModuleDef lastModule;
/**
* Enforce the singleton pattern. The call to {@link GWTShell}'s ctor forces
* server mode and disables processing extra arguments as URLs to be shown.
*/
private JUnitShell() {
- super(true, true);
-
- registerHandler(new ArgHandlerFlag() {
-
- @Override
- public String getPurpose() {
- return "Causes your test to run in web (compiled) mode (defaults to hosted mode)";
- }
-
- @Override
- public String getTag() {
- return "-web";
- }
-
- @Override
- public boolean setFlag() {
- runStyle = new RunStyleLocalWeb(JUnitShell.this);
- numClients = 1;
- return true;
- }
-
- });
-
- registerHandler(new ArgHandlerString() {
-
- @Override
- public String getPurpose() {
- return "Runs web mode via RMI to a set of BrowserManagerServers; "
- + "e.g. rmi://localhost/ie6,rmi://localhost/firefox";
- }
-
- @Override
- public String getTag() {
- return "-remoteweb";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"rmiUrl"};
- }
-
- @Override
- public boolean isUndocumented() {
- return true;
- }
-
- @Override
- public boolean setString(String str) {
- String[] urls = str.split(",");
- runStyle = RunStyleRemoteWeb.create(JUnitShell.this, urls);
- numClients = urls.length;
- return runStyle != null;
- }
- });
-
- registerHandler(new ArgHandlerString() {
-
- @Override
- public String getPurpose() {
- return "Runs web mode via HTTP to a set of Selenium servers; "
- + "e.g. localhost:4444/*firefox,remotehost:4444/*iexplore";
- }
-
- @Override
- public String getTag() {
- return "-selenium";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"seleniumHost"};
- }
-
- @Override
- public boolean setString(String str) {
- String[] targets = str.split(",");
- numClients = targets.length;
- runStyle = RunStyleSelenium.create(JUnitShell.this, targets);
- return runStyle != null;
- }
- });
-
- registerHandler(new ArgHandlerString() {
-
- @Override
- public String getPurpose() {
- return "Run external browsers in web mode (pass a comma separated list of executables.)";
- }
-
- @Override
- public String getTag() {
- return "-externalbrowser";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"browserPaths"};
- }
-
- @Override
- public boolean isUndocumented() {
- return true;
- }
-
- @Override
- public boolean setString(String str) {
- String[] paths = str.split(",");
- runStyle = new RunStyleExternalBrowser(JUnitShell.this, paths);
- numClients = paths.length;
- return runStyle != null;
- }
- });
-
- registerHandler(new ArgHandler() {
-
- @Override
- public String[] getDefaultArgs() {
- return null;
- }
-
- @Override
- public String getPurpose() {
- return "Causes the system to wait for a remote browser to connect";
- }
-
- @Override
- public String getTag() {
- return "-manual";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"[numClients]"};
- }
-
- @Override
- public int handle(String[] args, int tagIndex) {
- int value = 1;
- if (tagIndex + 1 < args.length) {
- try {
- // See if the next item is an integer.
- value = Integer.parseInt(args[tagIndex + 1]);
- if (value >= 1) {
- setInt(value);
- return 1;
- }
- } catch (NumberFormatException e) {
- // fall-through
- }
- }
- setInt(1);
- return 0;
- }
-
- public void setInt(int value) {
- runStyle = new RunStyleManual(JUnitShell.this, value);
- numClients = value;
- }
-
- });
-
- registerHandler(new ArgHandlerFlag() {
-
- @Override
- public String getPurpose() {
- return "Causes the log window and browser windows to be displayed; useful for debugging";
- }
-
- @Override
- public String getTag() {
- return "-notHeadless";
- }
-
- @Override
- public boolean setFlag() {
- setHeadless(false);
- return true;
- }
- });
-
setRunTomcat(true);
setHeadless(true);
@@ -498,11 +513,6 @@
}
}
- @Override
- protected Type doGetDefaultLogLevel() {
- return Type.WARN;
- }
-
/**
* Never check for updates in JUnit mode.
*/
@@ -512,16 +522,6 @@
}
@Override
- protected ArgHandlerPort getArgHandlerPort() {
- return new ArgHandlerPort() {
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-port", "auto"};
- }
- };
- }
-
- @Override
protected void initializeLogger() {
if (isHeadless()) {
consoleLogger = new PrintWriterTreeLogger();
@@ -609,9 +609,7 @@
((BindingProperty) userAgent).setAllowedValues(userAgentString);
}
}
- BrowserWidgetHost browserHost = getBrowserHost();
- assert (browserHost != null);
- browserHost.compile(module);
+ super.compile(getTopLogger(), module);
}
/**
diff --git a/user/src/com/google/gwt/junit/remote/BrowserManagerServerLauncher.java b/user/src/com/google/gwt/junit/remote/BrowserManagerServerLauncher.java
index b383b62..e382a00 100644
--- a/user/src/com/google/gwt/junit/remote/BrowserManagerServerLauncher.java
+++ b/user/src/com/google/gwt/junit/remote/BrowserManagerServerLauncher.java
@@ -77,12 +77,6 @@
* line.
*/
private class ArgHandlerRegistration extends ArgHandler {
-
- @Override
- public String[] getDefaultArgs() {
- return null;
- }
-
@Override
public String getPurpose() {
return "Specify two arguments: a registration id used for the "
diff --git a/user/src/com/google/gwt/junit/tools/JUnit-hosted.launchsrc b/user/src/com/google/gwt/junit/tools/JUnit-hosted.launchsrc
index 49a8345..eea3a6b 100644
--- a/user/src/com/google/gwt/junit/tools/JUnit-hosted.launchsrc
+++ b/user/src/com/google/gwt/junit/tools/JUnit-hosted.launchsrc
@@ -13,6 +13,6 @@
@eclipseExtraLaunchPaths
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args="-out www-test" -Xmx256M"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args="-out www-test" -Xmx256M @vmargs"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
diff --git a/user/src/com/google/gwt/junit/tools/JUnit-web.launchsrc b/user/src/com/google/gwt/junit/tools/JUnit-web.launchsrc
index 56f35ad..97eff72 100644
--- a/user/src/com/google/gwt/junit/tools/JUnit-web.launchsrc
+++ b/user/src/com/google/gwt/junit/tools/JUnit-web.launchsrc
@@ -13,6 +13,6 @@
@eclipseExtraLaunchPaths
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args="-web -out www-test" -Xmx256M"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args="-web -out www-test" -Xmx256M @vmargs"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
diff --git a/user/src/com/google/gwt/user/Hyperlink.gwt.xml b/user/src/com/google/gwt/user/Hyperlink.gwt.xml
new file mode 100644
index 0000000..e667c13
--- /dev/null
+++ b/user/src/com/google/gwt/user/Hyperlink.gwt.xml
@@ -0,0 +1,19 @@
+<module>
+ <inherits name="com.google.gwt.core.Core"/>
+ <inherits name="com.google.gwt.user.UserAgent"/>
+
+ <replace-with class="com.google.gwt.user.client.ui.impl.HyperlinkImplOpera">
+ <when-type-is class="com.google.gwt.user.client.ui.impl.HyperlinkImpl"/>
+ <when-property-is name="user.agent" value="opera"/>
+ </replace-with>
+
+ <replace-with class="com.google.gwt.user.client.ui.impl.HyperlinkImplSafari">
+ <when-type-is class="com.google.gwt.user.client.ui.impl.HyperlinkImpl"/>
+ <when-property-is name="user.agent" value="safari"/>
+ </replace-with>
+
+ <replace-with class="com.google.gwt.user.client.ui.impl.HyperlinkImplIE">
+ <when-type-is class="com.google.gwt.user.client.ui.impl.HyperlinkImpl"/>
+ <when-property-is name="user.agent" value="ie6"/>
+ </replace-with>
+</module>
diff --git a/user/src/com/google/gwt/user/User.gwt.xml b/user/src/com/google/gwt/user/User.gwt.xml
index 4750266..53931c4 100644
--- a/user/src/com/google/gwt/user/User.gwt.xml
+++ b/user/src/com/google/gwt/user/User.gwt.xml
@@ -40,7 +40,8 @@
<inherits name="com.google.gwt.user.CaptionPanel" />
<inherits name="com.google.gwt.user.Window" />
<inherits name="com.google.gwt.user.Tree"/>
-
+ <inherits name="com.google.gwt.user.Hyperlink"/>
+ <inherits name="com.google.gwt.user.datepicker.DatePicker"/>
<super-source path="translatable"/>
<source path="client"/>
diff --git a/user/src/com/google/gwt/user/client/Window.java b/user/src/com/google/gwt/user/client/Window.java
index dae2416..392bd01 100644
--- a/user/src/com/google/gwt/user/client/Window.java
+++ b/user/src/com/google/gwt/user/client/Window.java
@@ -20,7 +20,6 @@
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.event.logical.shared.HasCloseHandlers;
-import com.google.gwt.event.logical.shared.HasHandlers;
import com.google.gwt.event.logical.shared.HasResizeHandlers;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
@@ -28,6 +27,7 @@
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.impl.WindowImpl;
diff --git a/user/src/com/google/gwt/user/client/impl/HistoryImpl.java b/user/src/com/google/gwt/user/client/impl/HistoryImpl.java
index d5c8800..62e7c75 100644
--- a/user/src/com/google/gwt/user/client/impl/HistoryImpl.java
+++ b/user/src/com/google/gwt/user/client/impl/HistoryImpl.java
@@ -17,12 +17,12 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
-import com.google.gwt.event.logical.shared.HasHandlers;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
/**
* Native implementation associated with
diff --git a/user/src/com/google/gwt/user/client/ui/Accessibility.java b/user/src/com/google/gwt/user/client/ui/Accessibility.java
index e6cf056..b523f17 100644
--- a/user/src/com/google/gwt/user/client/ui/Accessibility.java
+++ b/user/src/com/google/gwt/user/client/ui/Accessibility.java
@@ -59,6 +59,7 @@
public static final String STATE_EXPANDED = "aria-expanded";
public static final String STATE_LEVEL = "aria-level";
public static final String STATE_HASPOPUP = "aria-haspopup";
+ public static final String STATE_PRESSED = "aria-pressed";
private static final String ATTR_NAME_ROLE = "role";
diff --git a/user/src/com/google/gwt/user/client/ui/CheckBox.java b/user/src/com/google/gwt/user/client/ui/CheckBox.java
index a9eba4f..a40700b 100644
--- a/user/src/com/google/gwt/user/client/ui/CheckBox.java
+++ b/user/src/com/google/gwt/user/client/ui/CheckBox.java
@@ -135,6 +135,11 @@
return DOM.getInnerText(labelElem);
}
+ /**
+ * Determines whether this check box is currently checked.
+ *
+ * @return <code>true</code> if the check box is checked
+ */
public Boolean getValue() {
return isChecked();
}
@@ -163,7 +168,7 @@
* Checks or unchecks this check box. Does not fire {@link ValueChangeEvent}.
* (If you want the event to fire, use {@link #setValue(boolean, boolean)})
*
- * @param checked <code>true</code> to check the check box
+ * @param checked <code>true</code> to check the check box.
*/
public void setChecked(boolean checked) {
DOM.setElementPropertyBoolean(inputElem, "checked", checked);
@@ -214,12 +219,29 @@
DOM.setInnerText(labelElem, text);
}
+ /**
+ * Checks or unchecks the text box.
+ * @param value true to check, false to uncheck. Must not be null.
+ * @thows IllegalArgumentException if value is null
+ */
public void setValue(Boolean value) {
setValue(value, false);
}
+ /**
+ * Checks or unchecks the text box, firing {@link ValueChangeEvent}
+ * if appropriate.
+ *
+ * @param value true to check, false to uncheck. Must not be null.
+ * @param fireEvents If true, and value has changed, fire a
+ * {@link ValueChangeEvent}
+ * @thows IllegalArgumentException if value is null
+ */
public void setValue(Boolean value, boolean fireEvents) {
- assert null != value : "Value must not be null";
+ if (value == null) {
+ throw new IllegalArgumentException("value must not be null");
+ }
+
if (isChecked() == value) {
return;
}
diff --git a/user/src/com/google/gwt/user/client/ui/CustomButton.java b/user/src/com/google/gwt/user/client/ui/CustomButton.java
index 35b4817..89efb9b 100644
--- a/user/src/com/google/gwt/user/client/ui/CustomButton.java
+++ b/user/src/com/google/gwt/user/client/ui/CustomButton.java
@@ -681,6 +681,9 @@
super.setEnabled(enabled);
if (!enabled) {
cleanupCaptureState();
+ Accessibility.removeState(getElement(), Accessibility.STATE_PRESSED);
+ } else {
+ setAriaPressed(getCurrentFace());
}
}
}
@@ -837,6 +840,10 @@
curFace = newFace;
setCurrentFaceElement(newFace.getFace());
addStyleDependentName(curFace.getName());
+
+ if (isEnabled()) {
+ setAriaPressed(newFace);
+ }
}
}
@@ -906,6 +913,12 @@
}
}
+ private void setAriaPressed(Face newFace) {
+ boolean pressed = (newFace.getFaceID() & DOWN_ATTRIBUTE) == 1;
+ Accessibility.setState(getElement(), Accessibility.STATE_PRESSED,
+ pressed ? "true" : "false");
+ }
+
/**
* Sets the current face based on the faceID.
*
diff --git a/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java b/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java
index 32e6be8..87cbbea 100644
--- a/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java
+++ b/user/src/com/google/gwt/user/client/ui/DisclosurePanel.java
@@ -50,6 +50,7 @@
* selector:<br/> .gwt-DisclosurePanel-open .header { ... }
* </p>
*/
+@SuppressWarnings("deprecation")
public final class DisclosurePanel extends Composite implements
FiresDisclosureEvents, HasWidgets, HasAnimation,
HasOpenHandlers<DisclosurePanel>, HasCloseHandlers<DisclosurePanel> {
@@ -261,8 +262,7 @@
/**
* top level widget. The first child will be a reference to {@link #header}.
- * The second child will either not exist or be a non-null to reference to
- * {@link #content}.
+ * The second child will be a reference to {@link #contentWrapper}.
*/
private final VerticalPanel mainPanel = new VerticalPanel();
@@ -276,11 +276,6 @@
*/
private final ClickableHeader header = new ClickableHeader();
- /**
- * the content widget, this can be null.
- */
- private Widget content;
-
private boolean isAnimationEnabled = false;
private boolean isOpen = false;
@@ -391,7 +386,7 @@
* @return the panel's current content widget
*/
public Widget getContent() {
- return content;
+ return contentWrapper.getWidget();
}
/**
@@ -462,7 +457,7 @@
* @param content the widget to be used as the content panel
*/
public void setContent(Widget content) {
- final Widget currentContent = this.content;
+ final Widget currentContent = getContent();
// Remove existing content widget.
if (currentContent != null) {
@@ -471,7 +466,6 @@
}
// Add new content widget if != null.
- this.content = content;
if (content != null) {
contentWrapper.setWidget(content);
content.addStyleName(STYLENAME_CONTENT);
@@ -544,7 +538,7 @@
addStyleDependentName(STYLENAME_SUFFIX_CLOSED);
}
- if (content != null) {
+ if (getContent() != null) {
if (contentAnimation == null) {
contentAnimation = new ContentAnimation();
}
diff --git a/user/src/com/google/gwt/user/client/ui/FiresDisclosureEvents.java b/user/src/com/google/gwt/user/client/ui/FiresDisclosureEvents.java
index 6ea43b2..2731117 100644
--- a/user/src/com/google/gwt/user/client/ui/FiresDisclosureEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/FiresDisclosureEvents.java
@@ -15,12 +15,18 @@
*/
package com.google.gwt.user.client.ui;
+
/**
- * A widget that implements this interface fires the events defined by
- * the {@link DisclosureHandler} interface.
+ * A widget that implements this interface fires the events defined by the
+ * {@link DisclosureHandler} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.logical.shared.HasOpenHandlers}
+ * and {@link com.google.gwt.event.logical.shared.HasCloseHandlers}
+ * instead
*/
+@Deprecated
public interface FiresDisclosureEvents {
-
+
/**
* Adds a handler interface to receive open events.
*
@@ -29,7 +35,7 @@
*/
@Deprecated
void addEventHandler(DisclosureHandler handler);
-
+
/**
* Removes a previously added handler interface.
*
diff --git a/user/src/com/google/gwt/user/client/ui/FiresFormEvents.java b/user/src/com/google/gwt/user/client/ui/FiresFormEvents.java
index a4a6541..a99535e 100644
--- a/user/src/com/google/gwt/user/client/ui/FiresFormEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/FiresFormEvents.java
@@ -18,15 +18,19 @@
/**
* A widget that implements this interface fires the events defined by the
* {@link com.google.gwt.user.client.ui.FormHandler} interface.
+ *
+ * @deprecated Only {@link FormPanel} was expected to use this interface.
+ * Instead, it now uses {@link FormPanel.SubmitCompleteEvent} and
+ * {@link SubmitEvent}.
*/
-
+@Deprecated
public interface FiresFormEvents {
/**
* Adds a handler interface to receive click events.
*
* @deprecated use {@link FormPanel#addSubmitCompleteHandler} and
- * {@link FormPanel#addSubmitHandler} instead
+ * {@link FormPanel#addSubmitHandler} instead
* @param handler the handler interface to add
*/
@Deprecated
diff --git a/user/src/com/google/gwt/user/client/ui/FiresSuggestionEvents.java b/user/src/com/google/gwt/user/client/ui/FiresSuggestionEvents.java
index 1e24d57..0627a6f 100644
--- a/user/src/com/google/gwt/user/client/ui/FiresSuggestionEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/FiresSuggestionEvents.java
@@ -18,7 +18,12 @@
/**
* A widget that implements this interface fires the events defined by the
* {@link SuggestionHandler} interface.
+ *
+ * @deprecated use
+ * {@link com.google.gwt.event.logical.shared.HasSelectionHandlers}
+ * instead.
*/
+@Deprecated
public interface FiresSuggestionEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/FocusPanel.java b/user/src/com/google/gwt/user/client/ui/FocusPanel.java
index a8feb75..a0665f6 100644
--- a/user/src/com/google/gwt/user/client/ui/FocusPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/FocusPanel.java
@@ -50,6 +50,7 @@
* A simple panel that makes its contents focusable, and adds the ability to
* catch mouse and keyboard events.
*/
+@SuppressWarnings("deprecation")
public class FocusPanel extends SimplePanel implements HasFocus,
SourcesClickEvents, SourcesMouseEvents, SourcesMouseWheelEvents,
HasAllMouseHandlers, HasClickHandlers, HasAllKeyHandlers,
diff --git a/user/src/com/google/gwt/user/client/ui/FocusWidget.java b/user/src/com/google/gwt/user/client/ui/FocusWidget.java
index 2c0757a..7cdcb13 100644
--- a/user/src/com/google/gwt/user/client/ui/FocusWidget.java
+++ b/user/src/com/google/gwt/user/client/ui/FocusWidget.java
@@ -51,6 +51,7 @@
/**
* Abstract base class for most widgets that can receive keyboard focus.
*/
+@SuppressWarnings("deprecation")
public abstract class FocusWidget extends Widget implements SourcesClickEvents,
HasClickHandlers, HasFocus, HasAllFocusHandlers, HasAllKeyHandlers,
HasAllMouseHandlers, SourcesMouseEvents {
diff --git a/user/src/com/google/gwt/user/client/ui/FormPanel.java b/user/src/com/google/gwt/user/client/ui/FormPanel.java
index 8b489e3..619849e 100644
--- a/user/src/com/google/gwt/user/client/ui/FormPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/FormPanel.java
@@ -59,6 +59,7 @@
* {@example com.google.gwt.examples.FormPanelExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class FormPanel extends SimplePanel implements FiresFormEvents,
FormPanelImplHost {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/HTMLTable.java b/user/src/com/google/gwt/user/client/ui/HTMLTable.java
index 0899be8..77bd5eb 100644
--- a/user/src/com/google/gwt/user/client/ui/HTMLTable.java
+++ b/user/src/com/google/gwt/user/client/ui/HTMLTable.java
@@ -37,6 +37,7 @@
* <img class='gallery' src='Table.png'/>
* </p>
*/
+@SuppressWarnings("deprecation")
public abstract class HTMLTable extends Panel implements SourcesTableEvents,
HasClickHandlers {
diff --git a/user/src/com/google/gwt/user/client/ui/HasFocus.java b/user/src/com/google/gwt/user/client/ui/HasFocus.java
index 6fb4b75..c869bd4 100644
--- a/user/src/com/google/gwt/user/client/ui/HasFocus.java
+++ b/user/src/com/google/gwt/user/client/ui/HasFocus.java
@@ -18,6 +18,7 @@
/**
* A widget that implements this interface can receive keyboard focus.
*/
+@SuppressWarnings("deprecation")
public interface HasFocus extends SourcesFocusEvents, SourcesKeyboardEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/HasValue.java b/user/src/com/google/gwt/user/client/ui/HasValue.java
index 0c7d36f..d8ec389 100644
--- a/user/src/com/google/gwt/user/client/ui/HasValue.java
+++ b/user/src/com/google/gwt/user/client/ui/HasValue.java
@@ -18,13 +18,10 @@
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
/**
- * An object that implements this interface should be a user input widget, where
- * the user and programmer can both set and get the object's value.
- * <p>
- * It is a requirement that a value passed to {@link setValue} be
- * {@link Object#equals} to that returned by an immediately succeeding call to
- * {@link getValue}, or that both be null. Note that this is not a requirement
- * that <code>setValue(null)</code> be supported by all implementors.
+ * An object that implements this interface should be a user input
+ * widget, where the user and programmer can both set and get the
+ * object's value. It is intended to provide a unified interface to
+ * widgets with "atomic" values, like Strings and Dates.
*
* @param <T> the type of value.
*/
@@ -43,6 +40,10 @@
* <p>
* It is acceptable to fail assertions or throw (documented) unchecked
* exceptions in response to bad values.
+ * <p>
+ * By convention, GWT widgets that can be cleared accept null for
+ * <code>value</code>, but it is acceptable for widgets that cannot
+ * be cleared to throw an exception for null values.
*
* @param value the object's new value
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Hyperlink.java b/user/src/com/google/gwt/user/client/ui/Hyperlink.java
index 981ed9e..c4ceead 100644
--- a/user/src/com/google/gwt/user/client/ui/Hyperlink.java
+++ b/user/src/com/google/gwt/user/client/ui/Hyperlink.java
@@ -15,6 +15,7 @@
*/
package com.google.gwt.user.client.ui;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -23,6 +24,7 @@
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.ui.impl.HyperlinkImpl;
/**
* A widget that serves as an "internal" hyperlink. That is, it is a link to
@@ -49,20 +51,20 @@
* <h3>Example</h3> {@example com.google.gwt.examples.HistoryExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class Hyperlink extends Widget implements HasHTML, SourcesClickEvents,
HasClickHandlers {
- private Element anchorElem;
+ private static HyperlinkImpl impl = GWT.create(HyperlinkImpl.class);
+
+ private final Element anchorElem = DOM.createAnchor();
private String targetHistoryToken;
/**
* Creates an empty hyperlink.
*/
public Hyperlink() {
- setElement(DOM.createDiv());
- DOM.appendChild(getElement(), anchorElem = DOM.createAnchor());
- sinkEvents(Event.ONCLICK);
- setStyleName("gwt-Hyperlink");
+ this(DOM.createDiv());
}
/**
@@ -94,6 +96,18 @@
setText(text);
setTargetHistoryToken(targetHistoryToken);
}
+
+ protected Hyperlink(Element elem) {
+ if (elem == null) {
+ setElement(anchorElem);
+ } else {
+ setElement(elem);
+ DOM.appendChild(getElement(), anchorElem);
+ }
+
+ sinkEvents(Event.ONCLICK);
+ setStyleName("gwt-Hyperlink");
+ }
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addHandler(handler, ClickEvent.getType());
@@ -126,8 +140,11 @@
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {
super.onBrowserEvent(event);
- History.newItem(targetHistoryToken);
- DOM.eventPreventDefault(event);
+
+ if (impl.handleAsClick(event)) {
+ History.newItem(getTargetHistoryToken());
+ DOM.eventPreventDefault(event);
+ }
}
}
diff --git a/user/src/com/google/gwt/user/client/ui/Image.java b/user/src/com/google/gwt/user/client/ui/Image.java
index 09d968c..7ddfeff 100644
--- a/user/src/com/google/gwt/user/client/ui/Image.java
+++ b/user/src/com/google/gwt/user/client/ui/Image.java
@@ -85,6 +85,7 @@
* {@example com.google.gwt.examples.ImageExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class Image extends Widget implements SourcesLoadEvents,
HasLoadHandlers, HasErrorHandlers, SourcesClickEvents, HasClickHandlers,
HasAllMouseHandlers, SourcesMouseEvents {
diff --git a/user/src/com/google/gwt/user/client/ui/InlineHyperlink.java b/user/src/com/google/gwt/user/client/ui/InlineHyperlink.java
new file mode 100644
index 0000000..40a42cb
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/InlineHyperlink.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.client.ui;
+
+/**
+ * A widget that serves as an "internal" hyperlink. That is, it is a link to
+ * another state of the running application. It should behave exactly like
+ * {@link com.google.gwt.user.client.ui.Hyperlink}, save that it lays out
+ * as an inline element, not block.
+ *
+ * <h3>CSS Style Rules</h3>
+ * <ul class='css'>
+ * <li>.gwt-InlineHyperlink { }</li>
+ * </ul>
+ */
+public class InlineHyperlink extends Hyperlink {
+
+ /**
+ * Creates an empty hyperlink.
+ */
+ public InlineHyperlink() {
+ super(null);
+
+ setStyleName("gwt-InlineHyperlink");
+ }
+
+ /**
+ * Creates a hyperlink with its text and target history token specified.
+ *
+ * @param text the hyperlink's text
+ * @param asHTML <code>true</code> to treat the specified text as html
+ * @param targetHistoryToken the history token to which it will link
+ * @see #setTargetHistoryToken
+ */
+ public InlineHyperlink(String text, boolean asHTML, String targetHistoryToken) {
+ this();
+
+ if (asHTML) {
+ setHTML(text);
+ } else {
+ setText(text);
+ }
+ setTargetHistoryToken(targetHistoryToken);
+ }
+
+ /**
+ * Creates a hyperlink with its text and target history token specified.
+ *
+ * @param text the hyperlink's text
+ * @param targetHistoryToken the history token to which it will link
+ */
+ public InlineHyperlink(String text, String targetHistoryToken) {
+ this(text, false, targetHistoryToken);
+ }
+}
diff --git a/user/src/com/google/gwt/user/client/ui/Label.java b/user/src/com/google/gwt/user/client/ui/Label.java
index b470fd8..89a7ef9 100644
--- a/user/src/com/google/gwt/user/client/ui/Label.java
+++ b/user/src/com/google/gwt/user/client/ui/Label.java
@@ -53,6 +53,7 @@
* {@example com.google.gwt.examples.HTMLExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class Label extends Widget implements HasHorizontalAlignment, HasText,
HasWordWrap, HasDirection, HasClickHandlers, SourcesClickEvents,
SourcesMouseEvents, HasAllMouseHandlers {
diff --git a/user/src/com/google/gwt/user/client/ui/ListBox.java b/user/src/com/google/gwt/user/client/ui/ListBox.java
index 9a10f59..d94c1f3 100644
--- a/user/src/com/google/gwt/user/client/ui/ListBox.java
+++ b/user/src/com/google/gwt/user/client/ui/ListBox.java
@@ -42,6 +42,7 @@
* {@example com.google.gwt.examples.ListBoxExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class ListBox extends FocusWidget implements SourcesChangeEvents,
HasChangeHandlers, HasName {
diff --git a/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java b/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java
index bdf3024..ce639b9 100644
--- a/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java
+++ b/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java
@@ -91,7 +91,8 @@
@Deprecated
abstract class ListenerWrapper<T> implements EventHandler {
- public static class Change extends ListenerWrapper<ChangeListener> implements ChangeHandler {
+ public static class Change extends ListenerWrapper<ChangeListener> implements
+ ChangeHandler {
@Deprecated
public static void add(HasChangeHandlers source, ChangeListener listener) {
source.addChangeHandler(new Change(listener));
@@ -110,7 +111,8 @@
}
}
- public static class Click extends ListenerWrapper<ClickListener> implements ClickHandler {
+ public static class Click extends ListenerWrapper<ClickListener> implements
+ ClickHandler {
@Deprecated
public static Click add(HasClickHandlers source, ClickListener listener) {
Click rtn = new Click(listener);
@@ -131,8 +133,8 @@
}
}
- public static class Disclosure extends ListenerWrapper<DisclosureHandler> implements
- CloseHandler<DisclosurePanel>, OpenHandler<DisclosurePanel> {
+ public static class Disclosure extends ListenerWrapper<DisclosureHandler>
+ implements CloseHandler<DisclosurePanel>, OpenHandler<DisclosurePanel> {
public static void add(DisclosurePanel source, DisclosureHandler listener) {
Disclosure handlers = new Disclosure(listener);
@@ -161,8 +163,8 @@
/*
* Handler wrapper for {@link FocusListener}.
*/
- public static class Focus extends ListenerWrapper<FocusListener> implements FocusHandler,
- BlurHandler {
+ public static class Focus extends ListenerWrapper<FocusListener> implements
+ FocusHandler, BlurHandler {
public static <EventSourceType extends Widget & HasAllFocusHandlers> Focus add(
EventSourceType source, FocusListener listener) {
@@ -221,8 +223,8 @@
}
}
- public static class Load extends ListenerWrapper<LoadListener> implements LoadHandler,
- ErrorHandler {
+ public static class Load extends ListenerWrapper<LoadListener> implements
+ LoadHandler, ErrorHandler {
public static void add(HasLoadHandlers source, LoadListener listener) {
source.addLoadHandler(new Load(listener));
@@ -285,23 +287,11 @@
}
public void onMouseOut(MouseOutEvent event) {
- // Only fire the mouseLeave event if it's actually leaving this
- // widget.
- Element to = event.getToElement();
- Widget source = source(event);
- if (to == null || !source.getElement().isOrHasChild(to)) {
- listener.onMouseLeave(source(event));
- }
+ listener.onMouseLeave(source(event));
}
public void onMouseOver(MouseOverEvent event) {
- // Only fire the mouseEnter event if it's coming from outside this
- // widget.
- Element from = event.getFromElement();
- Widget source = source(event);
- if (from == null || !source.getElement().isOrHasChild(from)) {
- listener.onMouseEnter(source(event));
- }
+ listener.onMouseEnter(source(event));
}
public void onMouseUp(MouseUpEvent event) {
@@ -311,9 +301,10 @@
event.getRelativeY(elem));
}
}
- public static class MouseWheel extends ListenerWrapper<MouseWheelListener> implements
- MouseWheelHandler {
- public static void add(HasMouseWheelHandlers source, MouseWheelListener listener) {
+ public static class MouseWheel extends ListenerWrapper<MouseWheelListener>
+ implements MouseWheelHandler {
+ public static void add(HasMouseWheelHandlers source,
+ MouseWheelListener listener) {
source.addMouseWheelHandler(new MouseWheel(listener));
}
@@ -334,7 +325,8 @@
public static class Popup extends ListenerWrapper<PopupListener> implements
CloseHandler<PopupPanel> {
- public static void add(HasCloseHandlers<PopupPanel> source, PopupListener listener) {
+ public static void add(HasCloseHandlers<PopupPanel> source,
+ PopupListener listener) {
source.addCloseHandler(new Popup(listener));
}
@@ -352,7 +344,8 @@
}
}
- public static class Scroll extends ListenerWrapper<ScrollListener> implements ScrollHandler {
+ public static class Scroll extends ListenerWrapper<ScrollListener> implements
+ ScrollHandler {
public static void add(HasScrollHandlers source, ScrollListener listener) {
source.addScrollHandler(new Scroll(listener));
@@ -375,8 +368,8 @@
}
}
- public static class Suggestion extends ListenerWrapper<SuggestionHandler> implements
- SelectionHandler<SuggestOracle.Suggestion> {
+ public static class Suggestion extends ListenerWrapper<SuggestionHandler>
+ implements SelectionHandler<SuggestOracle.Suggestion> {
@Deprecated
public static void add(SuggestBox source, SuggestionHandler listener) {
source.addSelectionHandler(new Suggestion(listener));
@@ -487,8 +480,8 @@
}
}
- static class Keyboard extends ListenerWrapper<KeyboardListener> implements KeyDownHandler,
- KeyUpHandler, KeyPressHandler {
+ static class Keyboard extends ListenerWrapper<KeyboardListener> implements
+ KeyDownHandler, KeyUpHandler, KeyPressHandler {
public static <EventSourceType extends Widget & HasAllKeyHandlers> void add(
EventSourceType source, KeyboardListener listener) {
@@ -505,19 +498,24 @@
}
public void onKeyDown(KeyDownEvent event) {
- listener.onKeyDown(source(event), (char) event.getNativeKeyCode(),
+ listener.onKeyDown(
+ source(event),
+ (char) event.getNativeKeyCode(),
KeyboardListenerCollection.getKeyboardModifiers(event.getNativeEvent()));
}
public void onKeyPress(KeyPressEvent event) {
- listener.onKeyPress(source(event),
- (char) event.getNativeEvent().getKeyCode(),
+ listener.onKeyPress(
+ source(event),
+ (char) event.getNativeEvent().getKeyCode(),
KeyboardListenerCollection.getKeyboardModifiers(event.getNativeEvent()));
}
public void onKeyUp(KeyUpEvent event) {
source(event);
- listener.onKeyUp(source(event), (char) event.getNativeKeyCode(),
+ listener.onKeyUp(
+ source(event),
+ (char) event.getNativeKeyCode(),
KeyboardListenerCollection.getKeyboardModifiers(event.getNativeEvent()));
}
}
@@ -536,7 +534,8 @@
// We are removing things as we traverse, have to go backward
for (int i = handlerCount - 1; i >= 0; i--) {
H handler = manager.getHandler(key, i);
- if (handler instanceof ListenerWrapper && ((ListenerWrapper) handler).listener.equals(listener)) {
+ if (handler instanceof ListenerWrapper
+ && ((ListenerWrapper) handler).listener.equals(listener)) {
manager.removeHandler(key, handler);
}
}
diff --git a/user/src/com/google/gwt/user/client/ui/NamedFrame.java b/user/src/com/google/gwt/user/client/ui/NamedFrame.java
index 9efe1f7..402158a 100644
--- a/user/src/com/google/gwt/user/client/ui/NamedFrame.java
+++ b/user/src/com/google/gwt/user/client/ui/NamedFrame.java
@@ -17,6 +17,7 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.IFrameElement;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
@@ -43,6 +44,30 @@
}
}
+ /**
+ * Creates an HTML IFRAME element with a src and name.
+ *
+ * @param src the src of the frame
+ * @param name the name of the frame, which must contain at least one
+ * non-whitespace character and must not contain reserved HTML markup
+ * characters such as '<code><</code>', '<code>></code>',
+ * or '<code>&</code>'
+ * @return the newly-created element
+ * @throws IllegalArgumentException if the supplied name is not allowed
+ */
+ private static IFrameElement createIFrame(String src, String name) {
+ if (name == null || !isValidName(name.trim())) {
+ throw new IllegalArgumentException(
+ "expecting one or more non-whitespace chars with no '<', '>', or '&'");
+ }
+
+ // Use innerHTML to implicitly create the <iframe>. This is necessary
+ // because most browsers will not respect a dynamically-set iframe name.
+ Element div = DOM.createDiv();
+ div.setInnerHTML("<iframe src=\"" + src + "\" name='" + name + "'>");
+ return div.getFirstChild().cast();
+ }
+
private static native void initStatics() /*-{
@com.google.gwt.user.client.ui.NamedFrame::PATTERN_NAME = /^[^<>&\'\"]+$/;
}-*/;
@@ -67,18 +92,9 @@
* @throws IllegalArgumentException if the supplied name is not allowed
*/
public NamedFrame(String name) {
- if (name == null || !isValidName(name.trim())) {
- throw new IllegalArgumentException(
- "expecting one or more non-whitespace chars with no '<', '>', or '&'");
- }
-
- // Use innerHTML to implicitly create the <iframe>. This is necessary
- // because most browsers will not respect a dynamically-set iframe name.
- Element div = DOM.createDiv();
- DOM.setInnerHTML(div, "<iframe name='" + name + "'>");
-
- Element iframe = DOM.getFirstChild(div);
- replaceElement(iframe);
+ // Setting a src prevents mixed-content warnings.
+ // http://weblogs.asp.net/bleroy/archive/2005/08/09/how-to-put-a-div-over-a-select-in-ie.aspx
+ super(createIFrame("javascript:''", name));
setStyleName(DEFAULT_STYLENAME);
}
diff --git a/user/src/com/google/gwt/user/client/ui/PopupPanel.java b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
index 417134d..8cfeeba 100644
--- a/user/src/com/google/gwt/user/client/ui/PopupPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
@@ -60,6 +60,7 @@
* <li>.gwt-PopupPanel .popupContent { the wrapper around the content }</li>
* </ul>
*/
+@SuppressWarnings("deprecation")
public class PopupPanel extends SimplePanel implements SourcesPopupEvents,
EventPreview, HasAnimation, HasCloseHandlers<PopupPanel> {
@@ -272,6 +273,8 @@
private String desiredWidth;
private boolean isAnimationEnabled = false;
+
+ private Element autoHidePartner;
/**
* The {@link ResizeAnimation} used to open and close the {@link PopupPanel}s.
@@ -353,10 +356,16 @@
setPopupPosition(Window.getScrollLeft() + left, Window.getScrollTop() + top);
if (!initiallyShowing) {
- hide();
- setVisible(true);
setAnimationEnabled(initiallyAnimated);
- show();
+ // Run the animation. The popup is already visible, so we can skip the
+ // call to setState.
+ if (initiallyAnimated) {
+ impl.setClip(getElement(), "rect(0px, 0px, 0px, 0px)");
+ setVisible(true);
+ resizeAnimation.run(ANIMATION_DURATION);
+ } else {
+ setVisible(true);
+ }
}
}
@@ -454,6 +463,7 @@
return modal;
}
+ @SuppressWarnings("deprecation")
public boolean onEventPreview(Event event) {
Element target = DOM.eventGetTarget(event);
@@ -485,7 +495,7 @@
return true;
}
- if (!eventTargetsPopup && autoHide) {
+ if (!eventTargetsPopup && shouldAutoHide(event)) {
hide(true);
return true;
}
@@ -503,7 +513,8 @@
// If it's an outside click and auto-hide is enabled:
// hide the popup and _don't_ eat the event. ONMOUSEDOWN is used to
// prevent problems with showing a popup in response to a mousedown.
- if (!eventTargetsPopup && autoHide && (type == Event.ONMOUSEDOWN)) {
+ if (!eventTargetsPopup && shouldAutoHide(event)
+ && (type == Event.ONMOUSEDOWN)) {
hide(true);
return true;
}
@@ -581,6 +592,15 @@
}
/**
+ * If the auto hide partner is non null, its mouse events will
+ * not hide a panel set to autohide.
+ * @param element new auto hide partner
+ */
+ public void setAutoHidePartner(Element element) {
+ this.autoHidePartner = element;
+ }
+
+ /**
* Sets the height of the panel's child widget. If the panel's child widget
* has not been set, the height passed in will be cached and used to set the
* height immediately after the child widget is set.
@@ -613,7 +633,7 @@
public void setModal(boolean modal) {
this.modal = modal;
}
-
+
/**
* Sets the popup's position relative to the browser's client area. The
* popup's position may be set before calling {@link #show()}.
@@ -728,6 +748,25 @@
resizeAnimation.setState(true);
}
+ /**
+ * Normally, the popup is positioned directly below the relative target, with
+ * its left edge aligned with the left edge of the target. Depending on the
+ * width and height of the popup and the distance from the target to the
+ * bottom and right edges of the window, the popup may be displayed directly
+ * above the target, and/or its right edge may be aligned with the right edge
+ * of the target.
+ *
+ * @param target the target to show the popup below
+ */
+ public final void showRelativeTo(final UIObject target) {
+ // Set the position of the popup right before it is shown.
+ setPopupPositionAndShow(new PositionCallback() {
+ public void setPosition(int offsetWidth, int offsetHeight) {
+ position(target, offsetWidth, offsetHeight);
+ }
+ });
+ }
+
@Override
protected Element getContainerElement() {
return impl.getContainerElement(DOM.getFirstChild(super.getContainerElement()));
@@ -801,4 +840,144 @@
elt.blur();
}
}-*/;
+
+ private boolean eventInPartner(Event event) {
+ return autoHidePartner != null
+ && autoHidePartner.isOrHasChild(event.getTarget());
+ }
+
+ /**
+ * Positions the popup, called after the offset width and height of the popup are known.
+ *
+ * @param relativeObject the ui object to position relative to
+ * @param offsetWidth the drop down's offset width
+ * @param offsetHeight the drop down's offset height
+ */
+ private void position(final UIObject relativeObject, int offsetWidth,
+ int offsetHeight) {
+ // Calculate left position for the popup. The computation for
+ // the left position is bidi-sensitive.
+
+ int textBoxOffsetWidth = relativeObject.getOffsetWidth();
+
+ // Compute the difference between the popup's width and the
+ // textbox's width
+ int offsetWidthDiff = offsetWidth - textBoxOffsetWidth;
+
+ int left;
+
+ if (LocaleInfo.getCurrentLocale().isRTL()) { // RTL case
+
+ int textBoxAbsoluteLeft = relativeObject.getAbsoluteLeft();
+
+ // Right-align the popup. Note that this computation is
+ // valid in the case where offsetWidthDiff is negative.
+ left = textBoxAbsoluteLeft - offsetWidthDiff;
+
+ // If the suggestion popup is not as wide as the text box, always
+ // align to the right edge of the text box. Otherwise, figure out whether
+ // to right-align or left-align the popup.
+ if (offsetWidthDiff > 0) {
+
+ // Make sure scrolling is taken into account, since
+ // box.getAbsoluteLeft() takes scrolling into account.
+ int windowRight = Window.getClientWidth() + Window.getScrollLeft();
+ int windowLeft = Window.getScrollLeft();
+
+ // Compute the left value for the right edge of the textbox
+ int textBoxLeftValForRightEdge = textBoxAbsoluteLeft
+ + textBoxOffsetWidth;
+
+ // Distance from the right edge of the text box to the right edge
+ // of the window
+ int distanceToWindowRight = windowRight - textBoxLeftValForRightEdge;
+
+ // Distance from the right edge of the text box to the left edge of the
+ // window
+ int distanceFromWindowLeft = textBoxLeftValForRightEdge - windowLeft;
+
+ // If there is not enough space for the overflow of the popup's
+ // width to the right of the text box and there IS enough space for the
+ // overflow to the right of the text box, then left-align the popup.
+ // However, if there is not enough space on either side, stick with
+ // right-alignment.
+ if (distanceFromWindowLeft < offsetWidth
+ && distanceToWindowRight >= offsetWidthDiff) {
+ // Align with the left edge of the text box.
+ left = textBoxAbsoluteLeft;
+ }
+ }
+ } else { // LTR case
+
+ // Left-align the popup.
+ left = relativeObject.getAbsoluteLeft();
+
+ // If the suggestion popup is not as wide as the text box, always align to
+ // the left edge of the text box. Otherwise, figure out whether to
+ // left-align or right-align the popup.
+ if (offsetWidthDiff > 0) {
+ // Make sure scrolling is taken into account, since
+ // box.getAbsoluteLeft() takes scrolling into account.
+ int windowRight = Window.getClientWidth() + Window.getScrollLeft();
+ int windowLeft = Window.getScrollLeft();
+
+ // Distance from the left edge of the text box to the right edge
+ // of the window
+ int distanceToWindowRight = windowRight - left;
+
+ // Distance from the left edge of the text box to the left edge of the
+ // window
+ int distanceFromWindowLeft = left - windowLeft;
+
+ // If there is not enough space for the overflow of the popup's
+ // width to the right of hte text box, and there IS enough space for the
+ // overflow to the left of the text box, then right-align the popup.
+ // However, if there is not enough space on either side, then stick with
+ // left-alignment.
+ if (distanceToWindowRight < offsetWidth
+ && distanceFromWindowLeft >= offsetWidthDiff) {
+ // Align with the right edge of the text box.
+ left -= offsetWidthDiff;
+ }
+ }
+ }
+
+ // Calculate top position for the popup
+
+ int top = relativeObject.getAbsoluteTop();
+
+ // Make sure scrolling is taken into account, since
+ // box.getAbsoluteTop() takes scrolling into account.
+ int windowTop = Window.getScrollTop();
+ int windowBottom = Window.getScrollTop() + Window.getClientHeight();
+
+ // Distance from the top edge of the window to the top edge of the
+ // text box
+ int distanceFromWindowTop = top - windowTop;
+
+ // Distance from the bottom edge of the window to the bottom edge of
+ // the text box
+ int distanceToWindowBottom = windowBottom
+ - (top + relativeObject.getOffsetHeight());
+
+ // If there is not enough space for the popup's height below the text
+ // box and there IS enough space for the popup's height above the text
+ // box, then then position the popup above the text box. However, if there
+ // is not enough space on either side, then stick with displaying the
+ // popup below the text box.
+ if (distanceToWindowBottom < offsetHeight
+ && distanceFromWindowTop >= offsetHeight) {
+ top -= offsetHeight;
+ } else {
+ // Position above the text box
+ top += relativeObject.getOffsetHeight();
+ }
+ setPopupPosition(left, top);
+ }
+
+ private boolean shouldAutoHide(Event event) {
+ boolean shouldAutoHide = autoHide && !eventInPartner(event);
+ return shouldAutoHide;
+ }
+
}
diff --git a/user/src/com/google/gwt/user/client/ui/RichTextArea.java b/user/src/com/google/gwt/user/client/ui/RichTextArea.java
index 86faa94..1b9860f 100644
--- a/user/src/com/google/gwt/user/client/ui/RichTextArea.java
+++ b/user/src/com/google/gwt/user/client/ui/RichTextArea.java
@@ -38,6 +38,7 @@
* <li>.gwt-RichTextArea { }</li>
* </ul>
*/
+@SuppressWarnings("deprecation")
public class RichTextArea extends FocusWidget implements HasHTML,
SourcesMouseEvents, HasAllMouseHandlers {
diff --git a/user/src/com/google/gwt/user/client/ui/ScrollPanel.java b/user/src/com/google/gwt/user/client/ui/ScrollPanel.java
index 2145f78..7669844 100644
--- a/user/src/com/google/gwt/user/client/ui/ScrollPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/ScrollPanel.java
@@ -25,6 +25,7 @@
/**
* A simple panel that wraps its contents in a scrollable area.
*/
+@SuppressWarnings("deprecation")
public class ScrollPanel extends SimplePanel implements SourcesScrollEvents,
HasScrollHandlers {
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesChangeEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesChangeEvents.java
index 57b71bc..27f6c16 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesChangeEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesChangeEvents.java
@@ -18,8 +18,11 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.ChangeListener} interface.
+ *
+ * @deprecated Use {@link com.google.gwt.event.dom.client.HasChangeHandlers}
+ * instead
*/
-
+@Deprecated
public interface SourcesChangeEvents {
/**
@@ -34,7 +37,7 @@
/**
* Removes a previously added listener interface.
*
- * @param listener the listener interface to remove
+ * @param listener the listener interface to remove
*/
@Deprecated
void removeChangeListener(ChangeListener listener);
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesClickEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesClickEvents.java
index 3ee84cf..36d2c36 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesClickEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesClickEvents.java
@@ -18,7 +18,11 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.ClickListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasClickHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesClickEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesFocusEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesFocusEvents.java
index 44ea83d..6f56adb 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesFocusEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesFocusEvents.java
@@ -19,7 +19,10 @@
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.FocusListener} interface.
*
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasAllFocusHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesFocusEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesKeyboardEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesKeyboardEvents.java
index 8e7d4f3..37f0ff2 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesKeyboardEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesKeyboardEvents.java
@@ -18,14 +18,21 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.KeyboardListener} interface.
+ *
+ * @deprecated use
+ * {@link com.google.gwt.com.google.gwt.event.dom.client.HasAllKeyHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesKeyboardEvents {
/**
* Adds a listener interface to receive keyboard events.
*
* @param listener the listener interface to add
- * @deprecated use <code>addKeyPressHandler/addKeyDownKeyDownHandler/addKeyUpHandler</code> instead
+ * @deprecated use
+ * <code>addKeyPressHandler/addKeyDownKeyDownHandler/addKeyUpHandler</code>
+ * instead
*/
@Deprecated
void addKeyboardListener(KeyboardListener listener);
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesLoadEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesLoadEvents.java
index a8c9484..1536e55 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesLoadEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesLoadEvents.java
@@ -18,7 +18,11 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.LoadListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasErrorHandlers} and
+ * {@link com.google.gwt.event.dom.client.HasLoadHandlers} instead
*/
+@Deprecated
public interface SourcesLoadEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesMouseEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesMouseEvents.java
index 3c0539f..ce3c60a 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesMouseEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesMouseEvents.java
@@ -18,14 +18,19 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.MouseListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasAllMouseHandlerss}
+ * instead
*/
+@Deprecated
public interface SourcesMouseEvents {
/**
* Adds a listener interface to receive mouse events.
*
* @param listener the listener interface to add
- * @deprecated use <code>addMouse(Down/Up/Over/Out/Move/Scroll)Handler</code> instead
+ * @deprecated use <code>addMouse(Down/Up/Over/Out/Move/Scroll)Handler</code>
+ * instead
*/
@Deprecated
void addMouseListener(MouseListener listener);
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesMouseWheelEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesMouseWheelEvents.java
index b8ff921..c003da6 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesMouseWheelEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesMouseWheelEvents.java
@@ -1,12 +1,12 @@
/*
* Copyright 2007 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -18,12 +18,15 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.MouseWheelListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasMouseDownHandlers}
+ * instead
*/
public interface SourcesMouseWheelEvents {
/**
* Adds a listener interface to receive mouse events.
- *
+ *
* @param listener the listener interface to add
* @deprecated use <code>addMouseWheelHandler</code>
*/
@@ -32,7 +35,7 @@
/**
* Removes a previously added listener interface.
- *
+ *
* @param listener the listener interface to remove
*/
@Deprecated
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesPopupEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesPopupEvents.java
index 8276160..6b3ec61 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesPopupEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesPopupEvents.java
@@ -18,7 +18,11 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.PopupListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.logical.shared.HasCloseHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesPopupEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesScrollEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesScrollEvents.java
index 178aeff..fd785e2 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesScrollEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesScrollEvents.java
@@ -18,7 +18,11 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.ScrollListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasScrollHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesScrollEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesTabEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesTabEvents.java
index 1f3cf19..709d98e 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesTabEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesTabEvents.java
@@ -15,10 +15,17 @@
*/
package com.google.gwt.user.client.ui;
+
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.TabListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.logical.shared.SelectionHandler}
+ * and
+ * {@link com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesTabEvents {
/**
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesTableEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesTableEvents.java
index 03e05a1..6ffd7d0 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesTableEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesTableEvents.java
@@ -18,7 +18,12 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.TableListener} interface.
+ *
+ * @deprecated use {@link com.google.gwt.event.dom.client.HasClickHandlers}
+ * instead. Event sources should implement methods similar to
+ * {@link HTMLTable#getCellForEvent(com.google.gwt.event.dom.client.ClickEvent)}
*/
+@Deprecated
public interface SourcesTableEvents {
/**
@@ -37,4 +42,4 @@
*/
@Deprecated
void removeTableListener(TableListener listener);
-}
\ No newline at end of file
+}
diff --git a/user/src/com/google/gwt/user/client/ui/SourcesTreeEvents.java b/user/src/com/google/gwt/user/client/ui/SourcesTreeEvents.java
index 519e148..4f7e8fe 100644
--- a/user/src/com/google/gwt/user/client/ui/SourcesTreeEvents.java
+++ b/user/src/com/google/gwt/user/client/ui/SourcesTreeEvents.java
@@ -18,14 +18,22 @@
/**
* A widget that implements this interface sources the events defined by the
* {@link com.google.gwt.user.client.ui.TreeListener} interface.
+ *
+ * @deprecated use
+ * {@link com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers}
+ * , {@link com.google.gwt.event.logical.shared.HasOpenHandlers},
+ * {@link com.google.gwt.event.logical.shared.HasClickHandlers}
+ * instead
*/
+@Deprecated
public interface SourcesTreeEvents {
/**
* Adds a listener interface to receive tree events.
*
* @param listener the listener interface to add
- * @deprecated use addSelectionHandler,addOpenHandler, and addCloseHandler instead
+ * @deprecated use addSelectionHandler,addOpenHandler, and addCloseHandler
+ * instead
*/
@Deprecated
void addTreeListener(TreeListener listener);
diff --git a/user/src/com/google/gwt/user/client/ui/SuggestBox.java b/user/src/com/google/gwt/user/client/ui/SuggestBox.java
index f9ec7da..8fd59b2 100644
--- a/user/src/com/google/gwt/user/client/ui/SuggestBox.java
+++ b/user/src/com/google/gwt/user/client/ui/SuggestBox.java
@@ -121,6 +121,7 @@
* @see MultiWordSuggestOracle
* @see TextBoxBase
*/
+@SuppressWarnings("deprecation")
public class SuggestBox extends Composite implements HasText, HasFocus,
HasAnimation, SourcesClickEvents, SourcesFocusEvents, SourcesChangeEvents,
SourcesKeyboardEvents, FiresSuggestionEvents, HasAllKeyHandlers,
diff --git a/user/src/com/google/gwt/user/client/ui/TabBar.java b/user/src/com/google/gwt/user/client/ui/TabBar.java
index 482658b..55baec4 100644
--- a/user/src/com/google/gwt/user/client/ui/TabBar.java
+++ b/user/src/com/google/gwt/user/client/ui/TabBar.java
@@ -69,7 +69,13 @@
* Note that this set might expand over time, so implement this interface at
* your own risk.
*/
- public interface Tab extends HasAllKeyHandlers, HasClickHandlers {
+ public interface Tab extends HasAllKeyHandlers, HasClickHandlers, HasWordWrap {
+ /**
+ * Check if the underlying widget implements {@link HasWordWrap}.
+ *
+ * @return true if the widget implements {@link HasWordWrap}
+ */
+ boolean hasWordWrap();
}
/**
@@ -117,6 +123,18 @@
return focusablePanel;
}
+ public boolean getWordWrap() {
+ if (hasWordWrap()) {
+ return ((HasWordWrap) focusablePanel.getWidget()).getWordWrap();
+ }
+ throw new UnsupportedOperationException(
+ "Widget does not implement HasWordWrap");
+ }
+
+ public boolean hasWordWrap() {
+ return focusablePanel.getWidget() instanceof HasWordWrap;
+ }
+
public boolean isEnabled() {
return enabled;
}
@@ -148,6 +166,15 @@
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
+
+ public void setWordWrap(boolean wrap) {
+ if (hasWordWrap()) {
+ ((HasWordWrap) focusablePanel.getWidget()).setWordWrap(wrap);
+ } else {
+ throw new UnsupportedOperationException(
+ "Widget does not implement HasWordWrap");
+ }
+ }
}
private static final String STYLENAME_DEFAULT = "gwt-TabBarItem";
@@ -347,12 +374,14 @@
* you need to access to the individual tabs, add a click handler to each
* {@link Tab} element instead.
*/
+ @Deprecated
public void onClick(Widget sender) {
}
/**
* @deprecated add a key down handler to the individual tab wrappers instead.
*/
+ @Deprecated
public void onKeyDown(Widget sender, char keyCode, int modifiers) {
}
@@ -361,6 +390,7 @@
* if what you wanted to do was to listen to key press events on tabs, add the
* key press handler to the individual tab wrappers instead.
*/
+ @Deprecated
public void onKeyPress(Widget sender, char keyCode, int modifiers) {
}
@@ -370,6 +400,7 @@
* key up handler to the individual tab wrappers instead.
*
*/
+ @Deprecated
public void onKeyUp(Widget sender, char keyCode, int modifiers) {
}
@@ -455,7 +486,7 @@
ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1);
SimplePanel focusablePanel = delPanel.getFocusablePanel();
- focusablePanel.setWidget(new HTML(html));
+ focusablePanel.setWidget(new HTML(html, false));
}
/**
@@ -473,7 +504,7 @@
// It is not safe to check if the current widget is an instanceof Label and
// reuse it here because HTML is an instanceof Label. Leaving an HTML would
// throw off the results of getTabHTML(int).
- focusablePanel.setWidget(new Label(text));
+ focusablePanel.setWidget(new Label(text, false));
}
/**
diff --git a/user/src/com/google/gwt/user/client/ui/TextBoxBase.java b/user/src/com/google/gwt/user/client/ui/TextBoxBase.java
index 3f7660a..62a6d9a 100644
--- a/user/src/com/google/gwt/user/client/ui/TextBoxBase.java
+++ b/user/src/com/google/gwt/user/client/ui/TextBoxBase.java
@@ -30,6 +30,7 @@
/**
* Abstract base class for all text entry widgets.
*/
+@SuppressWarnings("deprecation")
public class TextBoxBase extends FocusWidget implements SourcesChangeEvents,
HasChangeHandlers, HasText, HasName, HasValue<String> {
@@ -301,7 +302,6 @@
}
public void setValue(String value, boolean fireEvents) {
- assert null != value : "Value must not be null";
String oldValue = getText();
setText(value);
if (fireEvents) {
diff --git a/user/src/com/google/gwt/user/client/ui/Tree.java b/user/src/com/google/gwt/user/client/ui/Tree.java
index 292bdfb..3f794ba 100644
--- a/user/src/com/google/gwt/user/client/ui/Tree.java
+++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -82,6 +82,7 @@
* {@example com.google.gwt.examples.TreeExample}
* </p>
*/
+@SuppressWarnings("deprecation")
public class Tree extends Widget implements HasWidgets, SourcesTreeEvents,
HasFocus, HasAnimation, HasAllKeyHandlers, HasAllFocusHandlers,
HasSelectionHandlers<TreeItem>, HasOpenHandlers<TreeItem>,
@@ -638,22 +639,6 @@
}
/**
- * Sets the base URL under which this tree will find its default images. These
- * images must be named "tree_white.gif", "tree_open.gif", and
- * "tree_closed.gif".
- *
- * @param baseUrl
- * @deprecated Use {@link #Tree(TreeImages)} as it provides a more efficent
- * and manageable way to supply a set of images to be used within
- * a tree.
- */
- @Deprecated
- public void setImageBase(String baseUrl) {
- images = new ImagesFromImageBase(baseUrl);
- root.updateStateRecursive();
- }
-
- /**
* Selects a specified item.
*
* @param item the item to be selected, or <code>null</code> to deselect all
@@ -822,6 +807,8 @@
void showLeafImage(TreeItem treeItem) {
if (useLeafImages || treeItem.isFullNode()) {
showImage(treeItem, images.treeLeaf());
+ } else if (LocaleInfo.getCurrentLocale().isRTL()) {
+ DOM.setStyleAttribute(treeItem.getElement(), "paddingRight", indentValue);
} else {
DOM.setStyleAttribute(treeItem.getElement(), "paddingLeft", indentValue);
}
diff --git a/user/src/com/google/gwt/user/client/ui/Widget.java b/user/src/com/google/gwt/user/client/ui/Widget.java
index 8a7411e..7d0725e 100644
--- a/user/src/com/google/gwt/user/client/ui/Widget.java
+++ b/user/src/com/google/gwt/user/client/ui/Widget.java
@@ -15,12 +15,13 @@
*/
package com.google.gwt.user.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.logical.shared.HasHandlers;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
@@ -88,8 +89,25 @@
return handlerManager != null && handlerManager.isEventHandled(type);
}
- public void onBrowserEvent(Event nativeEvent) {
- DomEvent.fireNativeEvent(nativeEvent, handlerManager);
+ public void onBrowserEvent(Event event) {
+ switch (DOM.eventGetType(event)) {
+ case Event.ONMOUSEOVER:
+ // Only fire the mouse over event if it's coming from outside this
+ // widget.
+ Element from = event.getFromElement();
+ if (from != null && getElement().isOrHasChild(from)) {
+ return;
+ }
+ break;
+ case Event.ONMOUSEOUT:
+ // Only fire the mouse out event if it's actually leaving this
+ // widget.
+ Element to = event.getToElement();
+ if (to != null && getElement().isOrHasChild(to)) {
+ return;
+ }
+ }
+ DomEvent.fireNativeEvent(event, handlerManager);
}
/**
diff --git a/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImpl.java b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImpl.java
new file mode 100644
index 0000000..884042e
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImpl.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.client.ui.impl;
+
+import com.google.gwt.user.client.Event;
+
+/**
+ * Methods that need browser-specific implementations for Hyperlink.
+ * By default, we're very conservative and let the browser handle any clicks
+ * with non-left buttons or with modifier keys. This happens to be the correct
+ * behavior for Firefox.
+ */
+public class HyperlinkImpl {
+
+ /**
+ * Default version, useful for Firefox. Don't fire if it's a rightclick,
+ * middleclick, or if any modifiers are held down.
+ */
+ public boolean handleAsClick(Event event) {
+ int mouseButtons = event.getButton();
+ boolean alt = event.getAltKey();
+ boolean ctrl = event.getCtrlKey();
+ boolean meta = event.getMetaKey();
+ boolean shift = event.getShiftKey();
+ boolean modifiers = alt || ctrl || meta || shift;
+ boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
+ boolean right = mouseButtons == Event.BUTTON_RIGHT;
+
+ return !modifiers && !middle && !right;
+ }
+}
diff --git a/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplIE.java b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplIE.java
new file mode 100644
index 0000000..42e83a3
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplIE.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.client.ui.impl;
+
+import com.google.gwt.user.client.Event;
+
+/**
+ * IE version of HyperlinkImpl. IE6 and IE7 actually have different
+ * behavior; both have special behavior for shift-click, but IE7 also opens
+ * in a new tab on ctrl-click. IE6 treats ctrl-click as a standard click.
+ */
+public class HyperlinkImplIE extends HyperlinkImpl {
+
+ private static boolean ctrlisModifier = (getInternetExplorerVersion() >= 7);
+
+ /**
+ * Returns the version of Internet Explorer or a -1, (indicating the use of
+ * another browser). Based on code from MSDN.
+ * http://msdn2.microsoft.com/en-us/library/ms537509.aspx
+ */
+ private static native int getInternetExplorerVersion() /*-{
+ var rv = -1; // Assume that we're not IE.
+
+ if (navigator.appName == 'Microsoft Internet Explorer') {
+ var ua = navigator.userAgent;
+ var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
+ if (re.exec(ua) != null)
+ rv = parseFloat( RegExp.$1 );
+ }
+
+ return rv;
+ }-*/;
+
+ @Override
+ public boolean handleAsClick(Event event) {
+ int mouseButtons = event.getButton();
+ boolean ctrl = event.getCtrlKey();
+ boolean shift = event.getShiftKey();
+ boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
+ boolean right = mouseButtons == Event.BUTTON_RIGHT;
+ boolean modifiers;
+
+ if (ctrlisModifier) {
+ modifiers = shift || ctrl;
+ } else {
+ modifiers = shift;
+ }
+
+ return !modifiers && !middle && !right;
+ }
+}
diff --git a/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplOpera.java b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplOpera.java
new file mode 100644
index 0000000..00f46c3
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplOpera.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.client.ui.impl;
+
+import com.google.gwt.user.client.Event;
+
+/**
+ * Opera version of HyperlinkImpl. As of Opera 9, the only modifier key
+ * that changes click behavior on links is shift.
+ */
+public class HyperlinkImplOpera extends HyperlinkImpl {
+ @Override
+ public boolean handleAsClick(Event event) {
+ int mouseButtons = event.getButton();
+ boolean shift = event.getShiftKey();
+ boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
+ boolean right = mouseButtons == Event.BUTTON_RIGHT;
+
+ return !shift && !middle && !right;
+ }
+}
diff --git a/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplSafari.java b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplSafari.java
new file mode 100644
index 0000000..764ece1
--- /dev/null
+++ b/user/src/com/google/gwt/user/client/ui/impl/HyperlinkImplSafari.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.client.ui.impl;
+
+import com.google.gwt.user.client.Event;
+
+/**
+ * HyperlinkImpl for Safari and Google Chrome. Safari has special behavior for
+ * all the modifier keys except shift, which behaves like a regular click.
+ * Chrome, however, opens a new window on a shift-click.
+ */
+public class HyperlinkImplSafari extends HyperlinkImpl {
+
+ private static boolean shiftIsModifier = onChrome();
+
+ private static native boolean onChrome() /*-{
+ return navigator.userAgent.indexOf("Chrome") != -1;
+ }-*/;
+
+ @Override
+ public boolean handleAsClick(Event event) {
+ int mouseButtons = event.getButton();
+ boolean alt = event.getAltKey();
+ boolean ctrl = event.getCtrlKey();
+ boolean meta = event.getMetaKey();
+ boolean shift = event.getShiftKey();
+ boolean middle = mouseButtons == Event.BUTTON_MIDDLE;
+ boolean right = mouseButtons == Event.BUTTON_RIGHT;
+
+ boolean modifiers = alt || ctrl || meta;
+ if (shiftIsModifier) {
+ modifiers |= shift;
+ }
+
+ return !modifiers && !middle && !right;
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/DatePicker.gwt.xml b/user/src/com/google/gwt/user/datepicker/DatePicker.gwt.xml
new file mode 100644
index 0000000..d8acc9d
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/DatePicker.gwt.xml
@@ -0,0 +1,3 @@
+<module>
+</module>
+
diff --git a/user/src/com/google/gwt/user/datepicker/client/CalendarModel.java b/user/src/com/google/gwt/user/datepicker/client/CalendarModel.java
new file mode 100644
index 0000000..d38dd0b
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/CalendarModel.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * Model used to get calendar information for {@link DatePicker} and its
+ * subclasses.
+ */
+@SuppressWarnings(/* Required to use Date API in gwt */{"deprecation"})
+public class CalendarModel {
+
+ /**
+ * The number of weeks normally displayed in a month.
+ */
+ public static final int WEEKS_IN_MONTH = 6;
+
+ /**
+ * Number of days normally displayed in a week.
+ */
+ public static final int DAYS_IN_WEEK = 7;
+
+ private static final String[] dayOfWeekNames = new String[7];
+
+ private static final DateTimeFormat dayOfMonthFormatter = DateTimeFormat.getFormat("d");
+
+ private static final DateTimeFormat dayOfWeekFormatter = DateTimeFormat.getFormat("ccccc");
+
+ private static final DateTimeFormat monthAndYearFormatter = DateTimeFormat.getFormat("MMM yyyy");
+
+ private static String[] dayOfMonthNames = new String[32];
+
+ private final Date currentMonth;
+
+ /**
+ * Constructor.
+ */
+ public CalendarModel() {
+ currentMonth = new Date();
+
+ CalendarUtil.setToFirstDayOfMonth(currentMonth);
+
+ // Finding day of week names
+ Date date = new Date();
+ for (int i = 1; i <= 7; i++) {
+ date.setDate(i);
+ int dayOfWeek = date.getDay();
+ dayOfWeekNames[dayOfWeek] = getDayOfWeekFormatter().format(date);
+ }
+
+ // Finding day of month names
+ date.setMonth(0);
+
+ for (int i = 1; i < 32; ++i) {
+ date.setDate(i);
+ dayOfMonthNames[i] = getDayOfMonthFormatter().format(date);
+ }
+ }
+
+ /**
+ * Formats the current specified month. For example "Sep".
+ *
+ * @return the formatted month
+ */
+ public String formatCurrentMonth() {
+ return getMonthAndYearFormatter().format(currentMonth);
+ }
+
+ /**
+ * Formats a date's day of month. For example "1".
+ *
+ * @param date the date
+ * @return the formated day of month
+ */
+ public String formatDayOfMonth(Date date) {
+ return dayOfMonthNames[date.getDate()];
+ }
+
+ /**
+ * Format a day in the week. So, for example "Monday".
+ *
+ * @param dayInWeek the day in week to format
+ * @return the formatted day in week
+ */
+ public String formatDayOfWeek(int dayInWeek) {
+ return dayOfWeekNames[dayInWeek];
+ }
+
+ /**
+ * Gets the first day of the first week in the currently specified month.
+ *
+ * @return the first day
+ */
+ public Date getCurrentFirstDayOfFirstWeek() {
+ int wkDayOfMonth1st = currentMonth.getDay();
+ int start = CalendarUtil.getStartingDayOfWeek();
+ if (wkDayOfMonth1st == start) {
+ // always return a copy to allow SimpleCalendarView to adjust first
+ // display date
+ return new Date(currentMonth.getTime());
+ } else {
+ Date d = new Date(currentMonth.getTime());
+ int offset = wkDayOfMonth1st - start > 0 ? wkDayOfMonth1st - start
+ : DAYS_IN_WEEK - (start - wkDayOfMonth1st);
+ CalendarUtil.addDaysToDate(d, -offset);
+ return d;
+ }
+ }
+
+ /**
+ * Gets the date representation of the currently specified month. Used to
+ * access both the month and year information.
+ *
+ * @return the month and year
+ */
+ public Date getCurrentMonth() {
+ return currentMonth;
+ }
+
+ /**
+ * Is a date in the currently specified month?
+ *
+ * @param date the date
+ * @return date
+ */
+ public boolean isInCurrentMonth(Date date) {
+ return currentMonth.getMonth() == date.getMonth();
+ }
+
+ /**
+ * Sets the currently specified date.
+ *
+ * @param currentDate the currently specified date
+ */
+ public void setCurrentMonth(Date currentDate) {
+ this.currentMonth.setYear(currentDate.getYear());
+ this.currentMonth.setMonth(currentDate.getMonth());
+ }
+
+ /**
+ * Shifts the currently specified date by the given number of months. The day
+ * of the month will be pinned to the original value as far as possible.
+ *
+ * @param deltaMonths - number of months to be added to the current date
+ */
+ public void shiftCurrentMonth(int deltaMonths) {
+ CalendarUtil.addMonthsToDate(currentMonth, deltaMonths);
+ refresh();
+ }
+
+ /**
+ * Gets the date of month formatter.
+ *
+ * @return the day of month formatter
+ */
+ protected DateTimeFormat getDayOfMonthFormatter() {
+ return dayOfMonthFormatter;
+ }
+
+ /**
+ * Gets the day of week formatter.
+ *
+ * @return the day of week formatter
+ */
+ protected DateTimeFormat getDayOfWeekFormatter() {
+ return dayOfWeekFormatter;
+ }
+
+ /**
+ * Gets the month and year formatter.
+ *
+ * @return the month and year formatter
+ */
+ protected DateTimeFormat getMonthAndYearFormatter() {
+ return monthAndYearFormatter;
+ }
+
+ /**
+ * Refresh the current model as needed.
+ */
+ protected void refresh() {
+ }
+
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/CalendarUtil.java b/user/src/com/google/gwt/user/datepicker/client/CalendarUtil.java
new file mode 100644
index 0000000..0df0427
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/CalendarUtil.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.constants.DateTimeConstants;
+
+import java.util.Date;
+
+/**
+ * Useful utilities for creating views of a calendar.
+ */
+public class CalendarUtil {
+
+ static DateTimeConstants intlConstants;
+
+ private static int firstDayOfWeekend;
+
+ private static int lastDayOfWeekend;
+ private static int startingDay;
+
+ static {
+ if (GWT.isClient()) {
+ intlConstants = (DateTimeConstants) GWT.create(DateTimeConstants.class);
+ // Finding the start and end of weekend
+ firstDayOfWeekend = Integer.parseInt(intlConstants.weekendRange()[0]) - 1;
+ lastDayOfWeekend = Integer.parseInt(intlConstants.weekendRange()[1]) - 1;
+ startingDay = Integer.parseInt(CalendarUtil.intlConstants.firstDayOfTheWeek()) - 1;
+ }
+ }
+
+ /**
+ * Adds the given number of days to a date.
+ *
+ * @param date the date
+ * @param days number of days
+ */
+ public static void addDaysToDate(Date date, int days) {
+ date.setDate(date.getDate() + days);
+ }
+
+ /**
+ * Adds the given number of months to a date.
+ *
+ * @param date the date
+ * @param months number of months
+ */
+ public static void addMonthsToDate(Date date, int months) {
+ if (months != 0) {
+ int month = date.getMonth();
+ int year = date.getYear();
+
+ int resultMonthCount = year * 12 + month + months;
+ int resultYear = resultMonthCount / 12;
+ int resultMonth = resultMonthCount - resultYear * 12;
+
+ date.setMonth(resultMonth);
+ date.setYear(resultYear);
+ }
+ }
+
+ /**
+ * Copies a date.
+ *
+ * @param date the date
+ * @return the copy
+ */
+ public static Date copyDate(Date date) {
+ if (date == null) {
+ return null;
+ }
+ Date newDate = new Date();
+ newDate.setTime(date.getTime());
+ return newDate;
+ }
+
+ /**
+ * Returns the number of days between the two dates. Time is ignored.
+ *
+ * @param start starting date
+ * @param finish ending date
+ * @return the different
+ */
+ public static int getDaysBetween(Date start, Date finish) {
+ if (hasTime(start)) {
+ start = copyDate(start);
+ resetTime(start);
+ }
+
+ if (hasTime(finish)) {
+ finish = copyDate(finish);
+ resetTime(finish);
+ }
+
+ long aTime = start.getTime();
+ long bTime = finish.getTime();
+
+ long adjust = 60 * 60 * 1000;
+ adjust = (bTime > aTime) ? adjust : -adjust;
+
+ return (int) ((bTime - aTime + adjust) / (24 * 60 * 60 * 1000));
+ }
+
+ /**
+ * Returns the day of the week on which week starts in the current locale. The
+ * range between 0 for Sunday and 6 for Saturday.
+ *
+ * @return the day of the week
+ */
+ public static int getStartingDayOfWeek() {
+ return startingDay;
+ }
+
+ /**
+ * Sets a date object to be at the beginning of the month and no time
+ * specified.
+ *
+ * @param date the date
+ */
+ public static void setToFirstDayOfMonth(Date date) {
+ resetTime(date);
+ date.setDate(1);
+ }
+
+ static boolean hasTime(Date start) {
+ return start.getHours() != 0 || start.getMinutes() != 0
+ || start.getSeconds() != 0;
+ }
+
+ /**
+ * Is a day in the week a weekend?
+ *
+ * @param dayOfWeek day of week
+ * @return is the day of week a weekend?
+ */
+ static boolean isWeekend(int dayOfWeek) {
+ return dayOfWeek == firstDayOfWeekend || dayOfWeek == lastDayOfWeekend;
+ }
+
+ /**
+ * Resets the date to have no time modifiers.
+ *
+ * @param date the date
+ */
+ private static void resetTime(Date date) {
+ long msec = date.getTime();
+ msec = (msec / 1000) * 1000;
+ date.setTime(msec);
+
+ date.setHours(0);
+ date.setMinutes(0);
+ date.setSeconds(0);
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/CalendarView.java b/user/src/com/google/gwt/user/datepicker/client/CalendarView.java
new file mode 100644
index 0000000..adaa19a
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/CalendarView.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import java.util.Date;
+
+/**
+ * The CalendarView is a calendar grid that represents the current view of a
+ * {@link DatePicker}. Note, the calendar view only deals with the currently
+ * visible dates and all state is flushed when the calendar view is refreshed.
+ *
+ */
+public abstract class CalendarView extends DatePickerComponent {
+
+ /**
+ * Constructor.
+ */
+ public CalendarView() {
+ }
+
+ /**
+ * Adds a style name to the cell of the supplied date. This style is only set
+ * until the next time the {@link CalendarView} is refreshed.
+ *
+ * @param styleName style name to add
+ * @param date date that will have the supplied style added
+ */
+ public abstract void addStyleToDate(String styleName, Date date);
+
+ /**
+ * Returns the first date that is currently shown by the calendar.
+ *
+ * @return the first date.
+ */
+ public abstract Date getFirstDate();
+
+ /**
+ * Returns the last date that is currently shown by the calendar.
+ *
+ * @return the last date.
+ */
+ public abstract Date getLastDate();
+
+ /**
+ * Is the cell representing the given date enabled?
+ *
+ * @param date the date
+ * @return is the date enabled
+ */
+ public abstract boolean isDateEnabled(Date date);
+
+ /**
+ * Removes a visible style name from the cell of the supplied date.
+ *
+ * @param styleName style name to remove
+ * @param date date that will have the supplied style added
+ */
+ public abstract void removeStyleFromDate(String styleName, Date date);
+
+ /**
+ * Enables or Disables a particular date. by default all valid dates are
+ * enabled after a rendering event. Disabled dates cannot be selected.
+ *
+ * @param enabled true for enabled, false for disabled
+ * @param date date to enable or disable
+ */
+ public abstract void setEnabledOnDate(boolean enabled, Date date);
+
+ /**
+ * Allows the calendar view to update the date picker's highlighted date.
+ *
+ * @param date the highlighted date
+ */
+ protected final void setHighlightedDate(Date date) {
+ getDatePicker().setHighlightedDate(date);
+ }
+}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java b/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java
new file mode 100644
index 0000000..7530165
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.event.dom.client.KeyDownEvent;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.UIObject;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Highlighting, selectable cell grid. Used to help construct the default
+ * calendar view.
+ *
+ * @param <V> type of value in grid.
+ */
+@SuppressWarnings("unchecked")
+abstract class CellGridImpl<V> extends Grid {
+
+ /**
+ * Cell type.
+ */
+ abstract class Cell extends UIObject {
+ private boolean enabled = true;
+ private V value;
+ private int index;
+
+ /**
+ * Create a cell grid.
+ *
+ * @param elem the wrapped element
+ * @param value the value
+ */
+ public Cell(Element elem, V value) {
+ this.value = value;
+ Cell current = this;
+ index = cellList.size();
+ cellList.add(current);
+
+ setElement(elem);
+ elementToCell.put(current);
+ }
+
+ public V getValue() {
+ return value;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public boolean isHighlighted() {
+ return this == highlightedCell;
+ }
+
+ public boolean isSelected() {
+ return selectedCell == this;
+ }
+
+ public final void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ onEnabled(enabled);
+ }
+
+ public void verticalNavigation(int keyCode) {
+ switch (keyCode) {
+ case KeyCodes.KEY_UP:
+ setHighlighted(previousItem());
+ break;
+ case KeyCodes.KEY_DOWN:
+ setHighlighted(nextItem());
+ break;
+ case KeyCodes.KEY_ESCAPE:
+ // Figure out new event for this.
+ break;
+ case KeyCodes.KEY_ENTER:
+ setSelected(this);
+ break;
+ }
+ }
+
+ protected Cell nextItem() {
+ if (index == getLastIndex()) {
+ return cellList.get(0);
+ } else {
+ return cellList.get(index + 1);
+ }
+ }
+
+ protected void onEnabled(boolean enabled) {
+ updateStyle();
+ }
+
+ protected void onHighlighted(boolean highlighted) {
+ updateStyle();
+ }
+
+ protected void onSelected(boolean selected) {
+ updateStyle();
+ }
+
+ protected Cell previousItem() {
+ if (index != 0) {
+ return cellList.get(index - 1);
+ } else {
+ return cellList.get(getLastIndex());
+ }
+ }
+
+ protected abstract void updateStyle();
+
+ private int getLastIndex() {
+ return cellList.size() - 1;
+ }
+ }
+
+ private Cell highlightedCell;
+
+ private Cell selectedCell;
+ private ElementMapper<Cell> elementToCell = new ElementMapper<Cell>();
+ private ArrayList<Cell> cellList = new ArrayList<Cell>();
+
+ protected CellGridImpl() {
+ setCellPadding(0);
+ setCellSpacing(0);
+ setBorderWidth(0);
+ sinkEvents(Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT);
+ }
+
+ public Cell getCell(Element element) {
+ return elementToCell.get((com.google.gwt.user.client.Element) element);
+ }
+
+ public Cell getCell(Event e) {
+ // Find out which cell was actually clicked.
+ Element td = getEventTargetCell(e);
+ return td != null
+ ? elementToCell.get((com.google.gwt.user.client.Element) td) : null;
+ }
+
+ public Cell getCell(int i) {
+ return cellList.get(i);
+ }
+
+ public Iterator getCells() {
+ return cellList.iterator();
+ }
+
+ public Cell getHighlightedCell() {
+ return highlightedCell;
+ }
+
+ public int getNumCells() {
+ return cellList.size();
+ }
+
+ public Cell getSelectedCell() {
+ return selectedCell;
+ }
+
+ public V getSelectedValue() {
+ return getValue(selectedCell);
+ }
+
+ public V getValue(Cell cell) {
+ return (cell == null ? null : cell.getValue());
+ }
+
+ @Override
+ public void onBrowserEvent(Event event) {
+ switch (DOM.eventGetType(event)) {
+ case Event.ONCLICK: {
+ Cell cell = getCell(event);
+ if (isActive(cell)) {
+ setSelected(cell);
+ }
+ break;
+ }
+ case Event.ONMOUSEOUT: {
+ Element e = DOM.eventGetFromElement(event);
+ if (e != null) {
+ Cell cell = elementToCell.get((com.google.gwt.user.client.Element) e);
+ if (cell == highlightedCell) {
+ setHighlighted(null);
+ }
+ }
+ break;
+ }
+ case Event.ONMOUSEOVER: {
+ Element e = DOM.eventGetToElement(event);
+ if (e != null) {
+ Cell cell = elementToCell.get((com.google.gwt.user.client.Element) e);
+ if (isActive(cell)) {
+ setHighlighted(cell);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void onUnload() {
+ setHighlighted(null);
+ }
+
+ public final void setHighlighted(Cell nextHighlighted) {
+ if (nextHighlighted == highlightedCell) {
+ return;
+ }
+ Cell oldHighlighted = highlightedCell;
+ highlightedCell = nextHighlighted;
+ if (oldHighlighted != null) {
+ oldHighlighted.onHighlighted(false);
+ }
+ if (highlightedCell != null) {
+ highlightedCell.onHighlighted(true);
+ }
+ }
+
+ public final void setSelected(Cell cell) {
+ Cell last = getSelectedCell();
+ selectedCell = cell;
+
+ if (last != null) {
+ last.onSelected(false);
+ }
+ if (selectedCell != null) {
+ selectedCell.onSelected(true);
+ }
+ onSelected(last, selectedCell);
+ }
+
+ protected void onKeyDown(Cell lastHighlighted, KeyDownEvent event) {
+ if (event.isAnyModifierKeyDown()) {
+ return;
+ }
+ int keyCode = event.getNativeKeyCode();
+ if (lastHighlighted == null) {
+ if (keyCode == KeyCodes.KEY_DOWN && cellList.size() > 0) {
+ setHighlighted(cellList.get(0));
+ }
+ } else {
+ lastHighlighted.verticalNavigation(keyCode);
+ }
+ }
+
+ protected abstract void onSelected(Cell lastSelected, Cell cell);
+
+ private boolean isActive(Cell cell) {
+ return cell != null && cell.isEnabled();
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DateBox.java b/user/src/com/google/gwt/user/datepicker/client/DateBox.java
new file mode 100644
index 0000000..d9fc83d
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DateBox.java
@@ -0,0 +1,491 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.KeyDownEvent;
+import com.google.gwt.event.dom.client.KeyDownHandler;
+import com.google.gwt.event.logical.shared.CloseEvent;
+import com.google.gwt.event.logical.shared.CloseHandler;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasValue;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.TextBox;
+
+import java.util.Date;
+
+/**
+ * A text box that shows a {@link DatePicker} when the user focuses on it.
+ *
+ * <h3>CSS Style Rules</h3>
+ *
+ * <dl>
+ * <dt>.gwt-DateBox</dt>
+ * <dd>default style name</dd>
+ * <dt>.dateBoxPopup</dt>
+ * <dd>Applied to the popup around the DatePicker</dd>
+ * <dt>.dateBoxFormatError</dt>
+ * <dd>Default style for when the date box has bad input. Applied by
+ * {@link DateBox.DefaultFormat} when the text does not represent a date that
+ * can be parsed</dd>
+ * </dl>
+ *
+ * <p>
+ * <h3>Example</h3>
+ * {@example com.google.gwt.examples.DateBoxExample}
+ * </p>
+ */
+public class DateBox extends Composite implements HasValue<Date> {
+ /**
+ * Default {@link DateBox.Format} class. The date is first parsed using the
+ * {@link DateTimeFormat} supplied by the user, or
+ * {@link DateTimeFormat#getMediumDateFormat()} by default.
+ * <p>
+ * If that fails, we then try to parse again using the default browser date
+ * parsing.
+ * </p>
+ * If that fails, the <code>dateBoxFormatError</code> css style is
+ * applied to the {@link DateBox}. The style will be removed when either a
+ * successful {@link #parse(DateBox,String, boolean)} is called or
+ * {@link #format(DateBox,Date)} is called.
+ * <p>
+ * Use a different {@link DateBox.Format} instance to change that behavior.
+ * </p>
+ */
+ public static class DefaultFormat implements Format {
+
+ private final DateTimeFormat dateTimeFormat;
+
+ /**
+ * Creates a new default format instance.
+ */
+ public DefaultFormat() {
+ dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();
+ }
+
+ /**
+ * Creates a new default format instance.
+ *
+ * @param dateTimeFormat the {@link DateTimeFormat} to use with this
+ * {@link Format}.
+ */
+ public DefaultFormat(DateTimeFormat dateTimeFormat) {
+ this.dateTimeFormat = dateTimeFormat;
+ }
+
+ public String format(DateBox box, Date date) {
+ if (date == null) {
+ return "";
+ } else {
+ return dateTimeFormat.format(date);
+ }
+ }
+
+ /**
+ * Gets the date time format.
+ *
+ * @return the date time format
+ */
+ public DateTimeFormat getDateTimeFormat() {
+ return dateTimeFormat;
+ }
+
+ @SuppressWarnings("deprecation")
+ public Date parse(DateBox dateBox, String dateText, boolean reportError) {
+ Date date = null;
+ try {
+ if (dateText.length() > 0) {
+ date = dateTimeFormat.parse(dateText);
+ }
+ } catch (IllegalArgumentException exception) {
+ try {
+ date = new Date(dateText);
+ } catch (IllegalArgumentException e) {
+ if (reportError) {
+ dateBox.addStyleName(DATE_BOX_FORMAT_ERROR);
+ }
+ return null;
+ }
+ }
+ return date;
+ }
+
+ public void reset(DateBox dateBox, boolean abandon) {
+ dateBox.removeStyleName(DATE_BOX_FORMAT_ERROR);
+ }
+ }
+
+ /**
+ * Implemented by a delegate to handle the parsing and formating of date
+ * values. The default {@link Format} uses a new {@link DefaultFormat}
+ * instance.
+ */
+ public interface Format {
+
+ /**
+ * Formats the provided date. Note, a null date is a possible input.
+ *
+ * @param dateBox the date box you are formatting
+ * @param date the date to format
+ * @return the formatted date as a string
+ */
+ String format(DateBox dateBox, Date date);
+
+ /**
+ * Parses the provided string as a date.
+ *
+ * @param dateBox the date box
+ * @param text the string representing a date
+ * @param reportError should the formatter indicate a parse error to the
+ * user?
+ * @return the date created, or null if there was a parse error
+ */
+ Date parse(DateBox dateBox, String text, boolean reportError);
+
+ /**
+ * If the format did any modifications to the date box's styling, reset them
+ * now.
+ *
+ * @param abandon true when the current format is being replaced by another
+ * @param dateBox the date box
+ */
+ void reset(DateBox dateBox, boolean abandon);
+ }
+
+ private class DateBoxHandler implements ValueChangeHandler<Date>,
+ FocusHandler, BlurHandler, ClickHandler, KeyDownHandler,
+ CloseHandler<PopupPanel> {
+
+ public void onBlur(BlurEvent event) {
+ if (isDatePickerVisible() == false) {
+ updateDateFromTextBox();
+ }
+ }
+
+ public void onClick(ClickEvent event) {
+ showDatePicker();
+ }
+
+ public void onClose(CloseEvent<PopupPanel> event) {
+ // If we are not closing because we have picked a new value, make sure the
+ // current value is updated.
+ if (allowDPShow) {
+ updateDateFromTextBox();
+ }
+ }
+
+ public void onFocus(FocusEvent event) {
+ if (allowDPShow && isDatePickerVisible() == false) {
+ showDatePicker();
+ }
+ }
+
+ public void onKeyDown(KeyDownEvent event) {
+ switch (event.getNativeKeyCode()) {
+ case KeyCodes.KEY_ENTER:
+ case KeyCodes.KEY_TAB:
+ updateDateFromTextBox();
+ // Deliberate fall through
+ case KeyCodes.KEY_ESCAPE:
+ case KeyCodes.KEY_UP:
+ hideDatePicker();
+ break;
+ case KeyCodes.KEY_DOWN:
+ showDatePicker();
+ break;
+ }
+ }
+
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ setValue(event.getValue());
+ hideDatePicker();
+ preventDatePickerPopup();
+ box.setFocus(true);
+ }
+ }
+
+ /**
+ * Default style name added when the date box has a format error.
+ */
+ private static final String DATE_BOX_FORMAT_ERROR = "dateBoxFormatError";
+
+ /**
+ * Default style name.
+ */
+ public static final String DEFAULT_STYLENAME = "gwt-DateBox";
+ private static final DefaultFormat DEFAULT_FORMAT = new DefaultFormat();
+ private final PopupPanel popup;
+ private final TextBox box = new TextBox();
+ private final DatePicker picker;
+ private Format format;
+ private boolean allowDPShow = true;
+
+ /**
+ * Create a date box with a new {@link DatePicker}.
+ */
+ public DateBox() {
+ this(new DatePicker(), null, DEFAULT_FORMAT);
+ }
+
+ /**
+ * Create a new date box.
+ *
+ * @param date the default date.
+ * @param picker the picker to drop down from the date box
+ * @param format to use to parse and format dates
+ */
+ public DateBox(DatePicker picker, Date date, Format format) {
+ this.picker = picker;
+ this.popup = new PopupPanel();
+ assert format != null : "You may not construct a date box with a null format";
+ this.format = format;
+
+ popup.setAutoHideEnabled(true);
+ popup.setAutoHidePartner(box.getElement());
+ popup.setWidget(picker);
+ popup.setStyleName("dateBoxPopup");
+
+ initWidget(box);
+ setStyleName(DEFAULT_STYLENAME);
+
+ DateBoxHandler handler = new DateBoxHandler();
+ picker.addValueChangeHandler(handler);
+ box.addFocusHandler(handler);
+ box.addBlurHandler(handler);
+ box.addClickHandler(handler);
+ box.addKeyDownHandler(handler);
+ popup.addCloseHandler(handler);
+ setValue(date);
+ }
+
+ public HandlerRegistration addValueChangeHandler(
+ ValueChangeHandler<Date> handler) {
+ return addHandler(handler, ValueChangeEvent.getType());
+ }
+
+ /**
+ * Gets the current cursor position in the date box.
+ *
+ * @return the cursor position
+ *
+ */
+ public int getCursorPos() {
+ return box.getCursorPos();
+ }
+
+ /**
+ * Gets the date picker.
+ *
+ * @return the date picker
+ */
+ public DatePicker getDatePicker() {
+ return picker;
+ }
+
+ /**
+ * Gets the format instance used to control formatting and parsing of this
+ * {@link DateBox}.
+ *
+ * @return the format
+ */
+ public Format getFormat() {
+ return this.format;
+ }
+
+ /**
+ * Gets the date box's position in the tab index.
+ *
+ * @return the date box's tab index
+ */
+ public int getTabIndex() {
+ return box.getTabIndex();
+ }
+
+ /**
+ * Get text box.
+ *
+ * @return the text box used to enter the formatted date
+ */
+ public TextBox getTextBox() {
+ return box;
+ }
+
+ /**
+ * Get the date displayed, or null if the text box is empty, or cannot be
+ * interpreted.
+ *
+ * @return the current date value
+ */
+ public Date getValue() {
+ return parseDate(true);
+ }
+
+ /**
+ * Hide the date picker.
+ */
+ public void hideDatePicker() {
+ popup.hide();
+ }
+
+ /**
+ * @return true if date picker is currently visible, false if not
+ */
+ public boolean isDatePickerVisible() {
+ return popup.isVisible();
+ }
+
+ /**
+ * Sets the date box's 'access key'. This key is used (in conjunction with a
+ * browser-specific modifier key) to automatically focus the widget.
+ *
+ * @param key the date box's access key
+ */
+ public void setAccessKey(char key) {
+ box.setAccessKey(key);
+ }
+
+ /**
+ * Sets whether the date box is enabled.
+ *
+ * @param enabled is the box enabled
+ */
+ public void setEnabled(boolean enabled) {
+ box.setEnabled(enabled);
+ }
+
+ /**
+ * Explicitly focus/unfocus this widget. Only one widget can have focus at a
+ * time, and the widget that does will receive all keyboard events.
+ *
+ * @param focused whether this widget should take focus or release it
+ */
+ public void setFocus(boolean focused) {
+ box.setFocus(focused);
+ }
+
+ /**
+ * Sets the format used to control formatting and parsing of dates in this
+ * {@link DateBox}. If this {@link DateBox} is not empty, the contents of date
+ * box will be replaced with current contents in the new format.
+ *
+ * @param format the new date format
+ */
+ public void setFormat(Format format) {
+ assert format != null : "A Date box may not have a null format";
+ if (this.format != format) {
+ Date date = getValue();
+
+ // This call lets the formatter do whatever other clean up is required to
+ // switch formatters.
+ //
+ this.format.reset(this, true);
+
+ // Now update the format and show the current date using the new format.
+ this.format = format;
+ setValue(date);
+ }
+ }
+
+ /**
+ * Sets the date box's position in the tab index. If more than one widget has
+ * the same tab index, each such widget will receive focus in an arbitrary
+ * order. Setting the tab index to <code>-1</code> will cause this widget to
+ * be removed from the tab order.
+ *
+ * @param index the date box's tab index
+ */
+ public void setTabIndex(int index) {
+ box.setTabIndex(index);
+ }
+
+ /**
+ * Set the date.
+ */
+ public void setValue(Date date) {
+ setValue(date, false);
+ }
+
+ public void setValue(Date date, boolean fireEvents) {
+ Date oldDate = parseDate(false);
+ if (date != null) {
+ picker.setCurrentMonth(date);
+ }
+ picker.setValue(date, false);
+ setDate(date);
+
+ if (fireEvents) {
+ DateChangeEvent.fireIfNotEqualDates(this, oldDate, date);
+ }
+ }
+
+ /**
+ * Parses the current date box's value and shows that date.
+ */
+ public void showDatePicker() {
+ Date current = parseDate(false);
+ if (current == null) {
+ current = new Date();
+ }
+ picker.setCurrentMonth(current);
+ popup.showRelativeTo(this);
+ }
+
+ private Date parseDate(boolean reportError) {
+ if (reportError) {
+ getFormat().reset(this, false);
+ }
+ String text = box.getText().trim();
+ return getFormat().parse(this, text, reportError);
+ }
+
+ private void preventDatePickerPopup() {
+ allowDPShow = false;
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ allowDPShow = true;
+ }
+ });
+ }
+
+ /**
+ * Does the actual work of setting the date. Performs no validation, fires no
+ * events.
+ */
+ private void setDate(Date value) {
+ format.reset(this, false);
+ box.setText(getFormat().format(this, value));
+ }
+
+ private void updateDateFromTextBox() {
+ Date parsedDate = parseDate(true);
+ if (parsedDate != null) {
+ setValue(parsedDate);
+ }
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java b/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
new file mode 100644
index 0000000..940637a
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.shared.HasHandlers;
+
+import java.util.Date;
+
+/**
+ * Creates a new value every time a date is accessed.
+ */
+class DateChangeEvent extends ValueChangeEvent<Date> {
+
+ /**
+ * Fires value change event if the old value is not equal to the new value.
+ * Use this call rather than making the decision to short circuit yourself for
+ * safe handling of null.
+ *
+ * @param <I> the old value type
+ * @param <S> The event source
+ * @param source the source of the handlers
+ * @param oldValue the oldValue, may be null
+ * @param newValue the newValue, may be null
+ */
+ public static <S extends HasValueChangeHandlers<Date> & HasHandlers> void fireIfNotEqualDates(
+ S source, Date oldValue, Date newValue) {
+ if (ValueChangeEvent.shouldFire(source, oldValue, newValue)) {
+ source.getHandlers().fireEvent(new DateChangeEvent(newValue));
+ }
+ }
+
+ /**
+ * Creates a new date value change event.
+ *
+ * @param value the value
+ */
+ protected DateChangeEvent(Date value) {
+ super(value);
+ }
+
+ public Date getValue() {
+ return CalendarUtil.copyDate(super.getValue());
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DatePicker.java b/user/src/com/google/gwt/user/datepicker/client/DatePicker.java
new file mode 100644
index 0000000..e5dacfb
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DatePicker.java
@@ -0,0 +1,663 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.event.logical.shared.HasHighlightHandlers;
+import com.google.gwt.event.logical.shared.HasShowRangeHandlers;
+import com.google.gwt.event.logical.shared.HighlightEvent;
+import com.google.gwt.event.logical.shared.HighlightHandler;
+import com.google.gwt.event.logical.shared.ShowRangeEvent;
+import com.google.gwt.event.logical.shared.ShowRangeHandler;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasValue;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Standard GWT date picker.
+ *
+ * <h3>CSS Style Rules</h3>
+ *
+ * <ul class="css">
+ *
+ * <li>.gwt-DatePicker { }</li>
+ *
+ * <li>.datePickerMonthSelector { the month selector widget }</li>
+ *
+ * <li>.datePickerMonth { the month in the month selector widget } <li>
+ *
+ * <li>.datePickerPreviousButton { the previous month button } <li>
+ *
+ * <li>.datePickerNextButton { the next month button } <li>
+ *
+ * <li>.datePickerDays { the portion of the picker that shows the days }</li>
+ *
+ * <li>.datePickerWeekdayLabel { the label over weekdays }</li>
+ *
+ * <li>.datePickerWeekendLabel { the label over weekends }</li>
+ *
+ * <li>.datePickerDay { a single day }</li>
+ *
+ * <li>.datePickerDayIsToday { today's date }</li>
+ *
+ * <li>.datePickerDayIsWeekend { a weekend day }</li>
+ *
+ * <li>.datePickerDayIsFiller { a day in another month }</li>
+ *
+ * <li>.datePickerDayIsValue { the selected day }</li>
+ *
+ * <li>.datePickerDayIsDisabled { a disabled day }</li>
+ *
+ * <li>.datePickerDayIsHighlighted { the currently highlighted day }</li>
+ *
+ * <li>.datePickerDayIsValueAndHighlighted { the highlighted day if it is also
+ * selected }</li>
+ *
+ * </ul>
+ *
+ * <p>
+ * <h3>Example</h3>
+ * {@example com.google.gwt.examples.DatePickerExample}
+ * </p>
+ */
+public class DatePicker extends Composite implements
+ HasHighlightHandlers<Date>, HasShowRangeHandlers<Date>, HasValue<Date> {
+
+ /**
+ * Convenience class to group css style names.
+ */
+ static class StandardCss {
+
+ static StandardCss DEFAULT = new StandardCss("gwt-DatePicker", "datePicker");
+
+ private String baseName;
+ private String widgetName;
+
+ public StandardCss(String widgetName, String baseName) {
+ this.widgetName = widgetName;
+ this.baseName = baseName;
+ }
+
+ public String datePicker() {
+ return getWidgetStyleName();
+ }
+
+ public String day() {
+ return wrap("Day");
+ }
+
+ public String day(String dayModifier) {
+ return day() + "Is" + dayModifier;
+ }
+
+ public String dayIsDisabled() {
+ return day("Disabled");
+ }
+
+ public String dayIsFiller() {
+ return day("Filler");
+ }
+
+ public String dayIsHighlighted() {
+ return day("Highlighted");
+ }
+
+ public String dayIsToday() {
+ return day("Today");
+ }
+
+ public String dayIsValue() {
+ return day("Value");
+ }
+
+ public String dayIsValueAndHighlighted() {
+ return dayIsValue() + "AndHighlighted";
+ }
+
+ public String dayIsWeekend() {
+ return day("Weekend");
+ }
+
+ public String days() {
+ return wrap("Days");
+ }
+
+ public String daysLabel() {
+ return wrap("DaysLabel");
+ }
+
+ public String getBaseStyleName() {
+ return baseName;
+ }
+
+ public String getWidgetStyleName() {
+ return widgetName;
+ }
+
+ public String month() {
+ return wrap("Month");
+ }
+
+ public String monthSelector() {
+ return wrap("MonthSelector");
+ }
+
+ public String nextButton() {
+ return wrap("NextButton");
+ }
+
+ public String previousButton() {
+ return wrap("PreviousButton");
+ }
+
+ public String weekdayLabel() {
+ return wrap("WeekdayLabel");
+ }
+
+ public String weekendLabel() {
+ return wrap("WeekendLabel");
+ }
+
+ /**
+ * Prepends the base name to the given style.
+ *
+ * @param style style name
+ * @return style name
+ */
+ protected String wrap(String style) {
+ return baseName + style;
+ }
+ }
+
+ /**
+ * A date highlighted event that copied on read.
+ */
+ private class DateHighlightEvent extends HighlightEvent<Date> {
+ protected DateHighlightEvent(Date highlighted) {
+ super(highlighted);
+ }
+
+ @Override
+ public Date getHighlighted() {
+ return CalendarUtil.copyDate(super.getHighlighted());
+ }
+ }
+
+ private class DateStyler {
+ private Map<String, String> info = new HashMap<String, String>();
+
+ public String getStyleName(Date d) {
+ return info.get(genKey(d));
+ }
+
+ public void setStyleName(Date d, String styleName, boolean add) {
+ // Code is easier to maintain if surrounded by " ", and on all browsers
+ // this is a no-op.
+ styleName = " " + styleName + " ";
+ String key = genKey(d);
+ String current = info.get(key);
+
+ if (add) {
+ if (current == null) {
+ info.put(key, styleName);
+ } else if (current.indexOf(styleName) == -1) {
+ info.put(key, current + styleName);
+ }
+ } else {
+ if (current != null) {
+ String newValue = current.replaceAll(styleName, "");
+ if (newValue.trim().length() == 0) {
+ info.remove(key);
+ } else {
+ info.put(key, newValue);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ private String genKey(Date d) {
+ return d.getYear() + "/" + d.getMonth() + "/" + d.getDate();
+ }
+ }
+
+ private final DateStyler styler = new DateStyler();
+
+ private final MonthSelector monthSelector;
+ private final CalendarView view;
+ private final CalendarModel model;
+ private Date value;
+ private Date highlighted;
+ private StandardCss css = StandardCss.DEFAULT;
+
+ /**
+ * Create a new date picker.
+ */
+ public DatePicker() {
+ this(new DefaultMonthSelector(), new DefaultCalendarView(),
+ new CalendarModel());
+ }
+
+ /**
+ * Creates a new date picker.
+ *
+ * @param monthSelector the month selector
+ * @param view the view
+ * @param model the model
+ */
+
+ protected DatePicker(MonthSelector monthSelector, CalendarView view,
+ CalendarModel model) {
+
+ this.model = model;
+ this.monthSelector = monthSelector;
+ monthSelector.setDatePicker(this);
+ this.view = view;
+ view.setDatePicker(this);
+
+ view.setup();
+ monthSelector.setup();
+ this.setup();
+
+ setCurrentMonth(new Date());
+ addStyleToDates(css().dayIsToday(), new Date());
+ }
+
+ public HandlerRegistration addHighlightHandler(HighlightHandler<Date> handler) {
+ return addHandler(handler, HighlightEvent.getType());
+ }
+
+ public HandlerRegistration addShowRangeHandler(ShowRangeHandler<Date> handler) {
+ return addHandler(handler, ShowRangeEvent.getType());
+ }
+
+ /**
+ * Adds a show range handler and immediately activate the handler on the
+ * current view.
+ *
+ * @param handler the handler
+ * @return the handler registration
+ */
+ public HandlerRegistration addShowRangeHandlerAndFire(
+ ShowRangeHandler<Date> handler) {
+ ShowRangeEvent<Date> event = new ShowRangeEvent<Date>(
+ getView().getFirstDate(), getView().getLastDate()) {
+ };
+ handler.onShowRange(event);
+ return addShowRangeHandler(handler);
+ }
+
+ /**
+ * Add a style name to the given dates.
+ */
+ public void addStyleToDates(String styleName, Date date) {
+ styler.setStyleName(date, styleName, true);
+ if (isDateVisible(date)) {
+ getView().addStyleToDate(styleName, date);
+ }
+ }
+
+ /**
+ * Add a style name to the given dates.
+ */
+ public void addStyleToDates(String styleName, Date date, Date... moreDates) {
+ addStyleToDates(styleName, date);
+ for (Date d : moreDates) {
+ addStyleToDates(styleName, d);
+ }
+ }
+
+ /**
+ * Add a style name to the given dates.
+ */
+ public void addStyleToDates(String styleName, Iterable<Date> dates) {
+ for (Date d : dates) {
+ addStyleToDates(styleName, d);
+ }
+ }
+
+ /**
+ * Adds the given style name to the specified dates, which must be visible.
+ * This is only set until the next time the DatePicker is refreshed.
+ */
+ public void addTransientStyleToDates(String styleName, Date date) {
+ assert isDateVisible(date) : date + " must be visible";
+ getView().addStyleToDate(styleName, date);
+ }
+
+ /**
+ * Adds the given style name to the specified dates, which must be visible.
+ * This is only set until the next time the DatePicker is refreshed.
+ */
+ public final void addTransientStyleToDates(String styleName, Date date,
+ Date... moreDates) {
+ addTransientStyleToDates(styleName, date);
+ for (Date d : moreDates) {
+ addTransientStyleToDates(styleName, d);
+ }
+ }
+
+ /**
+ * Adds the given style name to the specified dates, which must be visible.
+ * This is only set until the next time the DatePicker is refreshed.
+ */
+ public final void addTransientStyleToDates(String styleName,
+ Iterable<Date> dates) {
+ for (Date d : dates) {
+ addTransientStyleToDates(styleName, d);
+ }
+ }
+
+ public HandlerRegistration addValueChangeHandler(
+ ValueChangeHandler<Date> handler) {
+ return addHandler(handler, ValueChangeEvent.getType());
+ }
+
+ /**
+ * Gets the current month the date picker is showing.
+ *
+ * <p>
+ * A datepicker <b> may </b> show days not in the current month. It
+ * <b>must</b> show all days in the current month.
+ * </p>
+ *
+ * @return the current month
+ *
+ */
+ public Date getCurrentMonth() {
+ return getModel().getCurrentMonth();
+ }
+
+ /**
+ * Returns the first shown date.
+ *
+ * @return the first date.
+ */
+ // Final because the view should always control the value of the first date.
+ public final Date getFirstDate() {
+ return view.getFirstDate();
+ }
+
+ /**
+ * Gets the highlighted date (the one the mouse is hovering over), if any.
+ *
+ * @return the highlighted date
+ */
+ public final Date getHighlightedDate() {
+ return CalendarUtil.copyDate(highlighted);
+ }
+
+ /**
+ * Returns the last shown date.
+ *
+ * @return the last date.
+ */
+ // Final because the view should always control the value of the last date.
+ public final Date getLastDate() {
+ return view.getLastDate();
+ }
+
+ /**
+ * Gets the style associated with a date (does not include styles set via
+ * {@link #addTransientStyleToDates}).
+ *
+ * @param date the date
+ * @return the styles associated with this date
+ */
+ public String getStyleOfDate(Date date) {
+ return styler.getStyleName(date);
+ }
+
+ /**
+ * Returns the selected date, or null if none is selected.
+ *
+ * @return the selected date, or null
+ */
+ public final Date getValue() {
+ return CalendarUtil.copyDate(value);
+ }
+
+ /**
+ * Is the visible date enabled?
+ *
+ * @param date the date, which must be visible
+ * @return is the date enabled?
+ */
+ public boolean isDateEnabled(Date date) {
+ assert isDateVisible(date) : date + " is not visible";
+ return getView().isDateEnabled(date);
+ }
+
+ /**
+ * Is the date currently shown in the date picker?
+ *
+ * @param date
+ * @return is the date currently shown
+ */
+ public boolean isDateVisible(Date date) {
+ CalendarView r = getView();
+ Date first = r.getFirstDate();
+ Date last = r.getLastDate();
+ return (date != null && (first.equals(date) || last.equals(date) || (first.before(date) && last.after(date))));
+ }
+
+ @Override
+ public void onLoad() {
+ ShowRangeEvent.fire(this, getFirstDate(), getLastDate());
+ }
+
+ /**
+ * Removes the styleName from the given dates (even if it is transient).
+ */
+ public void removeStyleFromDates(String styleName, Date date) {
+ styler.setStyleName(date, styleName, false);
+ if (isDateVisible(date)) {
+ getView().removeStyleFromDate(styleName, date);
+ }
+ }
+
+ /**
+ * Removes the styleName from the given dates (even if it is transient).
+ */
+ public void removeStyleFromDates(String styleName, Date date,
+ Date... moreDates) {
+ removeStyleFromDates(styleName, date);
+ for (Date d : moreDates) {
+ removeStyleFromDates(styleName, d);
+ }
+ }
+
+ /**
+ * Removes the styleName from the given dates (even if it is transient).
+ */
+ public void removeStyleFromDates(String styleName, Iterable<Date> dates) {
+ for (Date d : dates) {
+ removeStyleFromDates(styleName, d);
+ }
+ }
+
+ /**
+ * Sets the date picker to show the given month, use {@link #getFirstDate()}
+ * and {@link #getLastDate()} to access the exact date range the date picker
+ * chose to display.
+ * <p>
+ * A datepicker <b> may </b> show days not in the current month. It
+ * <b>must</b> show all days in the current month.
+ * </p>
+ *
+ * @param month the month to show
+ */
+ public void setCurrentMonth(Date month) {
+ getModel().setCurrentMonth(month);
+ refreshAll();
+ }
+
+ /**
+ * Sets the date picker style name.
+ */
+ @Override
+ public void setStyleName(String styleName) {
+ css = new StandardCss(styleName, "datePicker");
+ super.setStyleName(styleName);
+ }
+
+ /**
+ * Sets a visible date to be enabled or disabled. This is only set until the
+ * next time the DatePicker is refreshed.
+ */
+ public final void setTransientEnabledOnDates(boolean enabled, Date date) {
+ assert isDateVisible(date) : date + " must be visible";
+ getView().setEnabledOnDate(enabled, date);
+ }
+
+ /**
+ * Sets a visible date to be enabled or disabled. This is only set until the
+ * next time the DatePicker is refreshed.
+ */
+ public final void setTransientEnabledOnDates(boolean enabled, Date date,
+ Date... moreDates) {
+ setTransientEnabledOnDates(enabled, date);
+ for (Date d : moreDates) {
+ setTransientEnabledOnDates(enabled, d);
+ }
+ }
+
+ /**
+ * Sets a group of visible dates to be enabled or disabled. This is only set
+ * until the next time the DatePicker is refreshed.
+ */
+ public final void setTransientEnabledOnDates(boolean enabled,
+ Iterable<Date> dates) {
+ for (Date d : dates) {
+ setTransientEnabledOnDates(enabled, d);
+ }
+ }
+
+ /**
+ * Sets the {@link DatePicker}'s value.
+ *
+ * @param newValue the new value
+ */
+ public final void setValue(Date newValue) {
+ setValue(newValue, false);
+ }
+
+ /**
+ * Sets the {@link DatePicker}'s value.
+ *
+ * @param newValue the new value for this date picker
+ * @param fireEvents should events be fired.
+ */
+ public final void setValue(Date newValue, boolean fireEvents) {
+ Date oldValue = value;
+
+ if (oldValue != null) {
+ removeStyleFromDates(css().dayIsValue(), oldValue);
+ }
+
+ value = CalendarUtil.copyDate(newValue);
+ if (value != null) {
+ addStyleToDates(css().dayIsValue(), value);
+ }
+ if (fireEvents) {
+ DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue);
+ }
+ }
+
+ /**
+ * Gets the {@link CalendarModel} associated with this date picker.
+ *
+ * @return the model
+ */
+ protected final CalendarModel getModel() {
+ return model;
+ }
+
+ /**
+ * Gets the {@link MonthSelector} associated with this date picker.
+ *
+ * @return the month selector
+ */
+ protected final MonthSelector getMonthSelector() {
+ return monthSelector;
+ }
+
+ /**
+ * Gets the {@link CalendarView} associated with this date picker.
+ *
+ * @return the view
+ */
+ protected final CalendarView getView() {
+ return view;
+ }
+
+ /**
+ * Refreshes all components of this date picker.
+ */
+ protected final void refreshAll() {
+ highlighted = null;
+ getModel().refresh();
+
+ getView().refresh();
+ getMonthSelector().refresh();
+ if (isAttached()) {
+ ShowRangeEvent.fire(this, getFirstDate(), getLastDate());
+ }
+ }
+
+ /**
+ * Sets up the date picker.
+ */
+ protected void setup() {
+ /*
+ * Use a table (VerticalPanel) to get shrink-to-fit behavior. Divs expand to
+ * fill the available width, so we'd need to give it a size.
+ */
+ VerticalPanel panel = new VerticalPanel();
+ initWidget(panel);
+ setStyleName(panel.getElement(), css.datePicker());
+ setStyleName(css().datePicker());
+ panel.add(this.getMonthSelector());
+ panel.add(this.getView());
+ }
+
+ /**
+ * Gets the css associated with this date picker for use by extended month and
+ * cell grids.
+ *
+ * @return the css.
+ */
+ final StandardCss css() {
+ return css;
+ }
+
+ /**
+ * Sets the highlighted date.
+ *
+ * @param highlighted highlighted date
+ */
+ void setHighlightedDate(Date highlighted) {
+ this.highlighted = highlighted;
+ fireEvent(new DateHighlightEvent(highlighted));
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DatePickerComponent.java b/user/src/com/google/gwt/user/datepicker/client/DatePickerComponent.java
new file mode 100644
index 0000000..6250316
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DatePickerComponent.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.user.client.ui.Composite;
+
+/**
+ * Package protected class used to combine functionality for the
+ * {@link MonthSelector} and {@link CalendarView} components.
+ *
+ */
+abstract class DatePickerComponent extends Composite {
+ private DatePicker datePicker;
+
+ public CalendarModel getModel() {
+ return datePicker.getModel();
+ }
+
+ protected void addMonths(int numMonths) {
+ getModel().shiftCurrentMonth(numMonths);
+ getDatePicker().refreshAll();
+ }
+
+ protected DatePicker getDatePicker() {
+ return datePicker;
+ }
+
+ /**
+ * Refresh the component. Usually called because the model's current date has
+ * changed. In general, only should be called by {@link DatePicker}. Use
+ * refreshAll() if you need to refresh all components.
+ */
+ protected abstract void refresh();
+
+ /**
+ * Refreshes the {@link DatePicker}, {@link CalendarView}, and
+ * {@link CalendarModel}.
+ */
+ protected void refreshAll() {
+ getDatePicker().refreshAll();
+ }
+
+ /**
+ * Set up the component.
+ */
+ protected abstract void setup();
+
+ DatePicker.StandardCss css() {
+ return datePicker.css();
+ }
+
+ void setDatePicker(DatePicker me) {
+ this.datePicker = me;
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DefaultCalendarView.java b/user/src/com/google/gwt/user/datepicker/client/DefaultCalendarView.java
new file mode 100644
index 0000000..1f72e65
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DefaultCalendarView.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
+import com.google.gwt.user.datepicker.client.DefaultCalendarView.CellGrid.DateCell;
+
+import java.util.Date;
+
+/**
+ * Simple calendar view. Not extensible as we wish to evolve it freely over
+ * time.
+ */
+
+@SuppressWarnings(/* Date manipulation required */{"deprecation"})
+public final class DefaultCalendarView extends CalendarView {
+
+ /**
+ * Cell grid.
+ */
+ // Javac bug requires that date be fully specified here.
+ class CellGrid extends CellGridImpl<java.util.Date> {
+ /**
+ * A cell representing a date.
+ */
+ class DateCell extends Cell {
+ private String cellStyle;
+ private String dateStyle;
+
+ DateCell(Element td, boolean isWeekend) {
+ super(td, new Date());
+ cellStyle = css().day();
+ if (isWeekend) {
+ cellStyle += " " + css().dayIsWeekend();
+ }
+ }
+
+ @Override
+ public void addStyleName(String styleName) {
+ if (dateStyle.indexOf(" " + styleName + " ") == -1) {
+ dateStyle += styleName + " ";
+ }
+ updateStyle();
+ }
+
+ public boolean isFiller() {
+ return !getModel().isInCurrentMonth(getValue());
+ }
+
+ @Override
+ public void onHighlighted(boolean highlighted) {
+ setHighlightedDate(getValue());
+ updateStyle();
+ }
+
+ @Override
+ public void onSelected(boolean selected) {
+ if (selected) {
+ getDatePicker().setValue(getValue(), true);
+ if (isFiller()) {
+ getDatePicker().setCurrentMonth(getValue());
+ }
+ }
+ updateStyle();
+ }
+
+ @Override
+ public void removeStyleName(String styleName) {
+ dateStyle = dateStyle.replace(" " + styleName + " ", " ");
+ updateStyle();
+ }
+
+ public void update(Date current) {
+ setEnabled(true);
+ getValue().setTime(current.getTime());
+ String value = getModel().formatDayOfMonth(getValue());
+ setText(value);
+ dateStyle = cellStyle;
+ if (isFiller()) {
+ dateStyle += " " + css().dayIsFiller();
+ } else {
+ String extraStyle = getDatePicker().getStyleOfDate(current);
+ if (extraStyle != null) {
+ dateStyle += " " + extraStyle;
+ }
+ }
+ // We want to certify that all date styles have " " before and after
+ // them for ease of adding to and replacing them.
+ dateStyle += " ";
+ updateStyle();
+ }
+
+ @Override
+ public void updateStyle() {
+ String accum = dateStyle;
+
+ if (isHighlighted()) {
+ accum += " " + css().dayIsHighlighted();
+
+ if (isHighlighted() && isSelected()) {
+ accum += " " + css().dayIsValueAndHighlighted();
+ }
+ }
+ if (!isEnabled()) {
+ accum += " " + css().dayIsDisabled();
+ }
+ setStyleName(accum);
+ }
+
+ private void setText(String value) {
+ DOM.setInnerText(getElement(), value);
+ }
+ }
+
+ CellGrid() {
+ resize(CalendarModel.WEEKS_IN_MONTH + 1, CalendarModel.DAYS_IN_WEEK);
+ }
+
+ @Override
+ protected void onSelected(Cell lastSelected, Cell cell) {
+ }
+ }
+
+ private CellGrid grid = new CellGrid();
+
+ private Date firstDisplayed;
+
+ private Date lastDisplayed = new Date();
+
+ /**
+ * Constructor.
+ */
+ public DefaultCalendarView() {
+ }
+
+ @Override
+ public void addStyleToDate(String styleName, Date date) {
+ assert getDatePicker().isDateVisible(date) : "You tried to add style " + styleName + " to "
+ + date + ". The calendar is currently showing " + getFirstDate()
+ + " to " + getLastDate();
+ getCell(date).addStyleName(styleName);
+ }
+
+ @Override
+ public Date getFirstDate() {
+ return firstDisplayed;
+ }
+
+ @Override
+ public Date getLastDate() {
+ return lastDisplayed;
+ }
+
+ @Override
+ public boolean isDateEnabled(Date d) {
+ return getCell(d).isEnabled();
+ }
+
+ @Override
+ public void refresh() {
+ firstDisplayed = getModel().getCurrentFirstDayOfFirstWeek();
+
+ if (firstDisplayed.getDate() == 1) {
+ // show one empty week if date is Monday is the first in month.
+ CalendarUtil.addDaysToDate(firstDisplayed, -7);
+ }
+
+ lastDisplayed.setTime(firstDisplayed.getTime());
+
+ for (int i = 0; i < grid.getNumCells(); i++) {
+ if (i != 0) {
+ CalendarUtil.addDaysToDate(lastDisplayed, 1);
+ }
+ DateCell cell = (DateCell) grid.getCell(i);
+ cell.update(lastDisplayed);
+ }
+ }
+
+ @Override
+ public void removeStyleFromDate(String styleName, Date date) {
+ getCell(date).removeStyleName(styleName);
+ }
+
+ @Override
+ public void setEnabledOnDate(boolean enabled, Date date) {
+ getCell(date).setEnabled(enabled);
+ }
+
+ @Override
+ public void setup() {
+ // Preparation
+ CellFormatter formatter = grid.getCellFormatter();
+ int weekendStartColumn = -1;
+ int weekendEndColumn = -1;
+
+ // Set up the day labels.
+ for (int i = 0; i < CalendarModel.DAYS_IN_WEEK; i++) {
+ int shift = CalendarUtil.getStartingDayOfWeek();
+ int dayIdx = i + shift < CalendarModel.DAYS_IN_WEEK ? i + shift : i
+ + shift - CalendarModel.DAYS_IN_WEEK;
+ grid.setText(0, i, getModel().formatDayOfWeek(dayIdx));
+
+ if (CalendarUtil.isWeekend(dayIdx)) {
+ formatter.setStyleName(0, i, css().weekendLabel());
+ if (weekendStartColumn == -1) {
+ weekendStartColumn = i;
+ } else {
+ weekendEndColumn = i;
+ }
+ } else {
+ formatter.setStyleName(0, i, css().weekdayLabel());
+ }
+ }
+
+ // Set up the calendar grid.
+ for (int row = 1; row <= CalendarModel.WEEKS_IN_MONTH; row++) {
+ for (int column = 0; column < CalendarModel.DAYS_IN_WEEK; column++) {
+ // set up formatter.
+ Element e = formatter.getElement(row, column);
+ grid.new DateCell(e, column == weekendStartColumn
+ || column == weekendEndColumn);
+ }
+ }
+ initWidget(grid);
+ grid.setStyleName(css().days());
+ }
+
+ private DateCell getCell(Date d) {
+ int index = CalendarUtil.getDaysBetween(firstDisplayed, d);
+ assert (index >= 0);
+
+ DateCell cell = (DateCell) grid.getCell(index);
+ if (cell.getValue().getDate() != d.getDate()) {
+ throw new IllegalStateException(d + " cannot be associated with cell "
+ + cell + " as it has date " + cell.getValue());
+ }
+ return cell;
+ }
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/DefaultMonthSelector.java b/user/src/com/google/gwt/user/datepicker/client/DefaultMonthSelector.java
new file mode 100644
index 0000000..611b354
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/DefaultMonthSelector.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
+
+/**
+ * A simple {@link MonthSelector} used for the default date picker. Not
+ * extensible as we wish to evolve it freely over time.
+ */
+
+public final class DefaultMonthSelector extends MonthSelector {
+
+ private PushButton backwards;
+ private PushButton forwards;
+ private Grid grid;
+
+ /**
+ * Constructor.
+ */
+ public DefaultMonthSelector() {
+ }
+
+ @Override
+ protected void refresh() {
+ String formattedMonth = getModel().formatCurrentMonth();
+ grid.setText(0, 1, formattedMonth);
+ }
+
+ @Override
+ protected void setup() {
+ // Set up backwards.
+ backwards = new PushButton();
+ backwards.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ addMonths(-1);
+ }
+ });
+
+ backwards.getUpFace().setHTML("«");
+ backwards.setStyleName(css().previousButton());
+
+ forwards = new PushButton();
+ forwards.getUpFace().setHTML("»");
+ forwards.setStyleName(css().nextButton());
+ forwards.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ addMonths(+1);
+ }
+ });
+
+ // Set up grid.
+ grid = new Grid(1, 3);
+ grid.setWidget(0, 0, backwards);
+ grid.setWidget(0, 2, forwards);
+
+ CellFormatter formatter = grid.getCellFormatter();
+ formatter.setStyleName(0, 1, css().month());
+ formatter.setWidth(0, 0, "1");
+ formatter.setWidth(0, 1, "100%");
+ formatter.setWidth(0, 2, "1");
+ grid.setStyleName(css().monthSelector());
+ initWidget(grid);
+ }
+
+}
diff --git a/user/src/com/google/gwt/user/datepicker/client/ElementMapper.java b/user/src/com/google/gwt/user/datepicker/client/ElementMapper.java
new file mode 100644
index 0000000..a495ee1
--- /dev/null
+++ b/user/src/com/google/gwt/user/datepicker/client/ElementMapper.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.UIObject;
+
+import java.util.ArrayList;
+
+/**
+ * Creates a mapping from elements to their associated ui objects.
+ *
+ * @param <T> the type that the element is mapped to
+ */
+class ElementMapper<T extends UIObject> {
+
+ private static class FreeNode {
+ int index;
+ ElementMapper.FreeNode next;
+
+ public FreeNode(int index, ElementMapper.FreeNode next) {
+ this.index = index;
+ this.next = next;
+ }
+ }
+
+ private static native void clearIndex(Element elem) /*-{
+ elem["__uiObjectID"] = null;
+ }-*/;
+
+ private static native int getIndex(Element elem) /*-{
+ var index = elem["__uiObjectID"];
+ return (index == null) ? -1 : index;
+ }-*/;
+
+ private static native void setIndex(Element elem, int index) /*-{
+ elem["__uiObjectID"] = index;
+ }-*/;
+
+ private ElementMapper.FreeNode freeList = null;
+
+ private final ArrayList<T> uiObjectList = new ArrayList<T>();
+
+ /**
+ * Returns the uiObject associated with the given element.
+ *
+ * @param elem uiObject's element
+ * @return the uiObject
+ */
+ public T get(Element elem) {
+ int index = getIndex(elem);
+ if (index < 0) {
+ return null;
+ }
+ return uiObjectList.get(index);
+ }
+
+ /**
+ * Adds the MappedType.
+ *
+ * @param uiObject uiObject to add
+ */
+ public void put(T uiObject) {
+ int index;
+ if (freeList == null) {
+ index = uiObjectList.size();
+ uiObjectList.add(uiObject);
+ } else {
+ index = freeList.index;
+ uiObjectList.set(index, uiObject);
+ freeList = freeList.next;
+ }
+ setIndex(uiObject.getElement(), index);
+ }
+
+ /**
+ * Remove the uiObject associated with the given element.
+ *
+ * @param elem the uiObject's element
+ */
+ public void removeByElement(Element elem) {
+ int index = getIndex(elem);
+ removeImpl(elem, index);
+ }
+
+ private void removeImpl(Element elem, int index) {
+ clearIndex(elem);
+ uiObjectList.set(index, null);
+ freeList = new FreeNode(index, freeList);
+ }
+}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/event/shared/HasHandlerManager.java b/user/src/com/google/gwt/user/datepicker/client/MonthSelector.java
similarity index 65%
copy from user/src/com/google/gwt/event/shared/HasHandlerManager.java
copy to user/src/com/google/gwt/user/datepicker/client/MonthSelector.java
index 906258b..25e3dc7 100644
--- a/user/src/com/google/gwt/event/shared/HasHandlerManager.java
+++ b/user/src/com/google/gwt/user/datepicker/client/MonthSelector.java
@@ -13,20 +13,10 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-
-package com.google.gwt.event.shared;
+package com.google.gwt.user.datepicker.client;
/**
- *
- * Characteristic interface indicating that the given widget fires events via a
- * {@link HandlerManager}.
- *
+ * Abstract month selector widget.
*/
-public interface HasHandlerManager {
- /**
- * Gets this widget's handler manager.
- *
- * @return the manager
- */
- HandlerManager getHandlerManager();
-}
+public abstract class MonthSelector extends DatePickerComponent {
+}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
index c109008..f9ed0a6 100644
--- a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
+++ b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
@@ -582,7 +582,6 @@
}
.gwt-RadioButton {
- padding: 4px 4px 3px 3px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -1083,3 +1082,94 @@
.gwt-Tree .gwt-TreeItem-selected {
background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-left: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-left: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #eed6d6;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #888;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: white;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #c1c1c1;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid black;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #EEEEEE;
+}
+.datePickerDayIsFiller {
+ color: #888888;
+}
+.datePickerDayIsValue {
+ background: #abf;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #dde;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #ccf;
+}
+.datePickerMonthSelector {
+ background: #c1c1c1;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+}
diff --git a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
index 3e46467..693c41f 100644
--- a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
+++ b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
@@ -582,7 +582,6 @@
}
.gwt-RadioButton {
- padding: 4px 3px 3px 4px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -1079,7 +1078,99 @@
white-space: nowrap;
cursor: hand;
cursor: pointer;
+ zoom: 1;
}
.gwt-Tree .gwt-TreeItem-selected {
background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-right: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-right: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #eed6d6;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #888;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: white;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #c1c1c1;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid black;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #EEEEEE;
+}
+.datePickerDayIsFiller {
+ color: #888888;
+}
+.datePickerDayIsValue {
+ background: #abf;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #dde;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #ccf;
+}
+.datePickerMonthSelector {
+ background: #c1c1c1;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+}
diff --git a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
index 8e38b61..1e341c2 100644
--- a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
+++ b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
@@ -17,7 +17,7 @@
body, table td, select {
font-family: Arial Unicode MS, Arial, sans-serif;
font-size: small;
- color: #bec7cc;
+ color: #bec7cc
}
select {
color: #000;
@@ -551,7 +551,6 @@
}
.gwt-RadioButton {
- padding: 4px 4px 3px 3px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -988,3 +987,101 @@
color: #0cf;
background: #1c1c1c;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-left: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-left: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #a8eeff;
+ color: red;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #00CCFF;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: #4d4d4d;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+ color: #dddddd;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #222222;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid #00CCFF;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #333333;
+}
+.datePickerDayIsFiller {
+ color: #959595;
+}
+.datePickerDayIsValue {
+ background: #1C1C1C;
+ color: #00CCFF;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #00CCFF;
+ color: #1C1C1C;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #1C1C77;
+ color: #00CCFF;
+}
+.datePickerMonthSelector {
+ background: #222222;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+ color: #dddddd;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+ color: #dddddd;
+}
diff --git a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
index 4c27422..f73cbff 100644
--- a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
+++ b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
@@ -551,7 +551,6 @@
}
.gwt-RadioButton {
- padding: 4px 3px 3px 4px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -983,8 +982,107 @@
white-space: nowrap;
cursor: hand;
cursor: pointer;
+ zoom: 1;
}
.gwt-Tree .gwt-TreeItem-selected {
color: #0cf;
background: #1c1c1c;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-right: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-right: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #a8eeff;
+ color: red;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #00CCFF;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: #4d4d4d;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+ color: #dddddd;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #222222;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid #00CCFF;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #333333;
+}
+.datePickerDayIsFiller {
+ color: #959595;
+}
+.datePickerDayIsValue {
+ background: #1C1C1C;
+ color: #00CCFF;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #00CCFF;
+ color: #1C1C1C;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #1C1C77;
+ color: #00CCFF;
+}
+.datePickerMonthSelector {
+ background: #222222;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+ color: #dddddd;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+ color: #dddddd;
+}
diff --git a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
index aecc9f8..7b4b8ae 100644
--- a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
+++ b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
@@ -582,7 +582,6 @@
}
.gwt-RadioButton {
- padding: 4px 4px 3px 3px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -1082,3 +1081,97 @@
.gwt-Tree .gwt-TreeItem-selected {
background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-left: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-left: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #ffcccc;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #A2BBDD;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: white;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #C3D9FF;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid black;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #EEEEEE;
+}
+.datePickerDayIsFiller {
+ color: #888888;
+}
+.datePickerDayIsValue {
+ background: #aaccee;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #F0E68C;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #bbddd9;
+}
+.datePickerMonthSelector {
+ background: #C3D9FF;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+ color: blue;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ color: blue;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+}
+
diff --git a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
index 6cecc14..e3e65af 100644
--- a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
+++ b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
@@ -582,7 +582,6 @@
}
.gwt-RadioButton {
- padding: 4px 3px 3px 4px;
}
.gwt-RadioButton-disabled {
color: #888;
@@ -1078,7 +1077,101 @@
white-space: nowrap;
cursor: hand;
cursor: pointer;
+ zoom: 1;
}
.gwt-Tree .gwt-TreeItem-selected {
background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px;
}
+.gwt-TreeItem .gwt-RadioButton input,
+.gwt-TreeItem .gwt-CheckBox input {
+ margin-right: 0px;
+}
+* html .gwt-TreeItem .gwt-RadioButton input,
+* html .gwt-TreeItem .gwt-CheckBox input {
+ margin-right: -4px;
+}
+
+.gwt-DateBox input {
+ width: 8em;
+}
+.dateBoxFormatError {
+ background: #ffcccc;
+}
+.dateBoxPopup {
+}
+
+.gwt-DatePicker {
+ border: 1px solid #A2BBDD;
+ cursor: default;
+}
+.gwt-DatePicker td,
+.datePickerMonthSelector td:focus {
+ outline: none
+}
+.datePickerDays {
+ width: 100%;
+ background: white;
+}
+.datePickerDay,
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ font-size: 75%;
+ text-align: center;
+ padding: 4px;
+ outline: none;
+}
+.datePickerWeekdayLabel,
+.datePickerWeekendLabel {
+ background: #C3D9FF;
+ padding: 0px 4px 2px;
+ cursor: default;
+}
+.datePickerDay {
+ padding: 4px;
+ cursor: hand;
+ cursor: pointer;
+}
+.datePickerDayIsToday {
+ border: 1px solid black;
+ padding: 3px;
+}
+.datePickerDayIsWeekend {
+ background: #EEEEEE;
+}
+.datePickerDayIsFiller {
+ color: #888888;
+}
+.datePickerDayIsValue {
+ background: #aaccee;
+}
+.datePickerDayIsDisabled {
+ color: #AAAAAA;
+ font-style: italic;
+}
+.datePickerDayIsHighlighted {
+ background: #F0E68C;
+}
+.datePickerDayIsValueAndHighlighted {
+ background: #bbddd9;
+}
+.datePickerMonthSelector {
+ background: #C3D9FF;
+ width: 100%;
+}
+td.datePickerMonth {
+ text-align: center;
+ vertical-align: center;
+ white-space: nowrap;
+ font-size: 70%;
+ font-weight: bold;
+ color: blue;
+}
+.datePickerPreviousButton,
+.datePickerNextButton {
+ font-size: 120%;
+ line-height: 1em;
+ color: blue;
+ cursor: hand;
+ cursor: pointer;
+ padding: 0px 4px;
+}
diff --git a/user/src/com/google/gwt/user/tools/AppHtml.htmlsrc b/user/src/com/google/gwt/user/tools/AppHtml.htmlsrc
index 9f9c72f..2090fe7 100644
--- a/user/src/com/google/gwt/user/tools/AppHtml.htmlsrc
+++ b/user/src/com/google/gwt/user/tools/AppHtml.htmlsrc
@@ -23,7 +23,7 @@
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
- <script type="text/javascript" language="javascript" src="@deployDir/@newModuleName.nocache.js"></script>
+ <script type="text/javascript" language="javascript" src="@newModuleName/@newModuleName.nocache.js"></script>
</head>
<!-- -->
diff --git a/user/src/com/google/gwt/user/tools/ApplicationCreator.java b/user/src/com/google/gwt/user/tools/ApplicationCreator.java
index 9126cd5..8ea80bb 100644
--- a/user/src/com/google/gwt/user/tools/ApplicationCreator.java
+++ b/user/src/com/google/gwt/user/tools/ApplicationCreator.java
@@ -21,7 +21,6 @@
import com.google.gwt.user.tools.util.ArgHandlerIgnore;
import com.google.gwt.user.tools.util.ArgHandlerOverwrite;
import com.google.gwt.user.tools.util.CreatorUtilities;
-import com.google.gwt.util.tools.ArgHandlerDir;
import com.google.gwt.util.tools.ArgHandlerExtra;
import com.google.gwt.util.tools.ArgHandlerOutDir;
import com.google.gwt.util.tools.ArgHandlerString;
@@ -208,7 +207,7 @@
List<String> extraClassPaths, List<String> extraModules)
throws IOException {
createApplication(fullClassName, outDir, eclipse, overwrite, ignore,
- extraClassPaths, extraModules, null, null);
+ extraClassPaths, extraModules, null);
}
/**
@@ -222,13 +221,12 @@
* launch configs.
* @param extraModules A list of GWT modules to add 'inherits' tags for.
* @param newModuleName The new module name
- * @param deployDir The deploy directory
* @throws IOException
*/
static void createApplication(String fullClassName, File outDir,
String eclipse, boolean overwrite, boolean ignore,
List<String> extraClassPaths, List<String> extraModules,
- String newModuleName, File deployDir) throws IOException {
+ String newModuleName) throws IOException {
// Figure out the installation directory
@@ -291,7 +289,6 @@
serverPackageName = "server";
}
File clientDir = Utility.getDirectory(basePackageDir, "client", true);
- File publicDir = Utility.getDirectory(basePackageDir, "public", true);
File serverDir = Utility.getDirectory(basePackageDir, "server", true);
String startupUrl = className + ".html";
@@ -307,8 +304,9 @@
replacements.put("@shellClass", "com.google.gwt.dev.GWTHosted");
replacements.put("@compileClass", "com.google.gwt.dev.GWTCompiler");
replacements.put("@startupUrl", startupUrl);
- replacements.put("@vmargs", isMacOsX
+ replacements.put("@antVmargs", isMacOsX
? "<jvmarg value=\"-XstartOnFirstThread\"/>" : "");
+ replacements.put("@vmargs", isMacOsX ? "-XstartOnFirstThread" : "");
replacements.put("@eclipseExtraLaunchPaths",
CreatorUtilities.createEclipseExtraLaunchPaths(extraClassPaths));
replacements.put("@extraModuleInherits",
@@ -319,7 +317,6 @@
";", extraClassPaths));
replacements.put("@newModuleName", (newModuleName != null) ? newModuleName
: moduleName);
- replacements.put("@deployDir", deployDir.getName());
{
// create the module xml file, skeleton html file, skeleton css file,
@@ -424,21 +421,6 @@
}
}
- /**
- * Try to make the given file executable. Implementation tries to exec chmod,
- * which may fail if the platform doesn't support it. Prints a warning to
- * stderr if the call fails.
- *
- * @param file the file to make executable
- */
- private static void chmodExecutable(File file) {
- try {
- Runtime.getRuntime().exec("chmod u+x " + file.getAbsolutePath());
- } catch (Throwable e) {
- System.err.println(("Warning: cannot exec chmod to set permission on generated file."));
- }
- }
-
private static String createExtraModuleInherits(List<String> modules) {
if (modules == null) {
return "";
@@ -461,7 +443,6 @@
private File outDir;
private boolean overwrite = false;
private String newModuleName = null;
- private File deployDir;
protected ApplicationCreator() {
@@ -536,35 +517,6 @@
newModuleName = str;
return true;
}
-
- });
-
- // handler to create the deployDir
- registerHandler(new ArgHandlerDir() {
-
- @Override
- public String[] getDefaultArgs() {
- return new String[] {"-deployDir", "deployDir"};
- }
-
- @Override
- public String getPurpose() {
- return "Specifies the deploy directory (defaults to deployDir)";
- }
-
- @Override
- public String getTag() {
- return "-deployDir";
- }
-
- @Override
- public void setDir(File dir) {
- if (dir.getName().length() == 0) {
- throw new IllegalArgumentException("deployDir may not be empty");
- }
- deployDir = dir;
- }
-
});
registerHandler(new ArgHandlerAppClass());
@@ -576,7 +528,7 @@
try {
createApplication(fullClassName, outDir, eclipse, overwrite, ignore,
classPathHandler.getExtraClassPathList(),
- moduleHandler.getExtraModuleList(), newModuleName, deployDir);
+ moduleHandler.getExtraModuleList(), newModuleName);
return true;
} catch (IOException e) {
System.err.println(e.getClass().getName() + ": " + e.getMessage());
diff --git a/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc b/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
index 79536b4..51c660a 100644
--- a/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
+++ b/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
@@ -1,4 +1,4 @@
-<module rename-to='@newModuleName' deploy-to='/@deployDir'>
+<module rename-to='@newModuleName'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
@@ -15,5 +15,4 @@
<!-- Specify the app entry point class. -->
<entry-point class='@clientPackage.@className'/>
-
</module>
diff --git a/dev/core/src/com/google/gwt/dev/ProjectCreator.java b/user/src/com/google/gwt/user/tools/ProjectCreator.java
similarity index 65%
rename from dev/core/src/com/google/gwt/dev/ProjectCreator.java
rename to user/src/com/google/gwt/user/tools/ProjectCreator.java
index e46deed..2b5f92e 100644
--- a/dev/core/src/com/google/gwt/dev/ProjectCreator.java
+++ b/user/src/com/google/gwt/user/tools/ProjectCreator.java
@@ -13,18 +13,17 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.dev;
+package com.google.gwt.user.tools;
/**
- * The executable class for ProjectCreator has been moved to
- * <code>com.google.gwt.junit.tools.ProjectCreator</code>. This executable
- * class issues a reminder to users of the new location.
+ * Legacy ProjectCreator that will let users know that they should run
+ * ApplicationCreator instead.
*/
public final class ProjectCreator {
public static void main(String[] args) {
- System.err.println("This application has moved!");
- System.err.println("Please run com.google.gwt.user.tools.ProjectCreator in gwt-user.jar");
+ System.err.println("This application no longer exists!");
+ System.err.println("It has been merged with com.google.gwt.user.tools.ApplicationCreator in gwt-user.jar");
System.exit(1);
}
diff --git a/user/src/com/google/gwt/user/tools/project.ant.xmlsrc b/user/src/com/google/gwt/user/tools/project.ant.xmlsrc
index de75dc9..a9d8e3a 100644
--- a/user/src/com/google/gwt/user/tools/project.ant.xmlsrc
+++ b/user/src/com/google/gwt/user/tools/project.ant.xmlsrc
@@ -5,7 +5,6 @@
if you want to distribute it. This isn't needed for normal operation.
</description>
<property name="outdir" location="war" />
- <property name="extradir" location="extra" />
<!-- set classpath -->
<path id="project.class.path">
@@ -20,9 +19,9 @@
2. For a 1.4 server, split this so that the server side code is compiled
with a target=1.4 build rule -->
<target name="javac" description="Compile project to WEB-INF/classes">
- <mkdir dir="${outdir}/WEB-INF/classes"/>
+ <mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src:test"
- destdir="${outdir}/WEB-INF/classes"
+ destdir="war/WEB-INF/classes"
includes="**"
debug="true"
debuglevel="lines,vars,source"
@@ -35,8 +34,8 @@
</target>
<target name="deploy" depends="gwtc" description="Copy output to the war folder">
- <mkdir dir="${outdir}/WEB-INF/lib" />
- <copy todir="${outdir}/WEB-INF/lib" file="@gwtServletPath" />
+ <mkdir dir="war/WEB-INF/lib" />
+ <copy todir="war/WEB-INF/lib" file="@gwtServletPath" />
</target>
<!-- can add additional arguments like -logLevel INFO or -style PRETTY -->
@@ -45,16 +44,13 @@
classname="@compileClass">
<classpath>
<pathelement location="src"/>
+ <pathelement location="war/WEB-INF/classes"/>
+ <pathelement path="${project.class.path}/"/>
<pathelement location="@gwtDevPath"/>
- <pathelement location="${outdir}/WEB-INF/classes"/>
- <pathelement path="${java.class.path}/"/>
- <pathelement path="@gwtUserPath"/>
</classpath>
- @vmargs
- <arg value="-out"/>
- <arg file="${outdir}"/>
- <arg value="-extra"/>
- <arg file="${extradir}"/>
+ <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
+ <jvmarg value="-Xmx256M"/>
+ @antVmargs
<arg value="@moduleName"/>
</java>
</target>
@@ -63,16 +59,14 @@
<target name="shell" depends="javac" description="Run the deployed app in GWT hosted mode">
<java failonerror="true" fork="true"
classname="@shellClass">
- <jvmarg value="-Xmx256M"/>
<classpath>
<pathelement location="src"/>
<pathelement location="@gwtDevPath"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="@gwtUserPath"/>
</classpath>
- @vmargs
- <arg value="-out"/>
- <arg file="${outdir}"/>
+ <jvmarg value="-Xmx256M"/>
+ @antVmargs
<arg value="-startupUrl"/>
<arg value="@startupUrl"/>
<arg value="@moduleName"/>
@@ -84,9 +78,8 @@
<target name="clean" description="Cleans this project's intermediate and
output files">
<!-- uncomment if the WEB-INF/classes dir only contains GWT output -->
- <!-- <delete dir="${outdir}/WEB-INF/classes" failonerror="false" /> -->
- <delete dir="${outdir}/@deployDir" failonerror="false" />
- <delete dir="${extradir}" failonerror="false" />
+ <!-- <delete dir="war/WEB-INF/classes" failonerror="false" /> -->
+ <delete dir="war/@newModuleName" failonerror="false" />
</target>
</project>
diff --git a/user/src/com/google/gwt/user/tools/util/ArgHandlerEclipse.java b/user/src/com/google/gwt/user/tools/util/ArgHandlerEclipse.java
index 7346eb9..5ab1a64 100644
--- a/user/src/com/google/gwt/user/tools/util/ArgHandlerEclipse.java
+++ b/user/src/com/google/gwt/user/tools/util/ArgHandlerEclipse.java
@@ -21,12 +21,6 @@
* Creates an arg handler for eclipse launch config options.
*/
public abstract class ArgHandlerEclipse extends ArgHandlerString {
-
- @Override
- public String[] getDefaultArgs() {
- return null;
- }
-
@Override
public String getTag() {
return "-eclipse";
@@ -36,5 +30,4 @@
public String[] getTagArgs() {
return new String[] {"projectName"};
}
-
}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java b/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java
index f30b587..e21775b 100644
--- a/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java
+++ b/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java
@@ -26,7 +26,7 @@
import java.util.List;
/**
- * Utility methods shared by ApplicationCreator and ProjectCreator.
+ * Utility methods used by ApplicationCreator.
*
*/
public class CreatorUtilities {
diff --git a/user/src/com/google/gwt/user/tools/web.xmlsrc b/user/src/com/google/gwt/user/tools/web.xmlsrc
index 1d33d1e..60ade4d 100644
--- a/user/src/com/google/gwt/user/tools/web.xmlsrc
+++ b/user/src/com/google/gwt/user/tools/web.xmlsrc
@@ -8,7 +8,7 @@
<servlet-mapping>
<servlet-name>echoServlet</servlet-name>
- <url-pattern>/@deployDir/echo</url-pattern>
+ <url-pattern>/@newModuleName/echo</url-pattern>
</servlet-mapping>
</web-app>
diff --git a/user/super/com/google/gwt/emul/java/lang/Deprecated.java b/user/super/com/google/gwt/emul/java/lang/Deprecated.java
index 60f15f6..cf2192b 100644
--- a/user/super/com/google/gwt/emul/java/lang/Deprecated.java
+++ b/user/super/com/google/gwt/emul/java/lang/Deprecated.java
@@ -20,8 +20,11 @@
import java.lang.annotation.RetentionPolicy;
/**
- * Indicates that a method definition is intended to override a declaration
- * from a superclass. <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Override.html">[Sun docs]</a>
+ * A program element annotated @Deprecated is one that programmers are
+ * discouraged from using, typically because it is dangerous, or because a
+ * better alternative exists. <a
+ * href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Deprecated.html">[Sun
+ * docs]</a>
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/user/super/com/google/gwt/emul/java/util/TreeSet.java b/user/super/com/google/gwt/emul/java/util/TreeSet.java
index 496e87d..1d1fedc 100644
--- a/user/super/com/google/gwt/emul/java/util/TreeSet.java
+++ b/user/super/com/google/gwt/emul/java/util/TreeSet.java
@@ -27,9 +27,9 @@
public class TreeSet<E> extends AbstractSet<E> implements SortedSet<E>, Serializable {
/**
- * TreeSet is stored as a TreeMap of the requested type to a constant integer.
+ * TreeSet is stored as a TreeMap of the requested type to a constant Boolean.
*/
- SortedMap<E, Boolean> map;
+ private SortedMap<E, Boolean> map;
public TreeSet() {
map = new TreeMap<E, Boolean>();
@@ -65,7 +65,7 @@
@Override
public boolean add(E o) {
- // Use "this" as a convenient non-null value to store in the map
+ // Use Boolean.FALSE as a convenient non-null value to store in the map
return map.put(o, Boolean.FALSE) == null;
}
diff --git a/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java b/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java
index 985c79a..dc03d2a 100644
--- a/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java
+++ b/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java
@@ -67,7 +67,7 @@
simpleFire(BeforeSelectionEvent.getType(),
new BeforeSelectionEvent<String>());
simpleFire(SelectionEvent.getType(), new SelectionEvent<String>(null));
- simpleFire(CloseEvent.getType(), new CloseEvent<String>(null,false));
+ simpleFire(CloseEvent.getType(), new CloseEvent<String>(null, false));
simpleFire(OpenEvent.getType(), new OpenEvent<String>(null));
simpleFire(ResizeEvent.getType(), new ResizeEvent(0, 0));
simpleFire(ValueChangeEvent.getType(), new ValueChangeEvent<String>(null));
diff --git a/user/test/com/google/gwt/i18n/client/NumberFormat_ar_Test.java b/user/test/com/google/gwt/i18n/client/NumberFormat_ar_Test.java
index 2a82111..4bc62e6 100644
--- a/user/test/com/google/gwt/i18n/client/NumberFormat_ar_Test.java
+++ b/user/test/com/google/gwt/i18n/client/NumberFormat_ar_Test.java
@@ -39,11 +39,11 @@
public void testExponent() {
NumberFormat fmt = NumberFormat.getScientificFormat();
- assertEquals("\u0663\u066B\u0661\u0664\u0627\u0633\u0660",
+ assertEquals("\u0663\u0627\u0633\u0660",
fmt.format(3.14));
- assertEquals("\u0663\u066B\u0661\u0664\u0627\u0633\u0662",
+ assertEquals("\u0663\u0627\u0633\u0662",
fmt.format(314.0));
- assertEquals("-\u0663\u066B\u0661\u0664\u0627\u0633\u0662",
+ assertEquals("-\u0663\u0627\u0633\u0662",
fmt.format(-314.0));
}
diff --git a/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java b/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
index 3c0c60b..2eac1e6 100644
--- a/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
+++ b/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
@@ -294,7 +294,7 @@
str = NumberFormat.getPercentFormat().format(1234.579);
assertEquals("123,458%", str);
str = NumberFormat.getScientificFormat().format(1234.579);
- assertEquals("1.235E3", str);
+ assertEquals("1E3", str);
}
public void testZeros() {
diff --git a/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java b/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
index fcc5abc..2fe815d 100644
--- a/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
+++ b/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
@@ -221,13 +221,13 @@
String str;
str = NumberFormat.getCurrencyFormat().format(1234.579);
- assertEquals("1\u00A0234,58 \u20AC", str);
+ assertEquals("1\u00A0234,58\u00A0\u20AC", str);
str = NumberFormat.getDecimalFormat().format(1234.579);
assertEquals("1\u00A0234,579", str);
str = NumberFormat.getPercentFormat().format(1234.579);
assertEquals("123\u00A0458\u00A0%", str);
str = NumberFormat.getScientificFormat().format(1234.579);
- assertEquals("1,235E3", str);
+ assertEquals("1E3", str);
}
public void testZeros() {
diff --git a/user/test/com/google/gwt/user/UISuite.java b/user/test/com/google/gwt/user/UISuite.java
index 2db625e..864e0d6 100644
--- a/user/test/com/google/gwt/user/UISuite.java
+++ b/user/test/com/google/gwt/user/UISuite.java
@@ -27,12 +27,15 @@
import com.google.gwt.user.client.ui.CompositeTest;
import com.google.gwt.user.client.ui.CustomButtonTest;
import com.google.gwt.user.client.ui.DOMTest;
+import com.google.gwt.user.client.ui.DateBoxTest;
+import com.google.gwt.user.client.ui.DatePickerTest;
import com.google.gwt.user.client.ui.DeckPanelTest;
import com.google.gwt.user.client.ui.DecoratedPopupTest;
import com.google.gwt.user.client.ui.DecoratedStackPanelTest;
import com.google.gwt.user.client.ui.DecoratedTabBarTest;
import com.google.gwt.user.client.ui.DecoratedTabPanelTest;
import com.google.gwt.user.client.ui.DecoratorPanelTest;
+import com.google.gwt.user.client.ui.DelegatingKeyboardListenerCollectionTest;
import com.google.gwt.user.client.ui.DialogBoxTest;
import com.google.gwt.user.client.ui.DisclosurePanelTest;
import com.google.gwt.user.client.ui.DockPanelTest;
@@ -74,6 +77,7 @@
import com.google.gwt.user.client.ui.WidgetOnLoadTest;
import com.google.gwt.user.client.ui.WidgetSubclassingTest;
import com.google.gwt.user.client.ui.impl.ClippedImagePrototypeTest;
+import com.google.gwt.user.datepicker.client.DateChangeEventTest;
import com.google.gwt.user.rebind.ui.ImageBundleGeneratorTest;
import com.google.gwt.xml.client.XMLTest;
@@ -84,8 +88,7 @@
*/
public class UISuite {
public static Test suite() {
- GWTTestSuite suite = new GWTTestSuite(
- "Test for suite for the com.google.gwt.ui module");
+ GWTTestSuite suite = new GWTTestSuite("Test for suite for all user widgets");
suite.addTestSuite(AbsolutePanelTest.class);
suite.addTestSuite(AnchorTest.class);
@@ -97,14 +100,15 @@
suite.addTestSuite(CompositeTest.class);
suite.addTestSuite(CookieTest.class);
suite.addTestSuite(CustomButtonTest.class);
+ suite.addTestSuite(DateBoxTest.class);
+ suite.addTestSuite(DatePickerTest.class);
suite.addTestSuite(DeckPanelTest.class);
suite.addTestSuite(DecoratedPopupTest.class);
suite.addTestSuite(DecoratedStackPanelTest.class);
suite.addTestSuite(DecoratedTabBarTest.class);
suite.addTestSuite(DecoratedTabPanelTest.class);
suite.addTestSuite(DecoratorPanelTest.class);
- // TEMP
- // suite.addTestSuite(DelegatingKeyboardListenerCollectionTest.class);
+ suite.addTestSuite(DelegatingKeyboardListenerCollectionTest.class);
suite.addTestSuite(DialogBoxTest.class);
suite.addTestSuite(DisclosurePanelTest.class);
suite.addTestSuite(DockPanelTest.class);
@@ -151,7 +155,7 @@
suite.addTestSuite(WindowTest.class);
suite.addTestSuite(XMLTest.class);
suite.addTestSuite(ClassInitTest.class);
-
+ suite.addTestSuite(DateChangeEventTest.class);
return suite;
}
}
diff --git a/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java b/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
index de31315..c7ba8e2 100644
--- a/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
@@ -111,6 +111,12 @@
cb.setValue(true, true);
assertTrue(h.received);
+ try {
+ cb.setValue(null);
+ fail("Should throw IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ /* pass */
+ }
}
static class ListenerTester implements ClickListener {
diff --git a/user/test/com/google/gwt/user/client/ui/DateBoxTest.java b/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
new file mode 100644
index 0000000..624359a
--- /dev/null
+++ b/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.user.client.ui;
+
+import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.user.datepicker.client.DateBox;
+
+/**
+ * Tests DateBox.
+ */
+public class DateBoxTest extends GWTTestCase {
+ public String getModuleName() {
+ return "com.google.gwt.user.User";
+ }
+
+ public void testValueChangeEvent() {
+ DateBox db = new DateBox();
+ RootPanel.get().add(db);
+ new DateValueChangeTester(db).run();
+ }
+}
diff --git a/user/test/com/google/gwt/user/client/ui/DatePickerTest.java b/user/test/com/google/gwt/user/client/ui/DatePickerTest.java
new file mode 100644
index 0000000..cafac56
--- /dev/null
+++ b/user/test/com/google/gwt/user/client/ui/DatePickerTest.java
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.user.client.ui;
+
+import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.user.datepicker.client.CalendarModel;
+import com.google.gwt.user.datepicker.client.CalendarView;
+import com.google.gwt.user.datepicker.client.DatePicker;
+import com.google.gwt.user.datepicker.client.DefaultMonthSelector;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Tests DatePicker's public api.
+ */
+@SuppressWarnings("deprecation")
+// Due to Date
+public class DatePickerTest extends GWTTestCase {
+
+ private static class DatePickerWithView extends DatePicker {
+ DatePickerWithView(MockCalendarView view) {
+ super(new DefaultMonthSelector(), view, new CalendarModel());
+ }
+ }
+ /**
+ * Mock calendar view pretends to show datesVisibleList from the first of the month to
+ * the 30th day after that.
+ */
+ private static class MockCalendarView extends CalendarView {
+ Map<Date, Set<String>> dateStyles = new HashMap<Date, Set<String>>();
+ Set<Date> disabledDates = new HashSet<Date>();
+
+ MockCalendarView() {
+ initWidget(new Label());
+ }
+
+ @Override
+ public void addStyleToDate(String styleName, Date date) {
+ Set<String> fred = dateStyles.get(date);
+ if (fred == null) {
+ fred = new HashSet<String>();
+ dateStyles.put(date, fred);
+ }
+ fred.add(styleName);
+ }
+
+ @Override
+ public Date getFirstDate() {
+ Date thisMonth = getModel().getCurrentMonth();
+ return new Date(thisMonth.getYear(), thisMonth.getMonth(), 1);
+ }
+
+ @Override
+ public Date getLastDate() {
+ Date thisMonth = getModel().getCurrentMonth();
+ return new Date(thisMonth.getYear(), thisMonth.getMonth(), 30);
+ }
+
+ @Override
+ public boolean isDateEnabled(Date date) {
+ return !disabledDates.contains(date);
+ }
+
+ @Override
+ public void refresh() {
+ }
+
+ @Override
+ public void removeStyleFromDate(String styleName, Date date) {
+ Set<String> fred;
+ assertNotNull(fred = dateStyles.get(date));
+ assertTrue(fred.remove(styleName));
+ }
+
+ @Override
+ public void setEnabledOnDate(boolean enabled, Date date) {
+ if (enabled) {
+ disabledDates.remove(date);
+ } else {
+ disabledDates.add(date);
+ }
+ }
+
+ @Override
+ protected void setup() {
+ }
+ }
+
+ private static final String STYLE_LATER = "styleLater";
+
+ private static final String STYLE = "style1";
+
+ private DatePickerWithView mockedDatePicker;
+ private MockCalendarView view;
+
+ private final Date dateVisible1 = new Date(65, 6, 12);
+ private final Date dateVisible2 = new Date(65, 6, 13);
+ private final Date dateVisible3 = new Date(65, 6, 14);
+ private final Date dateVisible4 = new Date(65, 6, 15);
+ private final Date dateVisible5 = new Date(65, 6, 16);
+ private final List<Date> datesVisibleList = new ArrayList<Date>();
+ private final Date dateLater1 =
+ new Date(dateVisible1.getYear(), dateVisible1.getMonth() + 1,
+ dateVisible1.getDay());
+
+ private final Date dateLater2 =
+ new Date(dateVisible2.getYear(), dateVisible2.getMonth() + 1,
+ dateVisible2.getDay());
+ private final Date dateLater3 =
+ new Date(dateVisible1.getYear(), dateVisible3.getMonth() + 1,
+ dateVisible3.getDay());
+ private final Date dateLater4 =
+ new Date(dateVisible2.getYear(), dateVisible4.getMonth() + 1,
+ dateVisible4.getDay());
+ private final Date dateLater5 =
+ new Date(dateVisible1.getYear(), dateVisible5.getMonth() + 1,
+ dateVisible5.getDay());
+ private final List<Date> datesLaterList = new ArrayList<Date>();
+ {
+ datesVisibleList.add(dateVisible4);
+ datesVisibleList.add(dateVisible5);
+ }
+ {
+ datesLaterList.add(dateLater4);
+ datesLaterList.add(dateLater5);
+ }
+
+ public String getModuleName() {
+ return "com.google.gwt.user.User";
+ }
+
+ @Override
+ public void gwtSetUp() throws Exception {
+ super.gwtSetUp();
+
+ view = new MockCalendarView();
+ mockedDatePicker = new DatePickerWithView(view);
+ mockedDatePicker.setCurrentMonth(dateVisible1);
+ }
+
+ public void testDisabling() {
+ mockedDatePicker.setTransientEnabledOnDates(false, dateVisible1);
+ mockedDatePicker.setTransientEnabledOnDates(false, dateVisible2,
+ dateVisible3);
+ mockedDatePicker.setTransientEnabledOnDates(false, datesVisibleList);
+
+ assertTrue(view.disabledDates.contains(dateVisible1));
+ assertTrue(view.disabledDates.contains(dateVisible2));
+ assertTrue(view.disabledDates.contains(dateVisible3));
+ assertTrue(view.disabledDates.contains(dateVisible4));
+ assertTrue(view.disabledDates.contains(dateVisible5));
+
+ mockedDatePicker.setTransientEnabledOnDates(true, dateVisible1);
+ mockedDatePicker.setTransientEnabledOnDates(true, dateVisible2,
+ dateVisible3);
+ mockedDatePicker.setTransientEnabledOnDates(true, datesVisibleList);
+
+ assertFalse(view.disabledDates.contains(dateVisible1));
+ assertFalse(view.disabledDates.contains(dateVisible2));
+ assertFalse(view.disabledDates.contains(dateVisible3));
+ assertFalse(view.disabledDates.contains(dateVisible4));
+ assertFalse(view.disabledDates.contains(dateVisible5));
+ }
+
+ public void testStyleSetting() {
+ mockedDatePicker.addStyleToDates(STYLE, dateVisible1);
+ mockedDatePicker.addStyleToDates(STYLE, dateVisible2, dateVisible3);
+ mockedDatePicker.addStyleToDates(STYLE, datesVisibleList);
+
+ assertViewHasStyleOnVisibleDates(STYLE);
+ assertPickerHasStyleOnVisibleDates(STYLE);
+
+ // See that styles on an invisible datesVisibleList don't
+
+ mockedDatePicker.addStyleToDates(STYLE_LATER, dateLater1);
+ mockedDatePicker.addStyleToDates(STYLE_LATER, dateLater2, dateLater3);
+ mockedDatePicker.addStyleToDates(STYLE_LATER, datesLaterList);
+
+ assertViewHasNoStyleOnHiddenDates();
+ assertPickerLacksStyleOnHiddenDates(STYLE_LATER);
+
+ // Remove a style from a visible date, and it should leave the view too
+ mockedDatePicker.removeStyleFromDates(STYLE, dateVisible1);
+ mockedDatePicker.removeStyleFromDates(STYLE, dateVisible2, dateVisible3);
+ mockedDatePicker.removeStyleFromDates(STYLE, datesVisibleList);
+
+ assertViewLacksStyleOnVisibleDates(STYLE);
+ assertPickerLacksStyleOnVisibleDates();
+
+ // Remove a style from an invisible date, and the view should not hear
+ // about it (the mock will explode if asked to remove a style it doesn't
+ // have)
+ mockedDatePicker.removeStyleFromDates(STYLE_LATER, dateLater1);
+ mockedDatePicker.removeStyleFromDates(STYLE_LATER, dateLater2, dateLater3);
+ mockedDatePicker.removeStyleFromDates(STYLE_LATER, datesLaterList);
+ assertPickerHasNoStyleOnInvisibleDates();
+ }
+
+ public void testTransientStyles() {
+ mockedDatePicker.addTransientStyleToDates(STYLE, dateVisible1);
+ mockedDatePicker.addTransientStyleToDates(STYLE, dateVisible2,
+ dateVisible3);
+ mockedDatePicker.addTransientStyleToDates(STYLE, datesVisibleList);
+ assertViewHasStyleOnVisibleDates(STYLE);
+ assertPickerLacksStyleOnVisibleDates();
+
+ mockedDatePicker.removeStyleFromDates(STYLE, dateVisible1);
+ mockedDatePicker.removeStyleFromDates(STYLE, dateVisible2, dateVisible3);
+ mockedDatePicker.removeStyleFromDates(STYLE, datesVisibleList);
+ assertViewLacksStyleOnVisibleDates(STYLE);
+ assertPickerLacksStyleOnVisibleDates();
+ }
+
+ public void testValueChangeEvent() {
+ DatePicker dp = new DatePicker();
+ RootPanel.get().add(dp);
+ new DateValueChangeTester(dp).run();
+ }
+
+ public void testValueStyle() {
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible4));
+
+ mockedDatePicker.setValue(dateVisible4);
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible4).contains("datePickerDayIsValue"));
+ assertTrue(view.dateStyles.get(dateVisible4).contains("datePickerDayIsValue"));
+
+ mockedDatePicker.setValue(dateVisible5);
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible4));
+ assertFalse(view.dateStyles.get(dateVisible4).contains("datePickerDayIsValue"));
+ }
+
+ private void assertPickerHasNoStyleOnInvisibleDates() {
+ assertNull(mockedDatePicker.getStyleOfDate(dateLater1));
+ assertNull(mockedDatePicker.getStyleOfDate(dateLater2));
+ assertNull(mockedDatePicker.getStyleOfDate(dateLater3));
+ assertNull(mockedDatePicker.getStyleOfDate(dateLater4));
+ assertNull(mockedDatePicker.getStyleOfDate(dateLater5));
+ }
+
+ private void assertPickerHasStyleOnVisibleDates(String style) {
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible1).contains(
+ style));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible2).contains(
+ style));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible3).contains(
+ style));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible4).contains(
+ style));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateVisible5).contains(
+ style));
+ }
+
+ private void assertPickerLacksStyleOnHiddenDates(String styleLater) {
+ assertTrue(mockedDatePicker.getStyleOfDate(dateLater1).contains(
+ styleLater));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateLater2).contains(
+ styleLater));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateLater3).contains(
+ styleLater));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateLater4).contains(
+ styleLater));
+ assertTrue(mockedDatePicker.getStyleOfDate(dateLater5).contains(
+ styleLater));
+ }
+
+ private void assertPickerLacksStyleOnVisibleDates() {
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible1));
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible2));
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible3));
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible4));
+ assertNull(mockedDatePicker.getStyleOfDate(dateVisible5));
+ }
+
+ private void assertViewHasNoStyleOnHiddenDates() {
+ assertNull(view.dateStyles.get(dateLater1));
+ assertNull(view.dateStyles.get(dateLater2));
+ assertNull(view.dateStyles.get(dateLater3));
+ assertNull(view.dateStyles.get(dateLater4));
+ assertNull(view.dateStyles.get(dateLater5));
+ }
+
+ private void assertViewHasStyleOnVisibleDates(String style) {
+ assertTrue(view.dateStyles.get(dateVisible1).contains(style));
+ assertTrue(view.dateStyles.get(dateVisible2).contains(style));
+ assertTrue(view.dateStyles.get(dateVisible3).contains(style));
+ assertTrue(view.dateStyles.get(dateVisible4).contains(style));
+ assertTrue(view.dateStyles.get(dateVisible5).contains(style));
+ }
+
+ private void assertViewLacksStyleOnVisibleDates(String style) {
+ assertFalse(view.dateStyles.get(dateVisible1).contains(style));
+ assertFalse(view.dateStyles.get(dateVisible2).contains(style));
+ assertFalse(view.dateStyles.get(dateVisible3).contains(style));
+ assertFalse(view.dateStyles.get(dateVisible4).contains(style));
+ assertFalse(view.dateStyles.get(dateVisible5).contains(style));
+ }
+}
diff --git a/user/test/com/google/gwt/user/client/ui/DateValueChangeTester.java b/user/test/com/google/gwt/user/client/ui/DateValueChangeTester.java
new file mode 100644
index 0000000..0e9636f
--- /dev/null
+++ b/user/test/com/google/gwt/user/client/ui/DateValueChangeTester.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.user.client.ui;
+
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+
+import junit.framework.TestCase;
+
+import java.util.Date;
+
+/**
+ * Handy tool for testing classes that implement {@link HasValue<Date>}.
+ */
+public class DateValueChangeTester {
+ static class Handler implements ValueChangeHandler<Date> {
+ Date received = null;
+
+ public void onValueChange(ValueChangeEvent<Date> event) {
+ received = event.getValue();
+ }
+ }
+
+ private final HasValue<Date> subject;
+
+ /**
+ * The HasValue<Date> to be tested. It should have been freshly created before
+ * handing it to this tester.
+ */
+ public DateValueChangeTester(HasValue<Date> subject) {
+ this.subject = subject;
+ }
+
+ /**
+ * Asserts that the default value is null, checks that value change events do
+ * and don't fire when appropriate, and that getValue() always returns what
+ * was handed to getValue().
+ */
+ @SuppressWarnings("deprecation")
+ public void run() {
+ TestCase.assertNull(subject.getValue());
+
+ DateValueChangeTester.Handler h = new Handler();
+ subject.addValueChangeHandler(h);
+
+ subject.setValue(null);
+ TestCase.assertNull(subject.getValue());
+ TestCase.assertNull(h.received);
+
+ Date able = new Date(1999, 5, 15);
+ subject.setValue(able);
+ TestCase.assertEquals(able, subject.getValue());
+ TestCase.assertNull(h.received);
+
+ subject.setValue(able);
+ TestCase.assertNull(h.received);
+
+ Date baker = new Date(1965, 12, 7);
+ subject.setValue(baker);
+ TestCase.assertNull(h.received);
+
+ // Value has not changed, so should not fire a change event even though
+ // fire event is true.
+ subject.setValue(baker, true);
+ TestCase.assertNull(h.received);
+
+ subject.setValue(able, true);
+ TestCase.assertEquals(able, h.received);
+ TestCase.assertNotSame(able, h.received);
+
+ subject.setValue(baker, true);
+ TestCase.assertEquals(baker, h.received);
+ TestCase.assertNotSame(baker, h.received);
+
+ h.received = null;
+ // Value has changed, but boolean is false.
+ subject.setValue(baker, false);
+ TestCase.assertNull(h.received);
+ }
+}
\ No newline at end of file
diff --git a/user/test/com/google/gwt/user/client/ui/DisclosurePanelTest.java b/user/test/com/google/gwt/user/client/ui/DisclosurePanelTest.java
index 5412215..6039eea 100644
--- a/user/test/com/google/gwt/user/client/ui/DisclosurePanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DisclosurePanelTest.java
@@ -129,7 +129,6 @@
assertEquals(3, panel.getHandlers().getHandlerCount(CloseEvent.getType()));
assertEquals(3, panel.getHandlers().getHandlerCount(OpenEvent.getType()));
-
panel.setOpen(true);
// We expect onOpen to fire and onClose to not fire.
assertTrue(aDidFire[OPEN] && bDidFire[OPEN] && !aDidFire[CLOSE]
@@ -148,7 +147,6 @@
assertEquals(2, panel.getHandlers().getHandlerCount(OpenEvent.getType()));
assertEquals(2, panel.getHandlers().getHandlerCount(CloseEvent.getType()));
-
panel.setOpen(true);
panel.setOpen(false);
// We expect a to have fired both events, and b to have fired none.
@@ -158,6 +156,19 @@
assertTrue(!bDidFire[CLOSE]);
}
+ /**
+ * Tests that the content is set to null if the content widget's
+ * {@link Widget#removeFromParent()} method is called.
+ */
+ public void testRemoveFromParent() {
+ DisclosurePanel panel = createTestPanel();
+ Label content = new Label();
+ panel.setContent(content);
+ assertEquals(content, panel.getContent());
+ content.removeFromParent();
+ assertNull(panel.getContent());
+ }
+
private DisclosurePanel createTestPanel() {
DisclosurePanel panel = new DisclosurePanel("Test Subject", false);
panel.setContent(new SimplePanel());
diff --git a/user/test/com/google/gwt/user/client/ui/PopupTest.java b/user/test/com/google/gwt/user/client/ui/PopupTest.java
index ad7a220..f42b84c 100644
--- a/user/test/com/google/gwt/user/client/ui/PopupTest.java
+++ b/user/test/com/google/gwt/user/client/ui/PopupTest.java
@@ -29,10 +29,22 @@
* Expose otherwise private or protected methods.
*/
private class TestablePopupPanel extends PopupPanel {
+ private int onLoadCount;
+
@Override
public Element getContainerElement() {
return super.getContainerElement();
}
+
+ public void assertOnLoadCount(int expected) {
+ assertEquals(expected, onLoadCount);
+ }
+
+ @Override
+ public void onLoad() {
+ super.onLoad();
+ onLoadCount++;
+ }
}
@Override
@@ -95,6 +107,45 @@
testDependantPopupPanel(primaryPopup);
}
+ /**
+ * Test that the onLoad method is only called once when showing the popup.
+ */
+ public void testOnLoad() {
+ TestablePopupPanel popup = new TestablePopupPanel();
+
+ // show() without animation
+ {
+ popup.setAnimationEnabled(false);
+ popup.show();
+ popup.assertOnLoadCount(1);
+ popup.hide();
+ }
+
+ // show() with animation
+ {
+ popup.setAnimationEnabled(true);
+ popup.show();
+ popup.assertOnLoadCount(2);
+ popup.hide();
+ }
+
+ // center() without animation
+ {
+ popup.setAnimationEnabled(false);
+ popup.center();
+ popup.assertOnLoadCount(3);
+ popup.hide();
+ }
+
+ // center() with animation
+ {
+ popup.setAnimationEnabled(true);
+ popup.center();
+ popup.assertOnLoadCount(4);
+ popup.hide();
+ }
+ }
+
public void testPopup() {
// Get rid of window margins so we can test absolute position.
Window.setMargin("0px");
diff --git a/user/test/com/google/gwt/user/client/ui/TabBarTest.java b/user/test/com/google/gwt/user/client/ui/TabBarTest.java
index 0c4bed9..3909bcc 100644
--- a/user/test/com/google/gwt/user/client/ui/TabBarTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TabBarTest.java
@@ -162,6 +162,71 @@
}
/**
+ * Verify that wordWrap works when adding widgets that implement HasWordWrap.
+ */
+ public void testWordWrapWithSupport() {
+ TabBar bar = createTabBar();
+ Label tabContent0 = new Label("Tab 0", false);
+ Label tabContent1 = new Label("Tab 1", true);
+ bar.addTab(tabContent0);
+ bar.addTab(tabContent1);
+ bar.addTab("Tab 2");
+
+ // hasWordWrap()
+ {
+ assertTrue(bar.getTab(0).hasWordWrap());
+ assertTrue(bar.getTab(1).hasWordWrap());
+ assertTrue(bar.getTab(2).hasWordWrap());
+ }
+
+ // getWordWrap()
+ {
+ assertFalse(bar.getTab(0).getWordWrap());
+ assertTrue(bar.getTab(1).getWordWrap());
+ assertFalse(bar.getTab(2).getWordWrap());
+ }
+
+ // setWordWrap()
+ {
+ bar.getTab(0).setWordWrap(true);
+ bar.getTab(1).setWordWrap(true);
+ bar.getTab(2).setWordWrap(true);
+ assertTrue(bar.getTab(0).getWordWrap());
+ assertTrue(bar.getTab(1).getWordWrap());
+ assertTrue(bar.getTab(2).getWordWrap());
+ assertTrue(tabContent0.getWordWrap());
+ }
+ }
+
+ /**
+ * Verify that wordWrap works when adding widgets that do not implement
+ * HasWordWrap.
+ */
+ public void testWordWrapWithoutSupport() {
+ TabBar bar = createTabBar();
+ bar.addTab(new Button("Tab 0"));
+
+ // hasWordWrap
+ assertFalse(bar.getTab(0).hasWordWrap());
+
+ // getWordWrap();
+ try {
+ bar.getTab(0).getWordWrap();
+ fail("Expected UnsupportedOperationException");
+ } catch (UnsupportedOperationException e) {
+ assertTrue(true);
+ }
+
+ // setWordWrap();
+ try {
+ bar.getTab(0).setWordWrap(true);
+ fail("Expected UnsupportedOperationException");
+ } catch (UnsupportedOperationException e) {
+ assertTrue(true);
+ }
+ }
+
+ /**
* Create a new, empty tab bar.
*/
protected TabBar createTabBar() {
diff --git a/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java b/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
index bf47218..58aa3e2 100644
--- a/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
+++ b/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
@@ -98,22 +98,31 @@
public void testValueChangeEvent() {
TextBoxBase tb = createTextBoxBase();
-
// To work cross-platform, the tb must be added to the root panel.
RootPanel.get().add(tb);
+
Handler h = new Handler();
tb.addValueChangeHandler(h);
- tb.setText("able");
+
+ tb.setValue(null);
+ assertEquals("", tb.getValue());
assertNull(h.received);
- tb.setValue("able");
+ tb.setText("able");
+ assertEquals("able", tb.getValue());
assertNull(h.received);
+
+ tb.setValue("able");
+ assertEquals("able", tb.getValue());
+ assertNull(h.received);
+
tb.setValue("baker");
assertNull(h.received);
tb.setValue("baker", true);
+ assertEquals("baker", tb.getValue());
assertNull(h.received);
-
+
tb.setValue("able", true);
assertEquals("able", h.received);
diff --git a/user/test/com/google/gwt/user/client/ui/TreeTest.java b/user/test/com/google/gwt/user/client/ui/TreeTest.java
index 04443f6..d263d9f 100644
--- a/user/test/com/google/gwt/user/client/ui/TreeTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TreeTest.java
@@ -270,26 +270,4 @@
assertNull(eLabel.getParent());
assertFalse(childTree.getChildWidgets().containsKey(eLabel.getParent()));
}
-
- /**
- * Tests setImageBase() which, though deprecated, should still work.
- */
- public void testSetImageBase() {
- Tree t = new Tree();
- TreeItem parent = new TreeItem("parent");
- parent.addItem("child");
- t.addItem(parent);
- RootPanel.get().add(t);
-
- // This was throwing UnsupportedOperationException at one point (just
- // before the 1.5 release), because of additions to ImagePrototype. If
- // that were to creep back in, we'd see an exception.
- t.setImageBase("");
-
- // Make sure the parent open/close image actually got created (there's
- // no actual public image file to back this up, but it won't matter from
- // the standpoint of this test).
- String parentSrc = DOM.getImgSrc(parent.getImageElement());
- assertTrue(parentSrc.endsWith("tree_closed.gif"));
- }
}
diff --git a/user/test/com/google/gwt/user/datepicker/client/DateChangeEventTest.java b/user/test/com/google/gwt/user/datepicker/client/DateChangeEventTest.java
new file mode 100644
index 0000000..b8c5361
--- /dev/null
+++ b/user/test/com/google/gwt/user/datepicker/client/DateChangeEventTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.gwt.user.datepicker.client;
+
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.event.shared.HandlerManager;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.DateValueChangeTester;
+import com.google.gwt.user.client.ui.HasValue;
+
+import junit.framework.TestCase;
+
+import java.util.Date;
+
+/**
+ * Test the DateChangeEvent in isolation from GWT.
+ */
+public class DateChangeEventTest extends TestCase {
+
+ private class MockWidget implements HasValue<Date> {
+ private final HandlerManager handlers = new HandlerManager(this);
+ private Date value;
+
+ public HandlerRegistration addValueChangeHandler(
+ ValueChangeHandler<Date> handler) {
+ return handlers.addHandler(ValueChangeEvent.getType(), handler);
+ }
+
+ public HandlerManager getHandlers() {
+ return handlers;
+ }
+
+ public Date getValue() {
+ return value;
+ }
+
+ public void setValue(Date value) {
+ setValue(value, false);
+ }
+
+ public void setValue(Date value, boolean fireEvents) {
+ Date oldValue = this.value;
+ this.value = value;
+ if (fireEvents) {
+ DateChangeEvent.fireIfNotEqualDates(this, oldValue, value);
+ }
+ }
+ }
+
+ public void testValueChangeViaHasValue() {
+ new DateValueChangeTester(new MockWidget()).run();
+ }
+
+}