Tuesday, January 31, 2017

Unresponsive tabs in Chrome and Safari after upgrading to GWT 2.8

We recently attempted to upgrade to GWT 2.8, but ran into an issue where a small number of users report browser tabs hanging (eventually putting up kill/wait popups) in Chrome 55.0.2883.95 and Safari 10.0.2. Seems to primarily affect Mac users. Going back to GWT 2.7 made the issue go away. We haven't been able to reproduce the issue ourselves, so it doesn't seem to be a general issue. Has anybody experienced anything similar after upgrading?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Monday, January 30, 2017

Re: "unread block data" exception when compiling

Figured it out.  For whatever reason, I mistakenly had gwt-servlet in the pom of the module and that seemed to have caused the inconsistency.   I removed it, and the module loads fine in GWT 2.8.0 with Java 8.




On Monday, January 30, 2017 at 3:27:02 PM UTC-8, Paul Mazzuca wrote:

I have two projects, each work independently using GWT 2.8 with Java 8. When I create a module of one of the projects, and load that module into the other project, I receive the following error.   Any thoughts?  I have cleaned the projects multiple times and rebuilt from scratch. I used to have this working with beta1 compiling with Java 7.


[INFO] com.google.gwt.thirdparty.guava.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: unread block data

[INFO] at com.google.gwt.thirdparty.guava.common.util.concurrent.Futures.wrapAndThrowUnchecked(Futures.java:2060)

[INFO] at com.google.gwt.thirdparty.guava.common.util.concurrent.Futures.getUnchecked(Futures.java:2045)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager.syncReadDiskCache(MinimalRebuildCacheManager.java:264)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager.getCache(MinimalRebuildCacheManager.java:104)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:357)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:175)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:134)

[INFO] at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:135)

[INFO] at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:113)

[INFO] at com.google.gwt.dev.codeserver.JobRunner.access$000(JobRunner.java:37)

[INFO] at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:90)

[INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:266)

[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

[INFO] at java.lang.Thread.run(Thread.java:745)

[INFO] Caused by: java.lang.IllegalStateException: unread block data

[INFO] at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2431)

[INFO] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1383)

[INFO] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)

[INFO] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)

[INFO] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)

[INFO] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)

[INFO] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager$2.call(MinimalRebuildCacheManager.java:176)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager$2.call(MinimalRebuildCacheManager.java:162)

[INFO] ... 4 more

[INFO]       [WARN] continuing to serve previous version


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

"unread block data" exception when compiling

I have two projects, each work independently using GWT 2.8 with Java 8. When I create a module of one of the projects, and load that module into the other project, I receive the following error.   Any thoughts?  I have cleaned the projects multiple times and rebuilt from scratch. I used to have this working with beta1 compiling with Java 7.


[INFO] com.google.gwt.thirdparty.guava.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: unread block data

[INFO] at com.google.gwt.thirdparty.guava.common.util.concurrent.Futures.wrapAndThrowUnchecked(Futures.java:2060)

[INFO] at com.google.gwt.thirdparty.guava.common.util.concurrent.Futures.getUnchecked(Futures.java:2045)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager.syncReadDiskCache(MinimalRebuildCacheManager.java:264)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager.getCache(MinimalRebuildCacheManager.java:104)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:357)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:175)

[INFO] at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:134)

[INFO] at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:135)

[INFO] at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:113)

[INFO] at com.google.gwt.dev.codeserver.JobRunner.access$000(JobRunner.java:37)

[INFO] at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:90)

[INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:266)

[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

[INFO] at java.lang.Thread.run(Thread.java:745)

[INFO] Caused by: java.lang.IllegalStateException: unread block data

[INFO] at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2431)

[INFO] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1383)

[INFO] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)

[INFO] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)

[INFO] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)

[INFO] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)

[INFO] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager$2.call(MinimalRebuildCacheManager.java:176)

[INFO] at com.google.gwt.dev.MinimalRebuildCacheManager$2.call(MinimalRebuildCacheManager.java:162)

[INFO] ... 4 more

[INFO]       [WARN] continuing to serve previous version


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Setting set-property-fallback causing error

Hello, 

I'm trying to simulate googlebot reading my GWT based app.  I've added:  <set-property-fallback name="user.agent" value="safari"/>  to my gwt.xml file but keep getting this error and the app never runs:

