Removing I18N sample now that it has been incorporated into Showcase.
Patch by: jlabanca
Review by: jat
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6503 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/eclipse/samples/I18N/.checkstyle b/eclipse/samples/I18N/.checkstyle
deleted file mode 100644
index 0f1cbd9..0000000
--- a/eclipse/samples/I18N/.checkstyle
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.2.0" simple-config="true">
- <fileset name="all" enabled="true" check-config-name="GWT Checks" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
- <filter name="NonSrcDirs" enabled="true"/>
-</fileset-config>
diff --git a/eclipse/samples/I18N/.classpath b/eclipse/samples/I18N/.classpath
deleted file mode 100644
index 26f2949..0000000
--- a/eclipse/samples/I18N/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="core/src"/>
- <classpathentry kind="src" output="war" path="core/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"/>
-</classpath>
diff --git a/eclipse/samples/I18N/.project b/eclipse/samples/I18N/.project
deleted file mode 100644
index 0f52eed..0000000
--- a/eclipse/samples/I18N/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>I18N</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
- </natures>
- <linkedResources>
- <link>
- <name>core</name>
- <type>2</type>
- <locationURI>GWT_ROOT/samples/i18n</locationURI>
- </link>
- </linkedResources>
-</projectDescription>
diff --git a/eclipse/samples/I18N/I18N-gwtc.launch b/eclipse/samples/I18N/I18N-gwtc.launch
deleted file mode 100644
index 97deebe..0000000
--- a/eclipse/samples/I18N/I18N-gwtc.launch
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="I18N" path="1" type="4"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/I18N/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-dev/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="I18N"/> </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.Compiler"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="com.google.gwt.sample.i18n.I18N"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="I18N"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
-</launchConfiguration>
diff --git a/eclipse/samples/I18N/I18N.launch b/eclipse/samples/I18N/I18N.launch
deleted file mode 100644
index 9bc0ca2..0000000
--- a/eclipse/samples/I18N/I18N.launch
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="I18N" path="1" type="4"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/I18N/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-dev/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="I18N"/> </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.HostedMode"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-startupUrl I18N.html com.google.gwt.sample.i18n.I18N"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="I18N"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
-</launchConfiguration>
diff --git a/samples/build.xml b/samples/build.xml
index f937fc9..7d6f026 100644
--- a/samples/build.xml
+++ b/samples/build.xml
@@ -14,10 +14,6 @@
<gwt.ant dir="hello" />
</target>
- <target name="i18n" description="Build i18n">
- <gwt.ant dir="i18n" />
- </target>
-
<target name="json" description="Build json">
<gwt.ant dir="json" />
</target>
@@ -33,7 +29,6 @@
<target name="-do" description="Run all subprojects" >
<antcall target="dynatable" />
<antcall target="hello" />
- <antcall target="i18n" />
<antcall target="json" />
<antcall target="mail" />
<antcall target="showcase" />
diff --git a/samples/i18n/build.xml b/samples/i18n/build.xml
deleted file mode 100755
index f2b7a18..0000000
--- a/samples/i18n/build.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<project name="i18n" default="build" basedir=".">
- <property name="sample.root" value="i18n" />
- <property name="sample.module" value="I18N" />
- <import file="../common.ant.xml" />
-</project>
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/COPYING b/samples/i18n/src/com/google/gwt/sample/i18n/COPYING
deleted file mode 100644
index d9a10c0..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/COPYING
+++ /dev/null
@@ -1,176 +0,0 @@
- 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/i18n/src/com/google/gwt/sample/i18n/I18N.gwt.xml b/samples/i18n/src/com/google/gwt/sample/i18n/I18N.gwt.xml
deleted file mode 100644
index cf6ecc9..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/I18N.gwt.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- -->
-<!-- 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="i18n">
- <inherits name="com.google.gwt.user.User" />
- <inherits name="com.google.gwt.i18n.I18N"/>
- <entry-point class="com.google.gwt.sample.i18n.client.I18N" />
- <extend-property name="locale" values="en,fr" />
- <set-property-fallback name="locale" value="fr"/>
-</module>
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.java
deleted file mode 100644
index d3941aa..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Constants;
-
-/**
- *
- */
-public interface AbstractFormatExampleConstants extends Constants {
-
- @DefaultStringValue("Unable to parse input")
- String failedToParseInput();
-
- @DefaultStringValue("Formatted value")
- String formattedOutput();
-
- @DefaultStringValue("Value to format")
- String inputValue();
-
- @DefaultStringValue("Invalid pattern")
- String invalidPattern();
-
- @DefaultStringValue("Pattern")
- String pattern();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.properties
deleted file mode 100644
index 3d34379..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-inputValue = Value to format
-formattedOutput = Formatted value
-pattern = Pattern
-invalidPattern = Invalid pattern
-failedToParseInput = Unable to parse input
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants_fr.properties
deleted file mode 100644
index efd7ffb..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleConstants_fr.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-inputValue = Valeur à composer
-formattedOutput = Valeur composée
-pattern = Format
-invalidPattern = Format invalide
-failedToParseInput = Incapable d'analyser l'entrée
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleController.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleController.java
deleted file mode 100644
index a4c7437..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/AbstractFormatExampleController.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.TextBox;
-
-import java.util.Map;
-
-/**
- * Abstract base class used to implement {@link NumberFormatExampleController}
- * and {@link DateTimeFormatExampleController}.
- */
-public abstract class AbstractFormatExampleController {
-
- private static final String PATTERN_KEY_CUSTOM = "custom";
- public final TextBox txtCurrentPattern = new TextBox();
- public final Label lblFormattedOutput = new Label();
- public final Label lblPatternError = new Label();
- public final Label lblParseError = new Label();
- public final ListBox lstSamplePatterns = new ListBox();
- public final TextBox txtInput = new TextBox();
- private String prevPattern;
- private String prevInput;
-
- protected AbstractFormatExampleController(String defaultText,
- Map<String, String> patterns) {
- initWidgetsForPattern(patterns);
- initWidgetsForInput();
- txtInput.setText(defaultText);
- tryToParseInput(false);
- }
-
- protected abstract String doGetPattern(String patternKey);
-
- /**
- * Parses the specified pattern and remembers it for formatting input later.
- *
- * @param pattern
- * @throws IllegalArgumentException if the pattern could not be parsed
- */
- protected abstract void doParseAndRememberPattern(String pattern);
-
- protected abstract void doParseInput(String toParse, HasText output,
- HasText error);
-
- private void initWidgetsForInput() {
- txtInput.addKeyUpHandler(new KeyUpHandler() {
- public void onKeyUp(KeyUpEvent event) {
- tryToParseInput(false);
- }
- });
- }
-
- private void initWidgetsForPattern(Map<String, String> patternMap) {
- txtCurrentPattern.addKeyUpHandler(new KeyUpHandler() {
- public void onKeyUp(KeyUpEvent event) {
- String pattern = txtCurrentPattern.getText();
-
- // Update the active pattern.
- tryToActivatePattern(pattern);
- }
- });
-
- // Load pattern choices.
- for (Map.Entry<String, String> entry : patternMap.entrySet()) {
- String patternKey = entry.getKey();
- String caption = entry.getValue();
-
- lstSamplePatterns.addItem(caption, patternKey);
- }
-
- lstSamplePatterns.addChangeHandler(new ChangeHandler() {
- public void onChange(ChangeEvent event) {
- syncPatternToList();
- }
- });
-
- lstSamplePatterns.setSelectedIndex(0);
-
- syncPatternToList();
- }
-
- private void syncPatternToList() {
- int sel = lstSamplePatterns.getSelectedIndex();
- assert (sel >= 0) && (sel < lstSamplePatterns.getItemCount());
-
- // Update the current pattern.
- String patternKey = lstSamplePatterns.getValue(sel);
- String pattern;
- if (PATTERN_KEY_CUSTOM.equals(patternKey)) {
- // Make the pattern text box editable.
- txtCurrentPattern.setReadOnly(false);
- pattern = txtCurrentPattern.getText();
- txtCurrentPattern.setText(pattern);
- txtCurrentPattern.selectAll();
- txtCurrentPattern.setFocus(true);
- } else {
- // Make the pattern text box read only.
- txtCurrentPattern.setReadOnly(true);
- pattern = doGetPattern(patternKey);
- txtCurrentPattern.setText(pattern);
- }
-
- // Make the new pattern active.
- tryToActivatePattern(pattern);
- }
-
- private void tryToActivatePattern(String pattern) {
- if (!pattern.equals(prevPattern)) {
- prevPattern = pattern;
- lblPatternError.setText("");
- try {
- // Allow the subclass to parse the pattern.
- doParseAndRememberPattern(pattern);
-
- // Parse and format the input again since the pattern changed.
- tryToParseInput(true);
- } catch (IllegalArgumentException e) {
- lblPatternError.setText(e.getMessage());
- }
- }
- }
-
- private void tryToParseInput(boolean forceReparse) {
- String toParse = txtInput.getText();
- if (forceReparse || !toParse.equals(prevInput)) {
- prevInput = toParse;
- lblParseError.setText("");
- doParseInput(toParse, lblFormattedOutput, lblParseError);
- }
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.java
deleted file mode 100644
index de41c5c..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.ConstantsWithLookup;
-
-/**
- * Internationalized constants used by
- * {@link ConstantsWithLookupExampleController}.
- */
-public interface ColorConstants extends ConstantsWithLookup {
-
- @DefaultStringValue("Black")
- String black();
-
- @DefaultStringValue("Blue")
- String blue();
-
- @DefaultStringValue("Green")
- String green();
-
- @DefaultStringValue("Grey")
- String grey();
-
- @DefaultStringValue("Light Grey")
- String lightGrey();
-
- @DefaultStringValue("Red")
- String red();
-
- @DefaultStringValue("White")
- String white();
-
- @DefaultStringValue("Yellow")
- String yellow();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.properties
deleted file mode 100644
index e98bd3b..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-
-red = Red
-green = Green
-yellow = Yellow
-blue = Blue
-black = Black
-white = White
-grey = Grey
-lightGrey = Light Grey
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants_fr.properties
deleted file mode 100644
index c0643a0..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ColorConstants_fr.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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.
-#
-
-red = Rouge
-green = Vert
-yellow = Jaune
-blue = Bleu
-black = Noir
-white = Blanc
-grey = Gris
-lightGrey = Gris clair
-
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.java
deleted file mode 100644
index 005cf2f..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Constants;
-
-import java.util.Map;
-
-/**
- * Internationalized constants used to demonstrate {@link Constants}.
- */
-public interface ConstantsExampleConstants extends Constants {
-
- @DefaultStringMapValue({"black", "Black", "blue", "Blue", "green", "Green", "grey", "Grey",
- "lightGrey", "Light Grey", "red", "Red", "white", "White", "yellow", "Yellow"})
- Map<String, String> colorMap();
-
- @DefaultStringValue("Favorite color")
- String favoriteColor();
-
- @DefaultStringValue("First Name")
- String firstName();
-
- @DefaultStringValue("Last Name")
- String lastName();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.properties
deleted file mode 100644
index 567b09a..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# 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.
-#
-
-firstName = First Name
-lastName = Last Name
-favoriteColor = Favorite color
-
-black = Black
-blue = Blue
-green = Green
-grey = Grey
-lightGrey = Light Grey
-red = Red
-white = White
-yellow = Yellow
-
-colorMap = red, white, yellow, black, blue, green, grey, lightGrey
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants_fr.properties
deleted file mode 100644
index 9bb9b45..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsExampleConstants_fr.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# 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.
-#
-
-firstName = Prénom
-lastName = Nom
-favoriteColor = Couleur préférée
-
-black = Noir
-blue = Bleu
-green = Vert
-grey = Gris
-lightGrey = Gris clair
-red = Rouge
-white = Blanc
-yellow = Jaune
-
-colorMap = red, white, yellow, black, blue, green, grey, lightGrey
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.java
deleted file mode 100644
index 4ed50df..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Constants;
-
-/**
- * Internationalized constants used by
- * {@link ConstantsWithLookupExampleController}.
- */
-public interface ConstantsWithLookupExampleConstants extends Constants {
- String input();
-
- String noInputResult();
-
- String noMatchingResult();
-
- String result();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.properties
deleted file mode 100644
index 8b8c2e9..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-input = Name of method
-noInputResult = <Please enter a method name above>
-noMatchingResult = <Not found>
-result = Lookup results
-
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants_fr.properties
deleted file mode 100644
index 26f8d23..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleConstants_fr.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-
-input = Nom de méthode
-noInputResult = <Veuillez tapez un des noms de méthodes ci-dessus>
-noMatchingResult = <Non trouvé>
-result = Resultat de cherche
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleController.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleController.java
deleted file mode 100644
index 86808bc..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ConstantsWithLookupExampleController.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.user.client.ui.TextBox;
-
-import java.util.MissingResourceException;
-
-/**
- * Demonstrates {@link com.google.gwt.i18n.client.ConstantsWithLookup}.
- */
-public class ConstantsWithLookupExampleController {
-
- private static final String DEFAULT_INPUT = "red";
- private static final ColorConstants COLORS = GWT.create(ColorConstants.class);
-
- public final TextBox txtInput = new TextBox();
- public final TextBox txtResult = new TextBox();
- private String prevText;
- private final ConstantsWithLookupExampleConstants constants;
-
- public ConstantsWithLookupExampleController(
- final ConstantsWithLookupExampleConstants constants) {
-
- this.constants = constants;
- txtResult.setText(constants.noInputResult());
- txtResult.setReadOnly(true);
-
- txtInput.addKeyUpHandler(new KeyUpHandler() {
- public void onKeyUp(KeyUpEvent event) {
- maybeRefreshLookup(constants);
- }
- });
-
- txtInput.setText(DEFAULT_INPUT);
- maybeRefreshLookup(constants);
- }
-
- public ConstantsWithLookupExampleConstants getConstants() {
- return constants;
- }
-
- private void maybeRefreshLookup(
- final ConstantsWithLookupExampleConstants constants) {
- final String currText = txtInput.getText().trim();
- if (!currText.equals(prevText)) {
- prevText = currText;
- if ("".equals(currText)) {
- txtResult.setText(constants.noInputResult());
- } else {
- try {
- String color = COLORS.getString(currText);
- txtResult.setText(color);
- } catch (MissingResourceException e) {
- txtResult.setText(constants.noMatchingResult());
- }
- }
- }
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.java
deleted file mode 100644
index 93fb108..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.i18n.client;
-
-import java.util.Map;
-
-/**
- * Internationalized constants used by {@link DateTimeFormatExampleController}.
- */
-public interface DateTimeFormatExampleConstants extends
- AbstractFormatExampleConstants {
- @DefaultStringMapValue({"fullDateTime", "Full Date/Time", "longDateTime", "Long Date/Time",
- "mediumDateTime", "Medium Date/Time", "shortDateTime", "Short Date/Time", "fullDate",
- "Full Date", "longDate", "Long Date", "mediumDate", "Medium Date", "shortDate", "Short Date",
- "fullTime", "Full Time", "longTime", "Long Time", "mediumTime", "Medium Time", "shortTime",
- "Short Time", "custom", "Custom"})
- Map<String, String> dateTimeFormatPatterns();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.properties
deleted file mode 100644
index 685c4a9..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-
-fullDateTime = Full Date/Time
-longDateTime = Long Date/Time
-mediumDateTime = Medium Date/Time
-shortDateTime = Short Date/Time
-
-fullDate = Full Date
-longDate = Long Date
-mediumDate = Medium Date
-shortDate = Short Date
-
-fullTime = Full Time
-longTime = Long Time
-mediumTime = Medium Time
-shortTime = Short Time
-
-custom = Custom
-
-dateTimeFormatPatterns = \
- fullDateTime, longDateTime, mediumDateTime, shortDateTime, \
- fullDate, longDate, mediumDate, shortDate, \
- fullTime, longTime, mediumTime, shortTime, \
- custom
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants_fr.properties
deleted file mode 100644
index bf2a1b5..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleConstants_fr.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-
-fullDateTime = Date/Heure complets
-longDateTime = Date/Heure très détaillés
-mediumDateTime = Date/Heure détaillés
-shortDateTime = Date/Heure abrégés
-
-fullDate = Date complète
-longDate = Date très détaillée
-mediumDate = Date détaillée
-shortDate = Date abrégée
-
-fullTime = Heure complète
-longTime = Heure très détaillée
-mediumTime = Heure détaillée
-shortTime = Heure abrégée
-
-custom = Personnalisé
-
-dateTimeFormatPatterns = \
- fullDateTime, longDateTime, mediumDateTime, shortDateTime, \
- fullDate, longDate, mediumDate, shortDate, \
- fullTime, longTime, mediumTime, shortTime, \
- custom
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleController.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleController.java
deleted file mode 100644
index 6b3e3ec..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/DateTimeFormatExampleController.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.ui.HasText;
-
-import java.util.Date;
-
-/**
- * Demonstrates how to use {@link DateTimeFormat}.
- */
-public class DateTimeFormatExampleController extends
- AbstractFormatExampleController {
-
- private static final String DEFAULT_INPUT = "13 September 1999";
- private DateTimeFormat activeFormat;
- private final DateTimeFormatExampleConstants constants;
-
- public DateTimeFormatExampleController(
-
- final DateTimeFormatExampleConstants constants) {
- super(DEFAULT_INPUT, constants.dateTimeFormatPatterns());
- this.constants = constants;
- }
-
- public DateTimeFormatExampleConstants getConstants() {
- return constants;
- }
-
- @Override
- protected String doGetPattern(String patternKey) {
- // Date + Time
- if ("fullDateTime".equals(patternKey)) {
- return DateTimeFormat.getFullDateTimeFormat().getPattern();
- }
-
- if ("longDateTime".equals(patternKey)) {
- return DateTimeFormat.getLongDateTimeFormat().getPattern();
- }
-
- if ("mediumDateTime".equals(patternKey)) {
- return DateTimeFormat.getMediumDateTimeFormat().getPattern();
- }
-
- if ("shortDateTime".equals(patternKey)) {
- return DateTimeFormat.getShortDateTimeFormat().getPattern();
- }
-
- // Date only
- if ("fullDate".equals(patternKey)) {
- return DateTimeFormat.getFullDateFormat().getPattern();
- }
-
- if ("longDate".equals(patternKey)) {
- return DateTimeFormat.getLongDateFormat().getPattern();
- }
-
- if ("mediumDate".equals(patternKey)) {
- return DateTimeFormat.getMediumDateFormat().getPattern();
- }
-
- if ("shortDate".equals(patternKey)) {
- return DateTimeFormat.getShortDateFormat().getPattern();
- }
-
- // Time only
- if ("fullTime".equals(patternKey)) {
- return DateTimeFormat.getFullTimeFormat().getPattern();
- }
-
- if ("longTime".equals(patternKey)) {
- return DateTimeFormat.getLongTimeFormat().getPattern();
- }
-
- if ("mediumTime".equals(patternKey)) {
- return DateTimeFormat.getMediumTimeFormat().getPattern();
- }
-
- if ("shortTime".equals(patternKey)) {
- return DateTimeFormat.getShortTimeFormat().getPattern();
- }
-
- throw new IllegalArgumentException("Unknown pattern key '" + patternKey
- + "'");
- }
-
- @Override
- protected void doParseAndRememberPattern(String pattern) {
- activeFormat = DateTimeFormat.getFormat(pattern);
- }
-
- @Override
- protected void doParseInput(String toParse, HasText output, HasText error) {
- error.setText("");
- if (!"".equals(toParse)) {
- try {
- Date x = new Date(toParse);
- String s = activeFormat.format(x);
- output.setText(s);
- } catch (IllegalArgumentException e) {
- String errMsg = constants.failedToParseInput();
- error.setText(errMsg);
- }
- } else {
- output.setText("<None>");
- }
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.java
deleted file mode 100644
index f9accb0..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Messages;
-
-/**
- * Internationalized messages used by {@link MessagesExampleController}.
- */
-public interface ErrorMessages extends Messages {
- @DefaultMessage("User ''{0}'' has security clearance ''{1}'' and cannot access ''{2}''")
- String permissionDenied(String username, String securityClearance,
- String inaccessibleResource);
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.properties
deleted file mode 100644
index 6515cd3..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-
-# This file is not actually used since the annotations are present. This file
-# is left as an example.
-
-permissionDenied = User ''{0}'' has security clearance ''{1}'' and cannot access ''{2}''
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages_fr.properties
deleted file mode 100644
index a8af2e7..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/ErrorMessages_fr.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-
-permissionDenied = L''utilisateur ''{0}'' a un niveau de securité ''{1}'', et ne peut accéder à ''{2}''
-
-
-
\ No newline at end of file
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java
deleted file mode 100644
index bffcf58..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.Dictionary;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * A sample module that demonstrates how to localize text resources.
- */
-public class I18N implements EntryPoint {
-
- /**
- * Attaches logical controllers to various elements on the page. Note that
- * this module is logic only; it assumes the HTML handles all layout and
- * styling.
- *
- * @see com.google.gwt.core.client.EntryPoint#onModuleLoad()
- */
- public void onModuleLoad() {
- // An example that demonstrates NumberFormat.
- NumberFormatExampleConstants numberFormatConstants = GWT.create(NumberFormatExampleConstants.class);
- NumberFormatExampleController numberFormatController = new NumberFormatExampleController(
- numberFormatConstants);
- initNumberFormatExample(numberFormatController);
-
- // An example that demonstrates DateTimeFormat.
- DateTimeFormatExampleConstants dateTimeFormatConstants = GWT.create(DateTimeFormatExampleConstants.class);
- DateTimeFormatExampleController dateTimeFormatController = new DateTimeFormatExampleController(
- dateTimeFormatConstants);
- initDateTimeFormatExample(dateTimeFormatController);
-
- // An example that demonstrates Constants.
- initConstantsExample();
-
- // An example that demonstrates ConstantsWithLookup.
- ConstantsWithLookupExampleConstants constantsWithLookupConstants = GWT.create(ConstantsWithLookupExampleConstants.class);
- ConstantsWithLookupExampleController constantsWithLookupController = new ConstantsWithLookupExampleController(
- constantsWithLookupConstants);
- initConstantsWithLookupExample(constantsWithLookupController);
-
- // An example that demonstrates Messages.
- MessagesExampleConstants messagesExampleConstants = GWT.create(MessagesExampleConstants.class);
- MessagesExampleController messagesController = new MessagesExampleController(
- messagesExampleConstants);
- initMessagesExample(messagesController);
-
- // An example that demonstrates Dictionary.
- initDictionaryExample();
-
- TextBox initiallyFocusedTextBox = numberFormatController.txtInput;
- initiallyFocusedTextBox.setFocus(true);
- initiallyFocusedTextBox.selectAll();
- }
-
- private void bindElement(String id, String text) {
- Element elem = DOM.getElementById(id);
- if (elem == null) {
- throw new NoSuchElementException(id);
- }
- DOM.setInnerText(elem, text);
- }
-
- private void bindElement(String id, Widget widget) {
- RootPanel rp = RootPanel.get(id);
- if (rp == null) {
- throw new NoSuchElementException(id);
- }
- rp.clear();
- rp.add(widget);
- }
-
- private void initConstantsExample() {
- ConstantsExampleConstants constants = GWT.create(ConstantsExampleConstants.class);
- ListBox colorChoices = new ListBox();
-
- for (String color : constants.colorMap().values()) {
- colorChoices.addItem(color);
- }
-
- TextBox txtFirstName = new TextBox();
- TextBox txtLastName = new TextBox();
-
- bindElement("constantsFirstNameCaption", constants.firstName());
- bindElement("constantsFirstNameText", txtFirstName);
- bindElement("constantsLastNameCaption", constants.lastName());
- bindElement("constantsLastNameText", txtLastName);
- bindElement("constantsFavoriteColorCaption", constants.favoriteColor());
- bindElement("constantsFavoriteColorList", colorChoices);
-
- txtFirstName.setText("Amelie");
- txtLastName.setText("Crutcher");
- }
-
- private void initConstantsWithLookupExample(
- ConstantsWithLookupExampleController controller) {
- ConstantsWithLookupExampleConstants constants = controller.getConstants();
- bindElement("constantsWithLookupInputCaption", constants.input());
- bindElement("constantsWithLookupInputText", controller.txtInput);
- bindElement("constantsWithLookupResultsCaption", constants.result());
- bindElement("constantsWithLookupResultsText", controller.txtResult);
- }
-
- private void initDateTimeFormatExample(
- DateTimeFormatExampleController controller) {
- DateTimeFormatExampleConstants constants = controller.getConstants();
- bindElement("dateTimeFormatPatternCaption", constants.pattern());
- bindElement("dateTimeFormatPatternList", controller.lstSamplePatterns);
- bindElement("dateTimeFormatPatternText", controller.txtCurrentPattern);
- bindElement("dateTimeFormatPatternError", controller.lblPatternError);
- bindElement("dateTimeFormatInputCaption", constants.inputValue());
- bindElement("dateTimeFormatInputText", controller.txtInput);
- bindElement("dateTimeFormatInputError", controller.lblParseError);
- bindElement("dateTimeFormatOutputCaption", constants.formattedOutput());
- bindElement("dateTimeFormatOutputText", controller.lblFormattedOutput);
- }
-
- private void initDictionaryExample() {
- FlexTable t = new FlexTable();
- t.setStyleName("i18n-dictionary");
- bindElement("dictionaryExample", t);
-
- Dictionary userInfo = Dictionary.getDictionary("userInfo");
- Iterator<String> s = userInfo.keySet().iterator();
- for (int i = 0; s.hasNext(); i++) {
- String key = s.next();
- t.setText(0, i, key);
- t.setText(1, i, userInfo.get(key));
- }
- t.getRowFormatter().setStyleName(0, "i18n-dictionary-header-row");
- }
-
- private void initMessagesExample(MessagesExampleController controller) {
- MessagesExampleConstants constants = controller.getConstants();
- bindElement("messagesTemplateCaption", constants.messageTemplate());
- bindElement("messagesTemplateText", controller.lblMessageTemplate);
- bindElement("messagesArg1Caption", constants.arg1());
- bindElement("messagesArg1Text", controller.txtArg1);
- bindElement("messagesArg2Caption", constants.arg2());
- bindElement("messagesArg2Text", controller.txtArg2);
- bindElement("messagesArg3Caption", constants.arg3());
- bindElement("messagesArg3Text", controller.txtArg3);
- bindElement("messagesFormattedOutputCaption", constants.formattedMessage());
- bindElement("messagesFormattedOutputText", controller.lblFormattedMessage);
- bindElement("pluralsArg1Caption", constants.arg1());
- bindElement("pluralsArg1Text", controller.pluralCount);
- bindElement("pluralsFormattedOutputCaption", constants.formattedMessage());
- bindElement("pluralsFormattedOutputText", controller.lblPluralMessage);
- }
-
- private void initNumberFormatExample(NumberFormatExampleController controller) {
- NumberFormatExampleConstants constants = controller.getConstants();
- bindElement("numberFormatPatternCaption", constants.pattern());
- bindElement("numberFormatPatternList", controller.lstSamplePatterns);
- bindElement("numberFormatPatternText", controller.txtCurrentPattern);
- bindElement("numberFormatPatternError", controller.lblPatternError);
- bindElement("numberFormatInputCaption", constants.inputValue());
- bindElement("numberFormatInputText", controller.txtInput);
- bindElement("numberFormatInputError", controller.lblParseError);
- bindElement("numberFormatOutputCaption", constants.formattedOutput());
- bindElement("numberFormatOutputText", controller.lblFormattedOutput);
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.java
deleted file mode 100644
index f013c81..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Constants;
-
-/**
- * Internationalized constants used by {@link MessagesExampleController}.
- */
-public interface MessagesExampleConstants extends Constants {
- String arg1();
-
- String arg2();
-
- String arg3();
-
- String formattedMessage();
-
- String messageTemplate();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.properties
deleted file mode 100644
index 1ace2a1..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# 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.
-#
-
-# This file is not actually used since the annotations are present. This file
-# is left as an example.
-
-arg1 = Argument {0}
-
-arg2 = Argument {1}
-
-arg3 = Argument {2}
-
-formattedMessage = Formatted message
-
-messageTemplate = Message template
-
-
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants_fr.properties
deleted file mode 100644
index 41e285b..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleConstants_fr.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-arg1 = Argument {0}
-arg2 = Argument {1}
-arg3 = Argument {2}
-formattedMessage = Message formaté
-messageTemplate = Modèle de message
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleController.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleController.java
deleted file mode 100644
index 7970e12..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/MessagesExampleController.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.TextBox;
-
-/**
- * Demonstrates how to use {@link com.google.gwt.i18n.client.Messages}.
- */
-public class MessagesExampleController {
- private static final ErrorMessages ERRORS = GWT.create(ErrorMessages.class);
- private static final PluralMessages PLURALS = GWT.create(PluralMessages.class);
-
- public final TextBox txtArg1 = new TextBox();
- public final TextBox txtArg2 = new TextBox();
- public final TextBox txtArg3 = new TextBox();
- public final Label lblFormattedMessage = new Label();
- public final Label lblMessageTemplate = new Label();
-
- public final TextBox pluralCount = new TextBox();
- public final Label lblPluralMessage = new Label();
-
- private String prevArg1;
- private String prevArg2;
- private String prevArg3;
- private String prevCount;
- private final MessagesExampleConstants constants;
-
- public MessagesExampleController(MessagesExampleConstants constants) {
- this.constants = constants;
-
- String messageTemplate = ERRORS.permissionDenied("{0}", "{1}", "{2}");
- lblMessageTemplate.setText(messageTemplate);
-
- KeyUpHandler handler = new KeyUpHandler() {
- public void onKeyUp(KeyUpEvent event) {
- maybeRefreshFormattedMessage();
- }
- };
- txtArg1.addKeyUpHandler(handler);
- txtArg2.addKeyUpHandler(handler);
- txtArg3.addKeyUpHandler(handler);
- pluralCount.addKeyUpHandler(handler);
-
- txtArg1.setText("amelie");
- txtArg2.setText("guest");
- txtArg3.setText("/secure/blueprints.xml");
-
- pluralCount.setText("13");
-
- maybeRefreshFormattedMessage();
- }
-
- public MessagesExampleConstants getConstants() {
- return constants;
- }
-
- private void maybeRefreshFormattedMessage() {
- String arg1 = txtArg1.getText().trim();
- String arg2 = txtArg2.getText().trim();
- String arg3 = txtArg3.getText().trim();
-
- // Check if the permission denied message should be regenerated.
- if (!arg1.equals(prevArg1)
- || !arg2.equals(prevArg2)
- || !arg3.equals(prevArg3)) {
- prevArg1 = arg1;
- prevArg2 = arg2;
- prevArg3 = arg3;
-
- String formattedMessage = ERRORS.permissionDenied(arg1, arg2, arg3);
- lblFormattedMessage.setText(formattedMessage);
- }
-
- String count = pluralCount.getText().trim();
-
- // Check if the plurals message should be regenerated.
- if (!count.equals(prevCount) && count.trim().length() > 0) {
- prevCount = count;
-
- try {
- String formattedMessage = PLURALS.treeCount(Integer.valueOf(count));
- lblPluralMessage.setText(formattedMessage);
- } catch (NumberFormatException e) {
- // Ignore bogus numbers
- }
- }
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.java
deleted file mode 100644
index 82f5ed8..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.i18n.client;
-
-import java.util.Map;
-
-/**
- * Internationalized constants used by {@link NumberFormatExampleController}.
- */
-public interface NumberFormatExampleConstants extends
- AbstractFormatExampleConstants {
-
- @DefaultStringMapValue({"decimal", "Decimal", "currency", "Currency", "scientific", "Scientific",
- "percent", "Percent", "custom", "Custom" })
- Map<String, String> numberFormatPatterns();
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.properties
deleted file mode 100644
index 7452306..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# 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.
-#
-
-# This file is not actually used since the annotations are present. This file
-# is left as an example.
-
-decimal = Decimal
-currency = Currency
-scientific = Scientific
-percent = Percent
-custom = Custom
-
-numberFormatPatterns = decimal, currency, scientific, percent, custom
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants_fr.properties
deleted file mode 100644
index 368850a..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleConstants_fr.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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.
-#
-
-decimal = Décimal
-currency = Monétaire
-scientific = Scientifique
-percent = Pourcentage
-custom = Personnalisé
-
-# By default, we will use the key set from our parent. If we wanted to define new keys,
-# we could do so with a line like:
-#numberFormatPatterns = decimal, currency, scientific, percent, custom
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleController.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleController.java
deleted file mode 100644
index 3df5348..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/NumberFormatExampleController.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.NumberFormat;
-import com.google.gwt.user.client.ui.HasText;
-
-/**
- * Demonstrates how to use {@link NumberFormat}.
- */
-public class NumberFormatExampleController extends
- AbstractFormatExampleController {
-
- private static final String DEFAULT_INPUT = "31415926535.897932";
- private NumberFormat activeFormat;
- private final NumberFormatExampleConstants constants;
-
- public NumberFormatExampleController(
- final NumberFormatExampleConstants constants) {
- super(DEFAULT_INPUT, constants.numberFormatPatterns());
- this.constants = constants;
- }
-
- public NumberFormatExampleConstants getConstants() {
- return constants;
- }
-
- @Override
- protected String doGetPattern(String patternKey) {
- if ("currency".equals(patternKey)) {
- return NumberFormat.getCurrencyFormat().getPattern();
- }
-
- if ("decimal".equals(patternKey)) {
- return NumberFormat.getDecimalFormat().getPattern();
- }
-
- if ("scientific".equals(patternKey)) {
- return NumberFormat.getScientificFormat().getPattern();
- }
-
- if ("percent".equals(patternKey)) {
- return NumberFormat.getPercentFormat().getPattern();
- }
-
- throw new IllegalArgumentException("Unknown pattern key '" + patternKey
- + "'");
- }
-
- @Override
- protected void doParseAndRememberPattern(String pattern) {
- activeFormat = NumberFormat.getFormat(pattern);
- }
-
- @Override
- protected void doParseInput(String toParse, HasText output, HasText error) {
- if (!"".equals(toParse)) {
- try {
- double x = Double.parseDouble(toParse);
- String s = activeFormat.format(x);
- output.setText(s);
- } catch (NumberFormatException e) {
- String errMsg = constants.failedToParseInput();
- error.setText(errMsg);
- }
- } else {
- output.setText("<None>");
- }
- }
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages.java
deleted file mode 100644
index 2133fd6..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.i18n.client;
-
-import com.google.gwt.i18n.client.Messages;
-import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
-
-/**
- * Internationalized messages used by {@link MessagesExampleController}.
- * Used to demonstrate plural forms support.
- */
-@DefaultLocale("en")
-public interface PluralMessages extends Messages {
- @DefaultMessage("You have {0} trees.")
- @PluralText({"one", "You have one tree."})
- String treeCount(@PluralCount int count);
-}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages_fr.properties b/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages_fr.properties
deleted file mode 100644
index 494f63d..0000000
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/PluralMessages_fr.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-
-# The default message to use for the message.
-treeCount=Vous avez {0} arbres.
-
-# The message to use for the plural form "one", which in French is applied to counts of 0 or 1.
-treeCount[one]=Vous avez {0} arbre.
-
-
-
\ No newline at end of file
diff --git a/samples/i18n/war/I18N.css b/samples/i18n/war/I18N.css
deleted file mode 100644
index 09e2029..0000000
--- a/samples/i18n/war/I18N.css
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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.
- */
-
-body {
- color: #000000;
- background-color: white;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11pt;
- margin: 20px 0;
- padding: 0;
-}
-
-p {
- margin: 0;
- padding: 0;
-}
-
-h1 {
- margin: 0;
- margin-bottom: 10px;
- padding: 0;
-}
-
-h2 {
- color: #AAAAAA;
- border-bottom: 1px solid #CCCCCC;
-}
-
-h3 {
- color: #AAAAAA;
-}
-
-a {
- color: #FFFFFF;
-}
-
-.code {
- font-family: Courier New;
- font-size: 10pt;
- color: green;
- font-weight: bold;
-}
-
-.intro-background {
- background-color: #2FBB10;
- color: white;
-}
-
-.intro-content {
- padding: 20px 180px;
-}
-
-.gwt-Label {
- display: inline;
-}
-
-.gwt-TextBox {
- color: #000000;
-}
-
-.gwt-TextBox-readonly {
- color: #808080;
-}
-
-.i18n-dictionary {
- font-size: 11pt;
-}
-
-.i18n-dictionary td {
- padding-right: 20px;
-}
-
-.i18n-dictionary-header-row {
- color: green;
- text-decoration: underline;
-}
-
-.i18n-sample {
-
-}
-
-.examples {
- margin: 20px 180px;
-}
-
-.example {
-}
-
-.example p {
- margin: 20px 0;
-}
-
-#numberFormatPatternError,#numberFormatInputError,#dateTimeFormatPatternError,#dateTimeFormatInputError
- {
- font-style: italic;
- color: red;
-}
-
-.example table {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11pt;
-}
-
-.example tr {
- vertical-align: top;
-}
-
-.example table th {
- font-weight: normal;
- text-align: left;
- margin: 2px;
-}
-
-.example table td {
- text-align: left;
-}
-
-.col1 {
- width: 16em;
-}
-
-.col2 {
- width: 32em;
-}
-
-.col2 * {
- width: 100%;
-}
-
-.col3 {
-}
diff --git a/samples/i18n/war/I18N.html b/samples/i18n/war/I18N.html
deleted file mode 100644
index 8bf3f14..0000000
--- a/samples/i18n/war/I18N.html
+++ /dev/null
@@ -1,303 +0,0 @@
-<!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">
-
-<script type="text/javascript" language="javascript">
- // Used by the dictionary example.
- // If you modify this object, the example will reflect your changes.
- var userInfo = {
- name: "Amelie Crutcher",
- timeZone: "EST",
- userID: "123",
- lastLogOn: "2/2/2006"
- };
-</script>
-
-<!-- The following commented-out <meta> element is an alternate way to specify the locale to use -->
-<!-- if the locale is not present in the URL query string.-->
-<!-- <meta name='gwt:property' content='locale=fr'>-->
-<meta name="gwt:property" content="locale=en">
-
-<link rel="stylesheet" type="text/css" href="I18N.css">
-
-<title>Internationalization Sample</title>
-
-<script type="text/javascript" language="javascript"
- src="i18n/i18n.nocache.js"></script>
-
-</head>
-
-<body>
-
-<div class="i18n-sample">
-
- <div class="intro-background">
- <div class="intro-content">
-
- <h1>
- Îñţérñåţîöñåļîžåţîöñ
- Sample
- </h1>
-
- <p>
- This sample shows the use of Google Web Toolkit's internationalization classes.
- In a truly internationalized application, all strings (including
- this one) and styles (including the CSS used to style this page), would also be internationalized.
- Although English is the default language for this sample, it is also localized for French.
- Append <a href="I18N.html?locale=fr">locale=fr</a> to the query string to view the French version.
- </p>
-
- </div>
- </div>
- <noscript>
- <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color:white; border: 1px solid red; padding: 4px; font-family: sans-serif">
- Your web browser must have JavaScript enabled
- in order for this application to display correctly.
- </div>
- </noscript>
-
- <div class="examples">
-
- <div class="numberFormat example">
- <h2>NumberFormat</h2>
- <p>
- Class <code>NumberFormat</code> supports locale-sensitive formatting and parsing of numbers using a flexible pattern-based syntax.
- In addition to custom patterns, several standard patterns are also available for convenience.
- See the GWT class reference for details of the pattern syntax.
- </p>
- <table>
- <tr>
- <th class="col1" id="numberFormatPatternCaption"></th>
- <td class="col2" id="numberFormatPatternList"></td>
- <td class="col3"> </td>
- </tr>
-
- <tr>
- <th class="col1" > </th>
- <td class="col2" id="numberFormatPatternText"></td>
- <td class="col3" id="numberFormatPatternError"> </td>
- </tr>
-
- <tr>
- <th class="col1" id="numberFormatInputCaption"></th>
- <td class="col2" id="numberFormatInputText"></td>
- <td class="col3" id="numberFormatInputError"> </td>
- </tr>
-
- <tr>
- <th class="col1" id="numberFormatOutputCaption"></th>
- <td class="col2" id="numberFormatOutputText"></td>
- <td class="col3"> </td>
- </tr>
- </table>
- </div>
-
- <div class="dateTimeFormat example">
- <h2>DateTimeFormat</h2>
- <p>
- Class <code>DateTimeFormat</code> supports locale-sensitive formatting and parsing of date and time values, like <code>NumberFormat</code>, using a flexible pattern-based syntax.
- Both custom patterns and standard patterns are supported.
- See the GWT class reference for details of the pattern syntax.
- </p>
- <table>
- <tr>
- <th class="col1" id="dateTimeFormatPatternCaption"></th>
- <td class="col2" id="dateTimeFormatPatternList"></td>
- <td class="col3"> </td>
- </tr>
-
- <tr>
- <th class="col1"> </th>
- <td class="col2" id="dateTimeFormatPatternText"></td>
- <td class="col3" id="dateTimeFormatPatternError"> </td>
- </tr>
-
- <tr>
- <th class="col1" id="dateTimeFormatInputCaption"></th>
- <td class="col2" id="dateTimeFormatInputText"></td>
- <td class="col3" id="dateTimeFormatInputError"> </td>
- </tr>
-
- <tr>
- <th class="col1" id="dateTimeFormatOutputCaption"></th>
- <td class="col2" id="dateTimeFormatOutputText"></td>
- <td class="col3"> </td>
- </tr>
- </table>
- </div>
-
- <div class="messages example">
- <h2>Messages</h2>
- <p>
- Interface <code>Messages</code> provides a way to create strongly-typed parameterized messages that are checked for correctness during compilation.
- This example interacts with the sample interface <code>ErrorMessages</code>, defined as follows:
- </p>
- <pre class="code">
-public interface ErrorMessages extends Messages {
- String permissionDenied(
- String username,
- String securityClearance,
- String inaccessibleResource);
-}
- </pre>
- <table>
- <tr>
- <th class="col1" id="messagesTemplateCaption"></th>
- <td class="col2" id="messagesTemplateText"></td>
- </tr>
-
- <tr>
- <th class="col1" id="messagesArg1Caption"></th>
- <td class="col2" id="messagesArg1Text"></td>
- </tr>
-
- <tr>
- <th class="col1" id="messagesArg2Caption"></th>
- <td class="col2" id="messagesArg2Text"></td>
- </tr>
-
- <tr>
- <th class="col1" id="messagesArg3Caption"></th>
- <td class="col2" id="messagesArg3Text"></td>
- </tr>
-
- <tr>
- <th class="col1" id="messagesFormattedOutputCaption"></th>
- <td class="col2" id="messagesFormattedOutputText"></td>
- </tr>
- </table>
- </div>
-
- <div class="plurals example">
- <h3>Plural Forms</h3>
- <p>
- The <code>Messages</code> interface also provides support for plural forms, choosing the
- correct form based on the count. In the example below, note that the English plural forms
- are included in the source file via annotations.
- </p>
- <pre class="code">
-@DefaultLocale("en")
-public interface MyMessages extends Messages {
- @DefaultMessage("You have {0} trees.")
- @PluralText({"one", "You have one tree."})
- String treeCount(@PluralCount int count);
-}
- </pre>
- <table>
- <tr>
- <th class="col1" id="pluralsArg1Caption"></th>
- <td class="col2" id="pluralsArg1Text"></td>
- </tr>
-
- <tr>
- <th class="col1" id="pluralsFormattedOutputCaption"></th>
- <td class="col2" id="pluralsFormattedOutputText"></td>
- </tr>
- </table>
- </div>
-
- <div class="constants example">
- <h2>Constants</h2>
- <p>
- Interface <code>Constants</code> makes it possible to localize strings, numbers, and maps of strings onto strings.
- This example isn't terribly exciting, but it does demonstrate how to localize constants.
- The labels and colors choices below are provided by the localized implementation of the sample interface <code>ConstantsExampleConstants</code>, defined as follows:
- </p>
- <pre class="code">
-public interface ConstantsExampleConstants extends Constants {
- Map colorMap();
- String favoriteColor();
- String firstName();
- String lastName();
-}
- </pre>
- <table>
- <tr>
- <th class="col1" id="constantsFirstNameCaption"></th>
- <td class="col2" id="constantsFirstNameText"></td>
- </tr>
-
- <tr>
- <th class="col1" id="constantsLastNameCaption"></th>
- <td class="col2" id="constantsLastNameText"></td>
- </tr>
-
- <tr>
- <th class="col1" id="constantsFavoriteColorCaption"></th>
- <td class="col2" id="constantsFavoriteColorList"></td>
- </tr>
- </table>
- </div>
-
- <div class="constantsWithLookup example">
- <h2>ConstantsWithLookup</h2>
- <p>
- Interface <code>ConstantsWithLookup</code> makes it possible to dynamically look up localized values using method names as string keys.
- This example interacts with the sample interface <code>Colors</code>, defined as follows:
- </p>
- <pre class="code">
-public interface ColorConstants extends ConstantsWithLookup {
- String black();
- String blue();
- String green();
- String grey();
- String lightGrey();
- String red();
- String white();
- String yellow();
-}
- </pre>
- <table>
- <tr>
- <th class="col1" id="constantsWithLookupInputCaption"></th>
- <td class="col2" id="constantsWithLookupInputText"></td>
- </tr>
-
- <tr>
- <th class="col1" id="constantsWithLookupResultsCaption"></th>
- <td class="col2" id="constantsWithLookupResultsText"></td>
- </tr>
- </table>
- </div>
-
- <div class="dictionary example">
- <h2>Dictionary</h2>
- <p>
- Using the <code>Dictionary</code> class, you can lookup localized values within JavaScript objects defined in the host HTML page rather than compiling them into your GWT code.
- This is useful if your translations change frequently, because your HTML server can emit updated translations into the host page HTML as often as needed.
- It can also a useful way to integrate a GWT module with existing localized web applications.
- Note that a dictionary's values depend only on the host page HTML and are not influenced by the GWT <code>locale</code> client property.
- For this example, the JavaScript variable declaration appears in the source for this HTML page. It looks like this:
- </p>
- <pre class="code">
-var userInfo = {
- name: "Amelie Crutcher",
- timeZone: "EST",
- userID: "123",
- lastLogOn: "2/2/2006"
-};
- </pre>
- <div id="dictionaryExample"></div>
- </div>
-
- </div> <!-- examples -->
-
-</div> <!-- i18n-samples -->
-
-</body>
-</html>
diff --git a/samples/i18n/war/WEB-INF/classes/marker b/samples/i18n/war/WEB-INF/classes/marker
deleted file mode 100644
index e69de29..0000000
--- a/samples/i18n/war/WEB-INF/classes/marker
+++ /dev/null
diff --git a/samples/i18n/war/WEB-INF/web.xml b/samples/i18n/war/WEB-INF/web.xml
deleted file mode 100644
index 113189a..0000000
--- a/samples/i18n/war/WEB-INF/web.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app>
-
- <!-- Default page to serve -->
- <welcome-file-list>
- <welcome-file>I18N.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
diff --git a/samples/i18n/war/favicon.ico b/samples/i18n/war/favicon.ico
deleted file mode 100644
index d7ccc73..0000000
--- a/samples/i18n/war/favicon.ico
+++ /dev/null
Binary files differ