Author: [email protected]
Date: Wed Mar 25 19:12:25 2009
New Revision: 5083

Added:
    trunk/user/src/com/google/gwt/resources/   (props changed)
       - copied from r5074,  
/changes/bobv/clientbundle/user/src/com/google/gwt/resources/
    trunk/user/src/com/google/gwt/user/rebind/StringSourceWriter.java
       - copied unchanged from r5074,  
/changes/bobv/clientbundle/user/src/com/google/gwt/user/rebind/StringSourceWriter.java
    trunk/user/test/com/google/gwt/resources/   (props changed)
       - copied from r5074,  
/changes/bobv/clientbundle/user/test/com/google/gwt/resources/
Modified:
    trunk/common.ant.xml
    trunk/dev/core/src/com/google/gwt/core/ext/Generator.java
    trunk/eclipse/user/.classpath
    trunk/user/build.xml
    trunk/user/src/com/google/gwt/resources/Resources.gwt.xml
     
trunk/user/src/com/google/gwt/resources/client/ClientBundleWithLookup.java
    trunk/user/src/com/google/gwt/resources/client/CssResource.java
    trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java

Log:
Initial add of ClientBundle.

Patch by: bobv
Review by: jgw, rjrjr, ecc


Modified: trunk/common.ant.xml
==============================================================================
--- trunk/common.ant.xml        (original)
+++ trunk/common.ant.xml        Wed Mar 25 19:12:25 2009
@@ -174,6 +174,8 @@
            <pathelement location="${gwt.dev.staging.jar}" />
            <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
            <pathelement  
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+          <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+          <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar"  
/>
            <extraclasspaths />
          </classpath>