Possible problem with your *.gwt.xml module file.
The compile time user.agent value (safari) does not match the runtime user.agent value (unknown).
Expect more errors.
cOf_g$ — ConsoleLogger.java:32
Bif_g$ — SimpleConsoleLogHandler.java:36
Phf_g$ — Logger.java:312
Ohf_g$ — Logger.java:302
kif_g$ — Logger.java:236
DIc_g$ — LogConfiguration.java:169
II_g$ — Impl.java:186
vI_g$ — Impl.java:293
(anonymous function) — Impl.java:77

I'm I doing this correctly? Read the threads and seems like <set-property-fallback name="user.agent" value="safari"/>   should work. Any help would be greatly appreciated.

Jean

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Saturday, January 28, 2017

Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

Hello Jens!

On Saturday, January 28, 2017 at 5:24:56 PM UTC+1, Jens wrote:
  • src/main/java/mylib/general
  • src/main/java/mylib/web
src/main/java/mylib/web.gwt.xml

  <module>
  <inherits name='com.google.gwt.user.User'/>
  <source path='web'/>
 </module> 

That would work, as long as src/main/java/mylib or src/main/java/mylib/general is not exposed to GWT compiler by any other GWT module you might have.

I guess you mean having another *.gwt.xml file that reference some folder under /src/main/java/mylib/general?
 
Its basically the same as with using client, shared and server folder

I already noticed this naming convention, but where is it documented?
 
An alternative approach for library code is to not split the code up into distinct packages like you did but instead use an annotation and then build two different jar's (one that only contains GWT code, and another only containing code incompatible to GWT) by reading the annotation. That is basically the approach Guava uses to build guava.jar and guava-gwt.jar.

Sounds interesting. Where can I read about this?

Thank you
Magnus
 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

doh + excellent

Even more keen to switch our app.

On Saturday, January 28, 2017 at 5:32:15 PM UTC, Thomas Broyer wrote:
Drag and drop is in GWT proper (DropEvent et al)

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

Drag and drop is in GWT proper (DropEvent et al)

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?


I'd start with a new maven project "mylib", which is based on a simple archetype-quickstart maven stub, and I'd add two subfolders under src/main/java/mylib:
  • src/main/java/mylib/general
  • src/main/java/mylib/web
Then, I'd add the following file:

src/main/java/mylib/web.gwt.xml

...with the following content:

  <module>
  <inherits name='com.google.gwt.user.User'/>
  <source path='web'/>
 </module> 

Then, I'd include mylib.general.* for server-side code, and mylib.web.* for GWT-based code.

