Re: GWT-client math vs. java-math

2019-05-19 Thread Craig Mitchell
The biggest difference I saw when running shared code between Java and 
JavaScript, was that JavaScript doesn't support floats (they will be 
treated as doubles in JavaScript).

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/34293ea4-9c78-4400-ae38-c382cb2877c3%40googlegroups.com.


Re: [GWT] [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core'

2019-05-19 Thread Craig Mitchell
I don't believe GWT supports Java 12 yet.  I'd recommend just using Java 8.

And you might want to use the latest GWT version (2.8.2).

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/4ca3b454-859f-4a6d-9e60-c935ae2d5ca5%40googlegroups.com.


An EventBus with less boiler plate

2019-05-19 Thread George Georgovassilis
Apologies if this has been discussed before. The EventBus requires the 
declaration of an Event class and a Handler interface for each activity of 
interest, which often results in plenty of boiler plate. In one of our 
projects we came up with a simpler notation which doesn't require event 
classes - so all we write are Handler interfaces (and their 
implementations). This does however require a modified event bus.

Firing an event can be as simple as:

bus.fireEvent(Types.transactionEvents, (l)->l.deposit(depositDate, 150, 
"ATM"));

The traditonal event/handler design template always implements these steps:

- sender package data into an event
- sender fires event on the event bus
- event bus locates handlers and executes event on them
- event invokes a method on the handler and passes packaged data as 
arguments

The idea here is that it is slightly less work to directly invoke a 
listener method with the appropriate arguments instead of going through the 
event pack/unpack procedure.

The repo is here: https://github.com/ggeorgovassilis/lambda-listeners, feel 
free to use any way you like.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/dac1af20-2eab-47c2-9e6b-a85b95c880e6%40googlegroups.com.


[GWT] [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core'

2019-05-19 Thread Clint Yang
Hi all,

I haven't done GWT development for a while and wanted to try again. I 
installed JDK 12 and Eclipse 2019-03. I installed GWT Eclipse Plugin (GWT 
2.8.1). 

>From Eclipse, I created a hello world project this way:

   1. Click on 'New GWT Application Project'
   2.  Project name: Gwt5, Package: com.foo, Use default SDK (GWT 2.8.1)
   3. Click on 'GWT Compile Project'

I see this error:

Compiling module com.foo.Gwt5
   [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' 
either directly or indirectly (most often by inheriting module 
'com.google.gwt.user.User')

I didn't change my gwt.xml.

Any suggestion?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/1736e311-270f-42fa-bd61-bd3dcfbaf122%40googlegroups.com.


Re: GWT-client math vs. java-math

2019-05-19 Thread Craig Mitchell
My testing has revealed that Math.sqrt does not yield the same results.

I think GWT just converts Math.sqrt to the JavaScript Math.sqrt function.  
I noticed the JavaScript Math.sqrt function returns different results based 
on what browser, and what operating system you are using.

I couldn't think of a smart way to fix this to return the same result all 
the time, so I ended up just rounding the answer to 6 decimal places.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/6ba3d382-416a-4127-897a-5973968a90f8%40googlegroups.com.