Re: [gwt-contrib] Re: Help getting super dev mode to work

2012-07-25 Thread Stefano Ciccarelli
Try browsing to http://127.0.0.1:/Application.html instead of 
http://127.0.0.1:/Application.html?gwt.codesvr=127.0.0.1:9997  


--  
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno lunedì 23 luglio 2012, alle ore 10:20, Thomas Käfer ha scritto:  

> Did I understand the procedure correctly?
>  
> 1.) add those properties to your Application.gwt.xml file
> 2.) run the super dev mode, wait until compiled and "The code server is 
> ready. Next, visit: http://localhost:9876/"; is showing
> 3.) run the normal dev mode
> 4.) browse http://127.0.0.1:/Application.html?gwt.codesvr=127.0.0.1:9997 
> and press the bookmarklet "Dev Mode On"
>  
> --> this procedure gives me
> "Can't find any GWT Modules on this page."
>  
> Best Regards,
> Thomas.
>  
> Am Sonntag, 17. Juni 2012 16:57:48 UTC+2 schrieb Daniel Kurka:
> > I can`t seem to get super dev mode to work.  
> >  
> > I am always "Can't find any GWT Modules on this page.", due to  
> > window.__gwt_activeModules being undefined.  
> >  
> > The super dev mode code server compiled fine. I have got the  
> > bookmarklets. I compiled my GWT app the standard way and I am able to  
> > run it in the browser, but still window.__gwt_activeModules is  
> > undefined. What am I missing? Who is supposted to set that variable?  
> >  
> > -Daniel  
> >  
> >  
> --  
> http://groups.google.com/group/Google-Web-Toolkit-Contributors  

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

[gwt-contrib] Re: Fix JSON escaping of unicode characters to work in JDK 7. (issue1796803)

2012-07-25 Thread jat

LGTM

http://gwt-code-reviews.appspot.com/1796803/

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


[gwt-contrib] Fix JSON escaping of unicode characters to work in JDK 7. (issue1796803)

2012-07-25 Thread skybrian

Reviewers: acleung,

Description:
Fix JSON escaping of unicode characters to work in JDK 7.

JDK 7 supports Unicode 6 and some characters changed:
- zero-width-space is no longer a whitespace character
- invisible-plus is new

This caused JSON encoding tests to fail in HTMLUnit somehow, so
escape these characters just to be safe.

Fixes issue 7444.


Please review this at http://gwt-code-reviews.appspot.com/1796803/

Affected files:
  M user/src/com/google/gwt/core/client/JsonUtils.java


Index: user/src/com/google/gwt/core/client/JsonUtils.java
===
--- user/src/com/google/gwt/core/client/JsonUtils.java  (revision 11175)
+++ user/src/com/google/gwt/core/client/JsonUtils.java  (working copy)
@@ -28,7 +28,7 @@
* eval(). Control characters, quotes and backslashes are not affected.
*/
   public static native String escapeJsonForEval(String toEscape) /*-{
-var s =  
toEscape.replace(/[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202e\u2060-\u2063\u206a-\u206f\ufeff\ufff9-\ufffb]/g,  
function(x) {
+var s =  
toEscape.replace(/[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]/g,  
function(x) {
   return  
@com.google.gwt.core.client.JsonUtils::escapeChar(Ljava/lang/String;)(x);

 });
 return s;
@@ -38,7 +38,7 @@
* Returns a quoted, escaped JSON String.
*/
   public static native String escapeValue(String toEscape) /*-{
-var s =  
toEscape.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202e\u2060-\u2063\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g,  
function(x) {
+var s =  
toEscape.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g,  
function(x) {
   return  
@com.google.gwt.core.client.JsonUtils::escapeChar(Ljava/lang/String;)(x);

 });
 return "\"" + s + "\"";
@@ -149,6 +149,7 @@
 out[0x70f] = '\\u070f'; // Syriac abbreviation mark
 out[0x17b4] = '\\u17b4'; // Khmer vowel inherent aq
 out[0x17b5] = '\\u17b5'; // Khmer vowel inherent aa
+out[0x200b] = '\\u200b'; // Zero width space
 out[0x200c] = '\\u200c'; // Zero width non-joiner
 out[0x200d] = '\\u200d'; // Zero width joiner
 out[0x200e] = '\\u200e'; // Left-to-right mark
@@ -164,6 +165,7 @@
 out[0x2061] = '\\u2061'; // Function application
 out[0x2062] = '\\u2062'; // Invisible times
 out[0x2063] = '\\u2063'; // Invisible separator
+out[0x2064] = '\\u2064'; // Invisible plus
 out[0x206a] = '\\u206a'; // Inhibit symmetric swapping
 out[0x206b] = '\\u206b'; // Activate symmetric swapping
 out[0x206c] = '\\u206c'; // Inherent Arabic form shaping


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


[gwt-contrib] Fix CssObfuscationStyle to escape "stable-shorttype" types, so it works for cases like MyClientB... (issue1795803)

2012-07-25 Thread ehwang

Reviewers: unnurg,

Description:
Fix CssObfuscationStyle to escape "stable-shorttype" types, so it works
for cases like MyClientBundle.MyCssResource#selector().


Please review this at http://gwt-code-reviews.appspot.com/1795803/

Affected files:
  M user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java


Index: user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java
===
--- user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java	(revision  
11162)
+++ user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java	(working  
copy)

@@ -68,9 +68,9 @@
  */
 if (showClassName) {
   if (showPackageName) {
-toReturn = type.getQualifiedSourceName().replaceAll("[.$]", "-")  
+ "-" + toReturn;
+toReturn = getPrettyCssClass(type.getQualifiedSourceName(),  
toReturn);

   } else {
-toReturn = type.getName() + "-" + toReturn;
+toReturn = getPrettyCssClass(type.getName(), toReturn);
   }
 }

@@ -88,4 +88,8 @@
   public boolean isPretty() {
 return isPretty;
   }
+
+  private static String getPrettyCssClass(String typeName, String  
cssClass) {

+return typeName.replaceAll("[.$]", "-") + "-" + cssClass;
+  }
 }


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


[gwt-contrib] Re: Help getting super dev mode to work

2012-07-25 Thread Thomas Käfer
Did I understand the procedure correctly?

1.) add those properties to your Application.gwt.xml file
2.) run the super dev mode, wait until compiled and "The code server is 
ready. Next, visit: http://localhost:9876/"; is showing
3.) run the normal dev mode
4.) 
browse http://127.0.0.1:/Application.html?gwt.codesvr=127.0.0.1:9997 
and press the bookmarklet "Dev Mode On"

--> this procedure gives me
"Can't find any GWT Modules on this page."

Best Regards,
Thomas.

Am Sonntag, 17. Juni 2012 16:57:48 UTC+2 schrieb Daniel Kurka:
>
> I can`t seem to get super dev mode to work. 
>
> I am always "Can't find any GWT Modules on this page.", due to 
> window.__gwt_activeModules being undefined. 
>
> The super dev mode code server compiled fine. I have got the 
> bookmarklets. I compiled my GWT app the standard way and I am able to 
> run it in the browser, but still window.__gwt_activeModules is 
> undefined. What am I missing? Who is supposted to set that variable? 
>
> -Daniel 
>
>
>

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