Would this be the right way?
Could I place server-side only code under general (e. g. database related code) and GWT-based code under web?
(I still feel that the GWT compiler then would "ignore" the code under the general folder, doesn't it?)

That would work, as long as src/main/java/mylib or src/main/java/mylib/general is not exposed to GWT compiler by any other GWT module you might have. With the above only src/main/java/mylib/web would be analyzed and compiled by GWT compiler. Its basically the same as with using client, shared and server folder but the *.gwt.xml only makes the client and shared folder visible to the GWT compiler.

An alternative approach for library code is to not split the code up into distinct packages like you did but instead use an annotation and then build two different jar's (one that only contains GWT code, and another only containing code incompatible to GWT) by reading the annotation. That is basically the approach Guava uses to build guava.jar and guava-gwt.jar.

-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

Hello Thomas,

thank you for all the explanations!
I took a look at gwt-user.jar. It looks very interesting. There are a lot of subfolders, where each one seems to be some sort of micro system, including several subfolrders with the common names ("client", "public", ...) as well as several *.gwt.xml files. I think, I'll look at it again...

However, it's hard for me to derive a minimalistic method for my goal: One maven project with two code bases, one for general java (or server-side) code, and one for GWT-related code.

I'd start with a new maven project "mylib", which is based on a simple archetype-quickstart maven stub, and I'd add two subfolders under src/main/java/mylib:
  • src/main/java/mylib/general
  • src/main/java/mylib/web
Then, I'd add the following file:

src/main/java/mylib/web.gwt.xml

...with the following content:

  <module>
  <inherits name='com.google.gwt.user.User'/>
  <source path='web'/>
 </module> 

Then, I'd include mylib.general.* for server-side code, and mylib.web.* for GWT-based code.

Would this be the right way?
Could I place server-side only code under general (e. g. database related code) and GWT-based code under web?
(I still feel that the GWT compiler then would "ignore" the code under the general folder, doesn't it?)

Thanks
Magnus

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

I'm not aware of any GWT wrappers but the JavaScript is pretty simple (so easy if you are happy with js interop). 

https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API

gwt_dnd is pretty good but even if you have to do the js interop yourself I think the complexity will be similar.

If you don't find off the shelf wrappers I'd be up for helping to come up with something. We have a large gwt_dnd based app that I'd like to move.

On Friday, January 27, 2017 at 11:40:17 PM UTC, Asier wrote:

Hi.

I'm very interested in this approach, but I don't know how to do this. Could you point me to some example application?

Regards.

El 27/01/2017 11:51, salk31 <sal...@gmail.com> escribió:
I'd suggest at least looking into using "native" drag and drop support. I imagine it is much lighter and it supports dragging between windows etc... I think gwt-dnd was created before this was available.

On Monday, January 23, 2017 at 4:54:29 PM UTC, Ani wrote:
HI
 I am working on a Diagram editor with GWT. The requirement is to be able to drag from a palette and draw and connect different shapes.
So using a Canvas component for the drawing part.
 Does GWT have an in built Drag and Drop Framework?

Any help is appreciated

Regards
Ani

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Friday, January 27, 2017

Re: References to Class method works incorrectly

Issue in GWT project https://github.com/gwtproject/gwt/issues/9483

Stas

On Saturday, January 28, 2017 at 8:32:48 AM UTC+1, foal wrote:
Hi,

I have in code the following lines (few of `Panel` classes implements `TagAware` interface):

```Java
private final Map<PanelType, Panel<T>> panels;
//...
panels
.values()
.stream()
.filter(TagAware.class::isInstance)
.map(TagAware.class::cast)
.forEach(t -> t.setTagsWorkHours(this.tagsWorkHours));
```
The code perfectly compile by javac, but not with GWT compiler: 

      Errors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/widget/src/main/java/org/jresearch/gwt/client/date/widget/Calendar.java'
         Line 376: The type Class<TagAware> does not define isInstance(Panel<T>) that is applicable here
         Line 376: The method filter(Predicate<? super Panel<T>>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::isInstance)

The same with cast

      Errors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/widget/src/main/java/org/jresearch/gwt/client/date/widget/Calendar.java'
         Line 377: The method map(Function<? super Panel<T>,? extends R>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::cast)
         Line 377: The type Class<TagAware> does not define cast(Panel<T>) that is applicable here


##### Known workarounds

Rewrite the above lines without method references:

```Java
panels
.values()
.stream()
.filter(p -> p instanceof TagAware)
.map(p -> (TagAware) p)
.forEach(t -> t.setTagsWorkHours(this.tagsWorkHours));
```

Best,
Stas

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

References to Class method works incorrectly

Hi,

I have in code the following lines (few of `Panel` classes implements `TagAware` interface):

```Java
private final Map<PanelType, Panel<T>> panels;
//...
panels
.values()
.stream()
.filter(TagAware.class::isInstance)
.map(TagAware.class::cast)
.forEach(t -> t.setTagsWorkHours(this.tagsWorkHours));
```
The code perfectly compile by javac, but not with GWT compiler: 

      Errors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/widget/src/main/java/org/jresearch/gwt/client/date/widget/Calendar.java'
         Line 376: The type Class<TagAware> does not define isInstance(Panel<T>) that is applicable here
         Line 376: The method filter(Predicate<? super Panel<T>>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::isInstance)

The same with cast

      Errors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/widget/src/main/java/org/jresearch/gwt/client/date/widget/Calendar.java'
         Line 377: The method map(Function<? super Panel<T>,? extends R>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::cast)
         Line 377: The type Class<TagAware> does not define cast(Panel<T>) that is applicable here


##### Known workarounds

Rewrite the above lines without method references:

```Java
panels
.values()
.stream()
.filter(p -> p instanceof TagAware)
.map(p -> (TagAware) p)
.forEach(t -> t.setTagsWorkHours(this.tagsWorkHours));
```

Best,
Stas

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

Hi.

I'm very interested in this approach, but I don't know how to do this. Could you point me to some example application?

Regards.

El 27/01/2017 11:51, salk31 <salk31@gmail.com> escribió:
I'd suggest at least looking into using "native" drag and drop support. I imagine it is much lighter and it supports dragging between windows etc... I think gwt-dnd was created before this was available.

On Monday, January 23, 2017 at 4:54:29 PM UTC, Ani wrote:
HI
 I am working on a Diagram editor with GWT. The requirement is to be able to drag from a palette and draw and connect different shapes.
So using a Canvas component for the drawing part.
 Does GWT have an in built Drag and Drop Framework?

Any help is appreciated

Regards
Ani

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: How to simulate a click for a GWT button using fireEvent

Hello Nantanael,

You have provided GWT Java code. You might have misunderstood.
I wish to fire the event in JavaScript, on the front-end. (The compiled code)

I have no access to the GWT code. I simply want to manipulate the front end (The compiled code)

What I am asking requires knowledge of how the GWT event bus operates in IE8.

On Friday, 27 January 2017 12:49:06 UTC-5, Natanael Clara wrote:

I have use this.

this.getComo().addKeyPressHandler(new KeyPressHandler() {
            @Override
            public void onKeyPress(KeyPressEvent event) {
                int teclado = event.getNativeEvent().getKeyCode();
                if ((teclado == KeyCodes.KEY_ENTER)) {
                    getEntrar().fireEvent(new GwtEvent<ClickHandler>() {
                        @Override
                        protected void dispatch(ClickHandler handler) {
                            handler.onClick(null);
                        }

                        @Override
                        public com.google.gwt.event.shared.GwtEvent.Type<ClickHandler> getAssociatedType() {
                            return ClickEvent.getType();
                        }
                    });

                }
            }
        });


Em 26/01/2017 16:59, Privat escreveu:

I am trying to simulate a mouse click event on GWT (Google Web Toolkit) Application in <=IE8 (using fireEvent, not dispatchEvent)

A sample custom button can be found here: http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCustomButton (The toggle button is easiest to see if the click was processed)


The major boilerplate for simulating the click can be found here: http://stackoverflow.com/a/6158050 (This is where I got the simulate function used below)


I have been able to successfully simulate the click event by using the following commands for IE9+ (in this case simulate used dispatchEvent)


simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mouseover");  simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mousedown");  simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mouseup");    

In my application the fireEvent fails, because GWT's $wnd.event is null. (Line: 117, https://github.com/stephenh/google-web-toolkit/blob/master/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java)


If there is no way to simulate the click with plain JS, then is there a way to use GWT's EventDispatcher to simulate the click?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: How to simulate a click for a GWT button using fireEvent

I have use this.

this.getComo().addKeyPressHandler(new KeyPressHandler() {
            @Override
            public void onKeyPress(KeyPressEvent event) {
                int teclado = event.getNativeEvent().getKeyCode();
                if ((teclado == KeyCodes.KEY_ENTER)) {
                    getEntrar().fireEvent(new GwtEvent<ClickHandler>() {
                        @Override
                        protected void dispatch(ClickHandler handler) {
                            handler.onClick(null);
                        }

                        @Override
                        public com.google.gwt.event.shared.GwtEvent.Type<ClickHandler> getAssociatedType() {
                            return ClickEvent.getType();
                        }
                    });

                }
            }
        });


Em 26/01/2017 16:59, Privat escreveu:

I am trying to simulate a mouse click event on GWT (Google Web Toolkit) Application in <=IE8 (using fireEvent, not dispatchEvent)

A sample custom button can be found here: http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCustomButton (The toggle button is easiest to see if the click was processed)


The major boilerplate for simulating the click can be found here: http://stackoverflow.com/a/6158050 (This is where I got the simulate function used below)


I have been able to successfully simulate the click event by using the following commands for IE9+ (in this case simulate used dispatchEvent)


simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mouseover");  simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mousedown");  simulate(document.getElementById("gwt-debug-cwCustomButton-toggle-normal"), "mouseup");    

