[gwt-contrib] Proposal for Object Literals and Duct-Typing in GWT

2014-11-07 Thread 'Goktug Gokdogan' via GWT Contributors
Here is an early draft for adding support for JavaScript object literals in
GWT JsInterop:
http://goo.gl/K2Aygn

TL;DR;

@JsType(literal=true)
class MapOptions {
  public double zoom;
  public int mapTypeId;
  public LatLon center;
}

MapOptions options = new MapOptions() {{
zoom = 8;
mapTypeId = ...
center = ...
}};

​
will generate:

var mapOptions = {
  zoom: 8,
  mapTypeId: ...,
  center: ...,
};

​

And details in the document =)

Have a nice weekend!

 - Goktug

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA1Pr8C0onbhMSJHdmRoGXGO23rc8TkcB1qKFWo3tLSY4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Jens
As far as I know you can not call GWT.create(MyCssResource.class) directly 
since there is no  rule defined for anything extending 
CssResource. This should fail in GWT 2.6.1 as well. Your error basically 
means no generator and no replace rule has provided a concrete 
implementation for the CssResource interface.

At least I always use  and then use "res.css.cssClass" or if I really want to use 
 then I use 
@UiField(provided = true) and assign a CssResource instance from a 
corresponding ClientBundle to it.


-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/7d24a266-2c5a-482f-b6f1-688e6da9140c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Julien Dramaix
Koen,

Could you give us more information about the error (2) ? Does your 
BaseAdminCssResource use a .css or a .gss file ? Did you enable GSS ? Did 
you enable the auto conversion ? Could you paste the css line related with 
the warning message (line 75) ?

Thanks,

Julien

On Friday, November 7, 2014 8:49:27 PM UTC+1, Koen Maes wrote:
>
> thx for the pointers Jens and Roberto... I'll try your suggestions.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/605956e2-ee35-47f8-9c96-850396e79478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Koen Maes
Well,

Error (1) is easy to fix.

I corrected the WARNING with the star sign. The *BaseAdminCssResource seems 
to compile fine* during incremental compilation :'

 Resolving com.klawt.screen.ui.BaseAdminCssResource
Found type 'com.klawt.screen.ui.BaseAdminCssResource'
   Resolving method widget
  Resolving annotation for 
com.google.gwt.resources.client.CssResource$ClassName
  <...skip...>
   Resolving method subnavbar
  Resolving annotation for 
com.google.gwt.resources.client.CssResource$ClassName
   Resolving method subnavbar_inner
  Resolving annotation for 
com.google.gwt.resources.client.CssResource$ClassName


But I am still left with this error :

 [ERROR] Errors in 
'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
[ERROR] Line 108: Rebind result 
'com.klawt.screen.ui.BaseAdminCssResource' must be a class
<...skip...>
Compile with -strict or with -logLevel set to TRACE or DEBUG to see 
all errors.
 [ERROR] *Errors in 
'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'*
[ERROR] Line 108: Rebind result 
'com.klawt.screen.ui.BaseAdminCssResource' must be a class

When I check the generated sources this is what I find in the file 
*InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java*

/**
 * Getter for base called 0 times. Type: IMPORTED. Build precedence: 1.
 */
private com.klawt.screen.ui.BaseAdminCssResource get_base() {
  return build_base();
}
private com.klawt.screen.ui.BaseAdminCssResource build_base() {
  // Creation section.
  final com.klawt.screen.ui.BaseAdminCssResource base = 
(com.klawt.screen.ui.BaseAdminCssResource) 
GWT.create(com.klawt.screen.ui.BaseAdminCssResource.class);
  // Setup section.

  return base;
}


This is what the UiBinder file looks like that is causing the error :

http://dl.google.com/gwt/DTD/xhtml.ent";>






















Any ideas ??

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/22d9a92a-af03-426c-ba22-975fa35e0c65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Koen Maes
thx for the pointers Jens and Roberto... I'll try your suggestions.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/536ed7c3-4a7b-47ff-9794-bb737cf37533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread 'Roberto Lublinerman' via GWT Contributors
The reason why your are seeing error (1)  in 2.7 and not in 2.6 (I assume)
is that to implement minimal (class level) recompiles all the methods of a
class are traversed in 2.7 where only entry point reachable methods were
traversed in 2.6. In the past if you had a class that, for example,
provided constants and those were the only members really used by this
project, such a class would compile even if one of its methods referred to
a class that is not emulated.

On Fri, Nov 7, 2014 at 9:22 AM, Koen Maes  wrote:

> Hi
>
> I am trying my project with 2.7RC1. I can compile the whole project
> without errors.
>
> But when I start the application, recompile is triggered and this gives me
> two different errors :
>
> 1)  java.util.StringTokenizer is not found
>  Tracing compile failure path for type
> 'com.klawt.shared.domain.SearchFieldsTokenizer'
> [ERROR] Errors in
> 'file:/home/koen/workspace/klawt/shared/com/klawt/shared/domain/SearchFieldsTokenizer.java'
>[ERROR] Line 16: No source code is available for type
> java.util.StringTokenizer; did you forget to inherit a required module?
>
> 2) Troubles with GSS/CSS resource
>
>  Computing all possible rebind results for
> 'com.klawt.screen.ui.Resources'
> Rebinding com.klawt.screen.ui.Resources
>Invoking generator
> com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
>   Preparing method base_admin
>  The following problems were detected
> [WARN] Line 75 column 54: encountered "*". Was
> expecting one of: "|=" "~=" "=" "]"
>  [ERROR] Errors in
> 'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
> [ERROR] Line 108: Rebind result
> 'com.klawt.screen.ui.BaseAdminCssResource' must be a class
>
> The class BaseAdminCssResource is a CSSResource.
>
> public interface BaseAdminCssResource extends CssResource {
>
> @ClassName("widget")
> String widget();
>
> @ClassName("widget-header")
> String widgetHeader();
>
> and so on
> }
>
>
> Anybody to give me some hints what is wrong ...
>
> thx
> Koen
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/a50cc5ac-f548-4432-a673-9c02073d3542%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gndED9G3tox3XGuJTwv97Jp9ioHK%3DL%3D6MhYydrpezWzxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Jens
1.) GWT does not emulate java.util.StringTokenizer as you can see 
in 
https://gwt.googlesource.com/gwt/+/master/user/super/com/google/gwt/emul/java/util/
 
. So this error is kind of expected unless you provide your own emulation 
of that class.

2.) The gss/css file of your BaseAdminCssResource seem to contain a star 
sign ( * ) which the generator did not expect. Do you use any GSS syntax 
and maybe forgot to enable GSS (it is disabled by default)? Here is a good 
writeup on the various gss parameters: 
https://groups.google.com/d/msg/google-web-toolkit-contributors/---dVu3IvC4/ZbXINAWGGGsJ

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/4d680a21-3b2a-4f7c-98b8-7882b7d46e77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] 2.7RC1 compiles fine but recompile returns errors

2014-11-07 Thread Koen Maes
Hi

I am trying my project with 2.7RC1. I can compile the whole project without 
errors.

But when I start the application, recompile is triggered and this gives me 
two different errors :

1)  java.util.StringTokenizer is not found
 Tracing compile failure path for type 
'com.klawt.shared.domain.SearchFieldsTokenizer'
[ERROR] Errors in 
'file:/home/koen/workspace/klawt/shared/com/klawt/shared/domain/SearchFieldsTokenizer.java'
   [ERROR] Line 16: No source code is available for type 
java.util.StringTokenizer; did you forget to inherit a required module?

2) Troubles with GSS/CSS resource

 Computing all possible rebind results for 
'com.klawt.screen.ui.Resources'
Rebinding com.klawt.screen.ui.Resources
   Invoking generator 
com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
  Preparing method base_admin
 The following problems were detected
[WARN] Line 75 column 54: encountered "*". Was 
expecting one of: "|=" "~=" "=" "]" 
 [ERROR] Errors in 
'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
[ERROR] Line 108: Rebind result 
'com.klawt.screen.ui.BaseAdminCssResource' must be a class

The class BaseAdminCssResource is a CSSResource.

public interface BaseAdminCssResource extends CssResource {

@ClassName("widget")
String widget();

@ClassName("widget-header")
String widgetHeader();

    and so on
}


Anybody to give me some hints what is wrong ...

thx
Koen

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/a50cc5ac-f548-4432-a673-9c02073d3542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: stylesheet ignored/not handled in SDM 2.7.0-rc1

2014-11-07 Thread Thomas Broyer

On Friday, November 7, 2014 1:41:03 PM UTC+1, Christian X wrote:
>
> the file is requested from
> http://127.0.0.1:9876/overwrite.css
>

Ah, yes, from 
https://gwt.googlesource.com/gwt/+/2.7.0-rc1/dev/core/src/com/google/gwt/core/ext/linker/impl/loadExternalStylesheets.js
 and 
https://gwt.googlesource.com/gwt/+/2.7.0-rc1/dev/core/src/com/google/gwt/core/ext/linker/impl/computeUrlForResource.js,
 
your path being relative is resolved against 
GWT.getModuleBaseForStaticFiles() (i.e. SDM), because in many cases you'd 
want to reference a file that's in your module's "public path" so you want 
it resolved against your current sources to see your changes without having 
to restart DevMode/SDM.

You'll have to change either

   - the path to your CSS (e.g. /overview.css, but that won't necessarily 
   work once deployed in production)
   - the location of your CSS (e.g. put it in your module's public path and 
   reference it as )
   - the way you load it (e.g. inject it from your onModuleLoad, either as 
   a StyleElement added to the Document; or possibly as a TextResource that 
   you inject using StyleInjector –and use one less request to the server)
   

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/8eb2f667-7003-4bcf-aef2-cdab5cac64a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: stylesheet ignored/not handled in SDM 2.7.0-rc1

2014-11-07 Thread Christian X
the file is requested from
http://127.0.0.1:9876/overwrite.css

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/e8370fa5-b67c-4f88-b37e-475c68aef4c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.