[gwt-contrib] Re: Added Aria roles and properties to the CellTree (issue1776803)

2012-07-25 Thread john . labanca

When the user navigates the tree using keyboard selection, sometimes you
want to update the SelectionModel as they navigate, but other times you
want to wait until they press enter.  For example, if the tree is
serving as a left nav menu, you probably don't want to switch screens in
the content area every time the user presses the down arrow on the
keyboard.  At the least, it might be expensive or slow to select a new
object.  With KeyboardSelectionPolicy.ENABLED, the user can move around
the tree without updating selection.

I agree with Brian that the aria role should match the tree CSS, so it
should go in keyboardSelected().

As far as issue 7480, it sounds like a bug.  Updating the SelectionModel
should update the CellTree's keyboard selection.

http://gwt-code-reviews.appspot.com/1776803/

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


[gwt-contrib] Re: Fix TestOracleMediatorFromByteCodeTest to work when run on JDK 7. (issue1794804)

2012-07-25 Thread cromwellian

lgtm

http://gwt-code-reviews.appspot.com/1794804/

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


[gwt-contrib] Fix TestOracleMediatorFromByteCodeTest to work when run on JDK 7. (issue1794804)

2012-07-25 Thread skybrian

Reviewers: cromwellian,

Description:
Fix TestOracleMediatorFromByteCodeTest to work when run on JDK 7.
The issue is that java.lang.Throwable has nested classes in JDK 7 but
not JDK 6.
So, change the assertion to allow any nested classes.