In my application the fireEvent fails, because GWT's $wnd.event is null. (Line: 117, https://github.com/stephenh/google-web-toolkit/blob/master/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java)


If there is no way to simulate the click with plain JS, then is there a way to use GWT's EventDispatcher to simulate the click?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

If you are going to use native drag and drop you might what some stream composition lib XD, rxjava makes event plumbing a bit easier, clean and powerful, and rxgwt has various tools to start using rxjava with gwt, see this example using elemental touch events https://github.com/intendia-oss/rxgwt/blob/master/examples/elemental/src/main/java/com/intendia/rxgwt/example/client/ElementalExample.java

On Friday, January 27, 2017 at 11:51:57 AM UTC+1, salk31 wrote:
I'd suggest at least looking into using "native" drag and drop support. I imagine it is much lighter and it supports dragging between windows etc... I think gwt-dnd was created before this was available.

On Monday, January 23, 2017 at 4:54:29 PM UTC, Ani wrote:
HI
 I am working on a Diagram editor with GWT. The requirement is to be able to drag from a palette and draw and connect different shapes.
So using a Canvas component for the drawing part.
 Does GWT have an in built Drag and Drop Framework?

Any help is appreciated

Regards
Ani

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT 2.7: access public static final field in JSNI results as undefined in SuperDevMode