Modified: trunk/dev/core/src/com/google/gwt/core/ext/Generator.java
==============================================================================
--- trunk/dev/core/src/com/google/gwt/core/ext/Generator.java   (original)
+++ trunk/dev/core/src/com/google/gwt/core/ext/Generator.java   Wed Mar 25  
19:12:25 2009
@@ -31,6 +31,7 @@
      int extra = 0;
      for (int in = 0, n = unescaped.length(); in < n; ++in) {
        switch (unescaped.charAt(in)) {
+        case '\0':
          case '\n':
          case '\r':
          case '\"':
@@ -49,6 +50,10 @@
      for (int in = 0, out = 0, n = oldChars.length; in < n; ++in, ++out) {
        char c = oldChars[in];
        switch (c) {
+        case '\0':
+          newChars[out++] = '\\';
+          c = '0';
+          break;
          case '\n':
            newChars[out++] = '\\';
            c = 'n';

Modified: trunk/eclipse/user/.classpath
==============================================================================
--- trunk/eclipse/user/.classpath       (original)
+++ trunk/eclipse/user/.classpath       Wed Mar 25 19:12:25 2009
@@ -8,6 +8,8 @@
        <classpathentry exported="true" kind="var"  
path="GWT_TOOLS/lib/junit/junit-3.8.1.jar"  
sourcepath="/GWT_TOOLS/lib/junit/junit-3.8.1-src.zip"/>
        <classpathentry exported="true" kind="var"  
path="GWT_TOOLS/lib/tomcat/servlet-api-2.5.jar"/>
        <classpathentry kind="var"  
path="GWT_TOOLS/lib/selenium/selenium-java-client-driver.jar"/>
+       <classpathentry kind="var" path="GWT_TOOLS/lib/w3c/sac/sac-1.3.jar"/>
+       <classpathentry kind="var" 
path="GWT_TOOLS/lib/w3c/flute/flute-1.3.jar"/>
        <classpathentry combineaccessrules="false" kind="src"  
path="/gwt-dev-windows"/>
        <classpathentry kind="output" path="bin"/>
  </classpath>

Modified: trunk/user/build.xml
==============================================================================
--- trunk/user/build.xml        (original)
+++ trunk/user/build.xml        Wed Mar 25 19:12:25 2009
@@ -35,6 +35,8 @@
          <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
          <pathelement  
location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
          <pathelement  
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+        <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+        <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
          <pathelement location="${gwt.dev.jar}" />
        </classpath>
      </gwt.javac>
@@ -73,6 +75,8 @@
        <fileset dir="super" excludes="**/package.html" />
        <fileset dir="${javac.out}" />
        <zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
+      <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+      <zipfileset src="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
      </gwt.jar>
    </target>


Modified: trunk/user/src/com/google/gwt/resources/Resources.gwt.xml
==============================================================================
---  
/changes/bobv/clientbundle/user/src/com/google/gwt/resources/Resources.gwt.xml  
 
(original)
+++ trunk/user/src/com/google/gwt/resources/Resources.gwt.xml   Wed Mar 25  
19:12:25 2009
@@ -59,16 +59,16 @@
    <set-configuration-property name="ClientBundle.enableRenaming"  
value="true" />

    <!-- This allows merging of CSS rules to be disabled. -->
-  <set-configuration-property name="CssResource.enableMerge" value="true"  
/>
+  <set-configuration-property name="CssResource.mergeEnabled" value="true"  
/>

    <!-- This forces all CssResource accessor functions to have the @Strict  
-->
    <!-- annotation. This is intended primarily for application developers  
and -->
    <!-- the library test code. -->
-  <set-configuration-property name="CssResource.forceStrict" value="false"  
/>
+  <set-configuration-property name="CssResource.strictAccessors"  
value="false" />

    <!-- This allows the developer to use shorter obfuscated class names. -->
    <!-- Is is valid to extend this property to use a custom name. -->
-  <set-configuration-property name="CssResource.globalPrefix"  
value="default" />
+  <set-configuration-property name="CssResource.obfuscationPrefix"  
value="default" />

    <!-- This can be used to make CssResource produce human-readable CSS -->
    <set-configuration-property name="CssResource.style" value="obf" />

Modified:  
trunk/user/src/com/google/gwt/resources/client/ClientBundleWithLookup.java
==============================================================================
---  
/changes/bobv/clientbundle/user/src/com/google/gwt/resources/client/ClientBundleWithLookup.java
  
(original)
+++  
trunk/user/src/com/google/gwt/resources/client/ClientBundleWithLookup.java      
 
Wed Mar 25 19:12:25 2009
@@ -17,7 +17,9 @@

  /**
   * This is an extension of ClientBundle that allows for name-based lookup  
of
- * resources.
+ * resources. Note that the use of the methods defined within this  
interface
+ * will prevent the compiler from pruning any of the resources declared in  
the
+ * ClientBundle.
   */
  public interface ClientBundleWithLookup extends ClientBundle {


Modified: trunk/user/src/com/google/gwt/resources/client/CssResource.java
==============================================================================
---  
/changes/bobv/clientbundle/user/src/com/google/gwt/resources/client/CssResource.java
     
(original)
+++ trunk/user/src/com/google/gwt/resources/client/CssResource.java     Wed Mar 
 
25 19:12:25 2009
@@ -77,7 +77,14 @@
   * substitute the value of a sequence of named zero-arg function  
invocations. An
   * optional suffix will be appended to the return value of the function.  
The
   * first name is resolved relative to the bundle interface passed to
- * {...@link com.google.gwt.core.client.GWT#create(Class)}.</li>
+ * {...@link com.google.gwt.core.client.GWT#create(Class)}. An example:
+ *
+ * <pre>
+ * .bordersTheSizeOfAnImage {
+ *   border-left: value('leftBorderImageResource.getWidth', 'px') solid  
blue;
+ * }
+ * </pre>
+ * </li>
   * </ul>
   *
   * @see <a
@@ -94,9 +101,10 @@
     * <pre>
     * .some-non-java-ident { background: blue; }
     *
-   * interface MyCssResource extends CssResource { {...@literal  
@}ClassName("some-non-java-ident") String classAccessor();
+   * interface MyCssResource extends CssResource {
+   *   {...@literal @}ClassName("some-non-java-ident")
+   *   String classAccessor();
     * }
-   *
     * </pre>
     */
    @Documented
@@ -131,6 +139,8 @@
     * }
     *
     * my.css:
+   * // Now I can refer to these classes defined elsewhere with no
+   * // fear of name collisions
     * .some-prefix-widget .other-import-widget {...}
     * </pre>
     *

Modified:  
trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java
==============================================================================
---  
/changes/bobv/clientbundle/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java
        
(original)
+++ trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java        
 
Wed Mar 25 19:12:25 2009
@@ -1230,7 +1230,7 @@
        try {
          PropertyOracle propertyOracle =  
context.getGeneratorContext().getPropertyOracle();
          String propertyValue = propertyOracle.getPropertyValue(logger,
-            "CssResource.forceStrict");
+            "CssResource.strictAccessors");
          if (Boolean.valueOf(propertyValue)) {
            logger.log(TreeLogger.WARN, "CssResource.forceStrict is true,  
but "
                + method.getName() + "() is missing the @Strict  
annotation.");
@@ -1269,11 +1269,11 @@
        prettyOutput = style.equals("pretty");

        String merge = propertyOracle.getPropertyValue(logger,
-          "CssResource.enableMerge").toLowerCase();
+          "CssResource.mergeEnabled").toLowerCase();
        enableMerge = merge.equals("true");

        classPrefix = propertyOracle.getPropertyValue(logger,
-          "CssResource.globalPrefix");
+          "CssResource.obfuscationPrefix");
      } catch (BadPropertyValueException e) {
        logger.log(TreeLogger.WARN, "Unable to query module property", e);
        throw new UnableToCompleteException();

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

Reply via email to