Please review this at http://gwt-code-reviews.appspot.com/1794804/

Affected files:
  M dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTestBase.java


Index:  
dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTestBase.java

===
--- dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTestBase.java	 
(revision 11175)
+++ dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTestBase.java	 
(working copy)

@@ -73,6 +73,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
@@ -1168,8 +1169,8 @@
 addTestResource(CU_Throwable);
 addTestResource(CU_MethodsAndParams);
 buildTypeOracle();
-JClassType[] types = typeOracle.getTypes();
-assertEquals(3, types.length);
+// Throwable has nested classes in JDK 7, so we need to ignore them
+checkGetTypes("Methods", "Object", "Throwable");
   }

   public void testOuterInner() throws TypeOracleException {
@@ -1313,6 +1314,26 @@
 }
   }

+  private void checkGetTypes(String... expectedOuterClassNames) {
+Set expected = new HashSet();
+expected.addAll(Arrays.asList(expectedOuterClassNames));
+
+Set found = new HashSet();
+
+for (JClassType type : typeOracle.getTypes()) {
+  String name = type.getName();
+  if (name.indexOf('.') > 0) {
+name = name.substring(0, name.indexOf('.'));
+  }
+  if (!expected.contains(name)) {
+fail("getTypes() returned an unexpected class: " + type.getName());
+  }
+  found.add(name);
+}
+
+assertEquals(expected, found);
+  }
+
   private void register(String qualifiedTypeName, CheckedJavaResource cup)  
{

 assertFalse(publicTypeNameToTestCupMap.containsKey(qualifiedTypeName));
 publicTypeNameToTestCupMap.put(qualifiedTypeName, cup);


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


[gwt-contrib] Re: Added Aria roles and properties to the CellTree (issue1776803)

2012-07-25 Thread skybrian

Thanks John.

On 2012/07/25 22:42:13, john.labanca wrote:

As far as issue 7480, it sounds like a bug.  Updating the

SelectionModel should

update the CellTree's keyboard selection.


Well, the question is how to do this. I assume we install a
SelectionChangeHandler. However, we don't know how many SelectionModels
there are: one for the whole tree, or one for each parent? It's also
unclear how we know which cells to re-render after a
SelectionChangeEvent. I don't see any callbacks in CellTree or CellTable
so I'm not sure how the DOM gets updated after a selection state change.


http://gwt-code-reviews.appspot.com/1776803/

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


[gwt-contrib] Allows UiRenderer styles before the first call to render() (issue1794803)

2012-07-25 Thread rchandia

Reviewers: rdayal,

Description:
Allows UiRenderer styles before the first call to render()

Fields are initialized both upon construction and on a call to render()

Also ensured that ui:with fields never get optimized as final.


Please review this at http://gwt-code-reviews.appspot.com/1794803/

Affected files:
  M user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
  M user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
  M user/test/com/google/gwt/uibinder/test/client/UiRendererTest.java
  M user/test/com/google/gwt/uibinder/test/client/UiRendererUi.java
  M user/test/com/google/gwt/uibinder/test/client/UiRendererUi.ui.xml


Index: user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
===
--- user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java	(revision  
11175)
+++ user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java	(working  
copy)

@@ -394,7 +394,7 @@

 fieldWriter = fieldManager.registerField(
 FieldWriterType.IMPORTED, matchingResourceType.getErasedType(),  
resourceName);
-fieldWriter.setInitializer(UiBinderWriter.RENDER_PARAM_HOLDER_PREFIX +  
resourceName);

+fieldWriter.setInitializer(resourceName);
   }

   private void createSingleImport(XMLElement elem, JClassType  
enclosingType,

Index: user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
===
--- user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java	(revision  
11175)
+++ user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java	(working  
copy)

@@ -76,8 +76,6 @@
  */
 public class UiBinderWriter implements Statements {

-  static final String RENDER_PARAM_HOLDER_PREFIX  
= "_renderer_param_holder_";

-
   private static final String SAFE_VAR_PREFIX =
 "somethingUnlikelyToCollideWithParamNamesWefio";

@@ -1935,8 +1933,30 @@
 w.newline();

 JParameter[] renderParameters = findRenderParameters(baseClass);
-
-writeRenderParameterDefinitions(w, renderParameters);
+for (JParameter param : renderParameters) {
+  // Prevent fields related to parameters from being optimized as  
having

+  // static values.
+  fieldManager.convertFieldToGetter(param.getName());
+  fieldManager.convertFieldToGetter(param.getName());
+}
+
+// public UiRendererImplClass() {
+w.write("public %s() {", implClassName);
+w.indent();
+w.write("build_fields();");
+w.outdent();
+// }
+w.write("}");
+w.newline();
+
+// private init_fields() {
+w.write("private void build_fields() {", implClassName);
+w.indent();
+fieldManager.initializeWidgetsInnerClass(w, getOwnerClass());
+w.outdent();
+// }
+w.write("}");
+w.newline();

 String renderParameterDeclarations =  
renderMethodParameters(renderParameters);
 w.write("public void render(final %s sb%s%s) {",  
SafeHtmlBuilder.class.getName(),

@@ -1949,7 +1969,7 @@
 w.write("uiId =  
com.google.gwt.dom.client.Document.get().createUniqueId();");

 w.newline();

-fieldManager.initializeWidgetsInnerClass(w, getOwnerClass());
+w.write("build_fields();");
 w.newline();

 String safeHtml = rootField.getSafeHtml();
@@ -2245,20 +2265,13 @@
 }
   }

-  private void writeRenderParameterDefinitions(IndentedWriter w,  
JParameter[] renderParameters) {

-for (int i = 0; i < renderParameters.length; i++) {
-  JParameter parameter = renderParameters[i];
-  w.write("private %s %s%s;",  
parameter.getType().getQualifiedSourceName(),

-  RENDER_PARAM_HOLDER_PREFIX, parameter.getName());
-  w.newline();
-}
-  }
-
   private void writeRenderParameterInitializers(IndentedWriter w,  
JParameter[] renderParameters) {

 for (int i = 0; i < renderParameters.length; i++) {
   JParameter parameter = renderParameters[i];
-  w.write("%s%s = %s;", RENDER_PARAM_HOLDER_PREFIX,  
parameter.getName(), parameter.getName());

-  w.newline();
+  if (fieldManager.lookup(parameter.getName()) != null) {
+w.write("this.%s = %s;", parameter.getName(), parameter.getName());
+w.newline();
+  }
 }
   }

Index: user/test/com/google/gwt/uibinder/test/client/UiRendererTest.java
===
--- user/test/com/google/gwt/uibinder/test/client/UiRendererTest.java	 
(revision 11175)
+++ user/test/com/google/gwt/uibinder/test/client/UiRendererTest.java	 
(working copy)

@@ -256,6 +256,12 @@
 assertEquals(renderer.getUiStyle().disabled(),  
nameSpan.getClassName());

   }

+  public void testGetStyleBeforeRender() {
+HtmlRenderer renderer = GWT.create(HtmlRenderer.class);
+assertNotNull(renderer.getUiStyle().enabled());
+assertNotNull(renderer.getUiStyle2().ok());
+  }
+
   @Override
   protected void gwtTearDown() {
 docDiv.removeFromParent();
Index: user/test/com/google/gwt/uibinder/test/client/UiRende

[gwt-contrib] Re: Fixes issue 6653: Activity interface should use the new EventBus (issue1786804)

2012-07-25 Thread t . broyer

On 2012/07/25 10:01:17, manolo.carrasco wrote:

> A bit of "discipline" maybe, but no pain at all (not for me at

least).


You are right s/pain/discipline/.



When you use gin for places and activities you have to be aware of

this

circumstance to avoid  multiple instances of the event bus, so you

have to write

a bit more code


Huh!
How about simply letting the GIN generation fail if some class depends
on the gwt.event EventBus rather than the web.bindery one? (EventBus
being abstract, GIN won't be able to instantiate it and will defer to
GWT.create(), which will fail too).

Put simply: do not ever, never use com.google.gwt.event.shared.EventBus
in your code and it'll Just Work™; and if you do, it should fail.

BTW, you code can be simplified to:

   bind(com.google.web.bindery.event.shared.EventBus.class)
  .to(com.google.gwt.event.shared.SimpleEventBus.class);
   bind(com.google.gwt.event.shared.EventBus.class)
  .to(com.google.gwt.event.shared.SimpleEventBus.class);
   bind(com.google.gwt.event.shared.SimpleEventBus.class)
  .in(Singleton.class);

(you want the SimpleEventBus as a singleton, not each one of the
EventBus-es, which is what your "code that doesn't work" was declaring)

But it's not really the place to discuss this ;-)

http://gwt-code-reviews.appspot.com/1786804/

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


[gwt-contrib] Re: Fixes issue 6653: Activity interface should use the new EventBus (issue1786804)

2012-07-25 Thread manuel . carrasco . m



A bit of "discipline" maybe, but no pain at all (not for me at least).


You are right s/pain/discipline/.

When you use gin for places and activities you have to be aware of this
circumstance to avoid  multiple instances of the event bus, so you have
to write a bit more code and replace something eventually simple like
this:

  bind(EventBus.class)
.to(SimpleEventBus.class).in(Singleton.class);

By a provider which maintains a unique instance of the event bus

  bind(com.google.web.bindery.event.shared.EventBus.class)
.toProvider(SingletonEventBusProvider.class);
  bind(com.google.gwt.event.shared.EventBus.class)
.toProvider(SingletonEventBusProvider.class);

  static class SingletonEventBusProvider
   implements Provider {

static com.google.gwt.event.shared.SimpleEventBus eventBus =
new com.google.gwt.event.shared.SimpleEventBus();

public com.google.gwt.event.shared.SimpleEventBus get() {
  return eventBus;
}
  }

Note that this code does not work and would create two event buses
  bind(com.google.gwt.event.shared.EventBus.class)

.to(com.google.gwt.event.shared.SimpleEventBus.class).in(Singleton.class);
  bind(com.google.web.bindery.event.shared.EventBus.class)

.to(com.google.gwt.event.shared.SimpleEventBus.class).in(Singleton.class);

Finally, if you need injector getters for the EventBus you have to
duplicate methods in the Gininjector as well
  com.google.web.bindery.event.shared.EventBus getEventBusNew();
  com.google.gwt.event.shared.EventBus getEventBus();



http://gwt-code-reviews.appspot.com/1786804/

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