Okay, so I use your suggestion with the private native method. 

We only use the JSNI in some cases where we have to use it. In a bridge to a JavaScript lib for example.
Switching to GWT 2.8 is not possible atm, because I run into some problems and these need to be investigated a first.

Thx a lot,

Norbert

Am Freitag, 27. Januar 2017 11:38:04 UTC+1 schrieb Thomas Broyer:
I would say it's a bug (have you tried in 2.8, maybe it's fixed?).
I'd also say one should try to keep JSNI as small as possible; your method could be rewritten as:
public static void doSomethingWithMarker() {
  nativeDoSomethingWithMarker(SPECIAL_MARKER);
}
private static native void nativeDoSomethingWithMarker(String cm) /*-{
  $wnd.alert(cm);
}-*/;

In legacy devmode, JSNI boundaries used to be a performance issue, but this is no longer the case with SuperDevMode, so there's no reason to write big JSNI methods (or even JSNI at all: use JsInterop; there are still a few cases that need JSNI, but one can do almost everything with JsInterop nowadays).

On Friday, January 27, 2017 at 11:23:35 AM UTC+1, Norbert Bartels wrote:

Hi all,

during development I ran into a problem and I had to dig a bit deeper to find the root cause. Perhaps someone can explain why this happens.

I use GWT 2.7. And I have a class with some constants. For example something like this:

public class MyConstants {      public static final String SPECIAL_MARKER = "marker";    }  

Now I try to use this in a JSNI method in another class, for example in this way:

...    public static native void doSomethingWithMarker() /*-{     var cm = @my.package.MyConstants::SPECIAL_MARKER      $wnd.alert(cm);  }-*/;    ...  

In classic dev mode and in the compiled version this is working. In SuperDevMode cm is undefined.

Now, I remove the final and voila, it even works in SuperDevMode.
So obviously the final is a problem. But why is it working in classic and compiled mode? Is this simply a bug or is there a better way to use such constants?

Cheers,
Norbert

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Drag and Drop in GWT

I'd suggest at least looking into using "native" drag and drop support. I imagine it is much lighter and it supports dragging between windows etc... I think gwt-dnd was created before this was available.

On Monday, January 23, 2017 at 4:54:29 PM UTC, Ani wrote:
HI
 I am working on a Diagram editor with GWT. The requirement is to be able to drag from a palette and draw and connect different shapes.
So using a Canvas component for the drawing part.
 Does GWT have an in built Drag and Drop Framework?

Any help is appreciated

Regards
Ani

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT 2.7: access public static final field in JSNI results as undefined in SuperDevMode

I would say it's a bug (have you tried in 2.8, maybe it's fixed?).
I'd also say one should try to keep JSNI as small as possible; your method could be rewritten as:
public static void doSomethingWithMarker() {
  nativeDoSomethingWithMarker(SPECIAL_MARKER);
}
private static native void nativeDoSomethingWithMarker(String cm) /*-{
  $wnd.alert(cm);
}-*/;

In legacy devmode, JSNI boundaries used to be a performance issue, but this is no longer the case with SuperDevMode, so there's no reason to write big JSNI methods (or even JSNI at all: use JsInterop; there are still a few cases that need JSNI, but one can do almost everything with JsInterop nowadays).

On Friday, January 27, 2017 at 11:23:35 AM UTC+1, Norbert Bartels wrote:

Hi all,

during development I ran into a problem and I had to dig a bit deeper to find the root cause. Perhaps someone can explain why this happens.

I use GWT 2.7. And I have a class with some constants. For example something like this:

public class MyConstants {      public static final String SPECIAL_MARKER = "marker";    }  

Now I try to use this in a JSNI method in another class, for example in this way:

...    public static native void doSomethingWithMarker() /*-{     var cm = @my.package.MyConstants::SPECIAL_MARKER      $wnd.alert(cm);  }-*/;    ...  

In classic dev mode and in the compiled version this is working. In SuperDevMode cm is undefined.

Now, I remove the final and voila, it even works in SuperDevMode.
So obviously the final is a problem. But why is it working in classic and compiled mode? Is this simply a bug or is there a better way to use such constants?

Cheers,
Norbert

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

GWT 2.7: access public static final field in JSNI results as undefined in SuperDevMode

Hi all,

during development I ran into a problem and I had to dig a bit deeper to find the root cause. Perhaps someone can explain why this happens.

I use GWT 2.7. And I have a class with some constants. For example something like this:

public class MyConstants {      public static final String SPECIAL_MARKER = "marker";    }  

Now I try to use this in a JSNI method in another class, for example in this way:

...    public static native void doSomethingWithMarker() /*-{     var cm = @my.package.MyConstants::SPECIAL_MARKER      $wnd.alert(cm);  }-*/;    ...  

In classic dev mode and in the compiled version this is working. In SuperDevMode cm is undefined.

Now, I remove the final and voila, it even works in SuperDevMode.
So obviously the final is a problem. But why is it working in classic and compiled mode? Is this simply a bug or is there a better way to use such constants?

Cheers,
Norbert

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?



On Friday, January 27, 2017 at 4:07:16 AM UTC+1, Magnus wrote:
Hello Thomas,

I solved the actual problem by removing the Maven generated AppTest.java from the src/test/ path.
However, my further plans are concerned by what you mentioned below:

GWT doesn't care about folders, it reads resources from the classpath.
But then I don't really understand the sense of the *.gwt.xml files, which explicitely include source folders.
No, they subset the classpath by defining subpackages, independently of where they come from (and they sort-of superset the classpath with super-source too).
Still, classpath/classloader based, not file/folder based.

This means that the GWT compiler "sees" everything on the classpath, wether some subfolder is included as source code in some *.gwt.xml files or not.

At the moment, I have separate libraries, one for pure Java code and one for GWT-based Java code. I already thought about moving them into one library, where one subfolder contains the GWT-related code.
For this one "GWT-folder", this would mean:
  • Only the GWT-folder must be seen by the GWT-compiler, since the other code may not compile with it.
  • Only for the GWT-folder, the corresponding source code must be included into the library jar file.
Until now I thought I can do that by placing a *.gwt.xml file only for the GWT-folder, so that all other folders are simply not existing from the GWT's point of view.
But if I understand you right, all other folders would be included by the GWT-compiler, too. And I don't want to fix this by having special run configurations for all my applications.
The optimal solution for me would be: Include a single jar in an application project, and have both the pure Java libraries and the GWT-related libraries present in the application.

Can I do this or must I keep the both libraries separated?

You can totally do that, specifically because .gwt.xml files subset the classpath.

Recap:
1. GWT reads from the classpath, it doesn't care where the files "physically" are: this means if your classpath is src/main/java:target/classes:/path/to/gwt-user.jar:/path/to/gwt-dev.jar, you can have target/classes/myapp/MyApp.gwt.xml (in a typical Maven setup, copied there from src/main/resources/myapp/MyAp.gwt.xml) that references src/main/java/myapp/MyApp.java as simply "myapp.MyApp": GWT doesn't care whether that myapp/MyApp.java actually leaves in src/main/java, target/classes, some JAR, etc.
2. gwt.xml files subset the classpath for GWT: by default, a gwt.xml has an implicit <source path="client"/>, so putting a .gwt.xml file in a package and referencing it from another .gwt.xml (or passing it as the input to GWT) will tell GWT to only consider classes (in the form of *.java resources) in the "client" subpackage. A typical setup would put non-GWT classes in a "server" subpackage, and GWT generators into a "rebind" subpackage; GWT will then ignore them because they're not in the "source path" (which only includes the "client" subpackage here).
3. gwt.xml files can also "superset" the classpath by "rerooting" some subpackages, through super-source. If a .gwt.xml contains <super-source path="super"/>, the GWT will behave as if that "super" subpackage was added to the classpath (note that again this is about packages, whereas the classpath is defined in terms of folders and jar files; what that means is that if myapp/MyApp.gwt.xml from the above example had <super-source path="super"/>, then GWT would behave as if the classpath were src/main/java/myapp/super:target/classes/myapp/super:src/main/java:target/classes:<what would be equivalent to selecting myapp/super inside the gwt-user.jar>:/path/to/gwt-user.jar:<what would be equivalent to selecting myapp/super inside the gwt-dev.jar>:/path/to/gwt-dev.jar:<what would be equivalent to selecting the myapp/super inside the gwt-dev.jar> – well actually, the precedence rules are a bit different IIRC, but you get the idea)
4. the <source> and <super-source> (and <public> by the way) can further subset things by using includes="", excludes="" and skip="" attributes, or <include>, <exclude> and <skip> child elements (the difference between exclude and skip: skip means "not in this module, but another module –generally in the same package– could include it", whereas exclude means "never include this, even if another module –generally in the same package– would include it"; of course it only works that way if both modules are <inherited/>)

Have a look inside gwt-user.jar to understand all that: in one JAR there's client-side code, server-side code, shared client/server code, super-source code; and you can find further subsetting (using include/exclude/skip) in some .gwt.xml files in com/google/gwt/user.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Thursday, January 26, 2017

Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

Hello Thomas,

I solved the actual problem by removing the Maven generated AppTest.java from the src/test/ path.
However, my further plans are concerned by what you mentioned below:

GWT doesn't care about folders, it reads resources from the classpath.
But then I don't really understand the sense of the *.gwt.xml files, which explicitely include source folders.
No, they subset the classpath by defining subpackages, independently of where they come from (and they sort-of superset the classpath with super-source too).
Still, classpath/classloader based, not file/folder based.

This means that the GWT compiler "sees" everything on the classpath, wether some subfolder is included as source code in some *.gwt.xml files or not.

At the moment, I have separate libraries, one for pure Java code and one for GWT-based Java code. I already thought about moving them into one library, where one subfolder contains the GWT-related code.
For this one "GWT-folder", this would mean:
  • Only the GWT-folder must be seen by the GWT-compiler, since the other code may not compile with it.
  • Only for the GWT-folder, the corresponding source code must be included into the library jar file.
Until now I thought I can do that by placing a *.gwt.xml file only for the GWT-folder, so that all other folders are simply not existing from the GWT's point of view.
But if I understand you right, all other folders would be included by the GWT-compiler, too. And I don't want to fix this by having special run configurations for all my applications.
The optimal solution for me would be: Include a single jar in an application project, and have both the pure Java libraries and the GWT-related libraries present in the application.

Can I do this or must I keep the both libraries separated?

Thank you very much!
Magnus


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

I know how stupid this will sound, but how do I create a key? What is it? I am not very good with Java code

On Friday, June 13, 2014 at 1:24:14 AM UTC-5, Honza Rames wrote:
One more thing to note. On 64-bit systems you need to create a key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Prefs. I didn't even have to change any permissions to make the message go away, just create the key.

Honza

On Sunday, June 8, 2014 11:30:33 PM UTC+2, Mark Vlcek wrote:
Thanks everyone, just encountered this same problem and this solved my issue as well!

On Saturday, June 15, 2013 1:01:22 PM UTC-7, John V Denley wrote:
Just had the same problem myself, and found that to fix it I had to do what you suggested, but I also had to manually create a "Prefs" key under JavaSoft too, as mentioned here:
http://www-01.ibm.com/support/docview.wss?uid=swg21496098

On Friday, 14 June 2013 02:02:26 UTC+1, QingFeng Du wrote:
well well, 4 years later, I came across the same problem.
here's my solution:
open regedit.exe ( really hate Microsoft and their regedit.reg).
change the permission of key: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft.....Right click the icon, then change the permission to full operation.

On Saturday, June 27, 2009 3:03:20 PM UTC-4, Farinha wrote:
The subject has it all.

Eclipse 3.4.2
GWT Eclipse Plugin
Windows 7

Thanks in advance for the help.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.