Re: GWT and Oracle

2016-10-05 Thread Hristo Stoyanov
Oracle/Sun has history of failures on the client side ...

Oracle used to push ADF Faces, a JSF-bases library that went nowhere. Until 
soon, they were still thinking about MVC frameworks (remember  JSF and 
Struts back in the day?), thank god someone reminded them it is 2016 and 
they dropped MVC (JSR 371) from Java EE 8 for good.

One would think Oracle will do what is best for Java, stop the lawsuits and 
invite the GWT team to JCP, but this can only happen in some parallel 
reality ..

Having said all that, OracleJet is something I am interested in.  This is a 
"me too" approach for what SAP did with OpenUI5, but much better looking 
and with no "here-is-the-oss-version-but-buy-the-full-one" strings 
attached, truly open sourced . Major threat to Ext/Sencha, SmartClient, 
Kendo, etc.

The frequent release cycle and funded support is very re-assuring. The 
widget set and  business-oriented practicality in OracleJet is impressive - 
what they have achieved puts Google's cant-use-for-anything-serious 
multi-year effort, Material UI to shame.

The unpleasant part in OracleJet (for me at least) is the reliance of 
knockout, jquery and requireJs. Not exactly state-of-the-art stack. If 
those things can be stripped out and and the components reused with 
GWT/JsInterop that would be AWESOME! If someone is going into this 
direction, I would be very excited to collaborate!


On Friday, September 30, 2016 at 6:03:33 AM UTC-7, Eric Nissan wrote:
>
> Hey just curious, does Oracle contribute to GWT at all?  I know they are 
> in a battle with Google over Java (android), but one would think they could 
> put that aside and contribute as GWT really does encourage Java usage.
>

-- 
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 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-contrib] GWT Eclipse Plugin (V3) Shortcuts/Launchers

2016-10-05 Thread Ignacio Baca Moreno-Torres
This is how I think that newbies will understand it easier... I suppose the
change is too big, but maybe some part might be interesting. Any way
current state is pretty good! good work. I have re-ordered, leaving the
classic devmode the last one.
1. GWT Super DevMode - a client side GWT CodeServer (a.k.a. super devmode)
2. GWT Super DevMode and Jetty - a server side using Jetty and client side
using GWT Script CodeServer (a.k.a. super devmode)
3. GWT Classic DevMode and Jetty - a server side using Jetty and client
side using GWT Java CodeServer (a.k.a. classic devmode)

This might not be technically correct, but I think that the codeserver and
super devmode is practically the same (at least codeserver is implicit in
super devmode), and is confusing for users. Even better, if you change
"Classic" to "Java" and "Super" to "Script" is even easier to understand,
but I suppose is not a good idea because Super DevMode is everywhere.

On Wed, Oct 5, 2016 at 7:17 PM Brandon Donnelson 
wrote:

> What do you think of the labels for the GWT Eclipse Plugin (V3) Shortcuts
> and Launchers?
>
> FYI... I'm on track to releasing the EA soon and aim to reach beta before
> GWTCon. GPE (and the gpe-fork) is planning to be deprecated in the 4th
> quarter.
>
> --
> 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/7ddf1a06-5ede-4abe-adf4-74799669da42%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/CABVWDC5SR%2B_oACRw2r2YfBM7_MLHXEbHHXyaqzzqgJ79qOd%3Dsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: GSS changes aren't recognized in SDM

2016-10-05 Thread Thomas Broyer
IIRC, Eclipse does it for you automatically on save.

FWIW, this is because resources can be filtered (placeholders replaced with 
property values) and/or relocated, so using the "sources" directly could cause 
issues.

-- 
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 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: GSS changes aren't recognized in SDM

2016-10-05 Thread N Troncoso
Oh. I didn't know that was needed. It's a little inconvenient, but it's 
better than restarting the code server. Thanks!

On Wednesday, October 5, 2016 at 11:28:39 AM UTC-4, Thomas Broyer wrote:
>
> Do you "mvn process-resources" when you change something in 
> src/main/resources?
>
> On Wednesday, October 5, 2016 at 2:12:07 PM UTC+2, N Troncoso wrote:
>>
>> I'm starting a new project using GWT 2.8-rc2, and am setting up my GSS 
>> resources. It all works and the pages render correctly, but if I change a 
>> GSS file, the changes aren't loading when I refresh the browser.
>>
>> I have my ResourceBundles in 
>> *src/main/java/com/company/project/client/resources*
>>
>> And I have my gss files in 
>> *src/main/resources/com/company/project/client/resources/gss*
>>
>> So, when setting up my ResourceBundle, I do *@Source("gss/style.gss")*
>>
>> Just in case this is relevant, here are the properties in my gwt.xml file 
>> for GSS:
>>
>> 
>> > "strict" />
>>
>> This works, but like I said, if I make a change in style.gss, the change 
>> is not loaded when refreshing the browser. I have to stop the codeserver 
>> and restart it
>>
>> I don't think this matters, but the way I set up my resources is to have 
>> a CssResource per gss file. Then, I have a singleton Resource.java class. 
>> In it, I have a single ClientBundle that hooks each CssResource to its gss 
>> file. Then, I create static methods for each Resource. It looks like this:
>>
>> public class Resources
>> {
>> public static interface ResourceBundle extends ClientBundle
>> {
>> @Source("gss/flex.gss")
>> FlexStyleResource flex();
>>
>> @Source("gss/colors.gss")
>> ColorResource col();
>>
>> @Source("gss/fonts.gss")
>> FontResource font();
>>
>> @Source("gss/widgets.gss")
>> WidgetResource widget();
>> }
>>
>> private static Resources INSTANCE;
>>
>> public synchronized static Resources get()
>> {
>> if (INSTANCE == null)
>> {
>> INSTANCE = new Resources();
>> }
>>
>> return INSTANCE;
>> }
>>
>> public static FlexStyleResource flex()
>> {
>> return get().resources.flex();
>> }
>>
>> public static ColorResource col()
>> {
>> return get().resources.col();
>> }
>>
>> public static FontResource font()
>> {
>> return get().resources.font();
>> }
>>
>> public static WidgetResource widget()
>> {
>> return get().resources.widget();
>> }
>>
>> private final ResourceBundle resources;
>>
>> public Resources()
>> {
>> resources = GWT.create(ResourceBundle.class);
>> }
>>
>> public void init()
>> {
>> resources.flex().ensureInjected();
>> resources.col().ensureInjected();
>> resources.widget().ensureInjected();
>> resources.font().ensureInjected();
>> }
>> }
>>
>> And so, when I need something, I can do *Resources.col().primaryColor()* for 
>> example. *Note*: I call init() in my EntryPoint.onModuleLoad()
>>
>> Thanks in advance for any advice
>>
>

-- 
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 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: Chrome says I need to download the developer plugin, but it won't let me.

2016-10-05 Thread harshyadav
The Developer plugin won't work in the recent versions of Chrome.
(Dev mode is deprecated by most recent browsers).

You should use the Super dev mode:
http://www.gwtproject.org/articles/superdevmode.html



On Wednesday, October 5, 2016 at 11:30:46 AM UTC-4, 
dal...@whippets.wwusd.org wrote:
>
> I've just recently started using GWT and the Google plugin for Eclipse for 
> a school project, but I'm coming to a weird problem when trying to run 
> programs in Chrome. When I made my first Hello World program, it worked 
> perfectly fine, but then the next day when I tried to run it, it said I 
> needed to download a Google developer's plugin. When I clicked the download 
> button, I was given an Error 404 message. I kept trying to run it, and 
> seemingly out of nowhere, it eventually started working again. I thought my 
> problem was averted, but today, I'm getting the same message. Does anyone 
> know what's going on? Thanks!
>

-- 
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 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: GSS changes aren't recognized in SDM

2016-10-05 Thread Thomas Broyer
Do you "mvn process-resources" when you change something in 
src/main/resources?

On Wednesday, October 5, 2016 at 2:12:07 PM UTC+2, N Troncoso wrote:
>
> I'm starting a new project using GWT 2.8-rc2, and am setting up my GSS 
> resources. It all works and the pages render correctly, but if I change a 
> GSS file, the changes aren't loading when I refresh the browser.
>
> I have my ResourceBundles in 
> *src/main/java/com/company/project/client/resources*
>
> And I have my gss files in 
> *src/main/resources/com/company/project/client/resources/gss*
>
> So, when setting up my ResourceBundle, I do *@Source("gss/style.gss")*
>
> Just in case this is relevant, here are the properties in my gwt.xml file 
> for GSS:
>
> 
>  "strict" />
>
> This works, but like I said, if I make a change in style.gss, the change 
> is not loaded when refreshing the browser. I have to stop the codeserver 
> and restart it
>
> I don't think this matters, but the way I set up my resources is to have a 
> CssResource per gss file. Then, I have a singleton Resource.java class. In 
> it, I have a single ClientBundle that hooks each CssResource to its gss 
> file. Then, I create static methods for each Resource. It looks like this:
>
> public class Resources
> {
> public static interface ResourceBundle extends ClientBundle
> {
> @Source("gss/flex.gss")
> FlexStyleResource flex();
>
> @Source("gss/colors.gss")
> ColorResource col();
>
> @Source("gss/fonts.gss")
> FontResource font();
>
> @Source("gss/widgets.gss")
> WidgetResource widget();
> }
>
> private static Resources INSTANCE;
>
> public synchronized static Resources get()
> {
> if (INSTANCE == null)
> {
> INSTANCE = new Resources();
> }
>
> return INSTANCE;
> }
>
> public static FlexStyleResource flex()
> {
> return get().resources.flex();
> }
>
> public static ColorResource col()
> {
> return get().resources.col();
> }
>
> public static FontResource font()
> {
> return get().resources.font();
> }
>
> public static WidgetResource widget()
> {
> return get().resources.widget();
> }
>
> private final ResourceBundle resources;
>
> public Resources()
> {
> resources = GWT.create(ResourceBundle.class);
> }
>
> public void init()
> {
> resources.flex().ensureInjected();
> resources.col().ensureInjected();
> resources.widget().ensureInjected();
> resources.font().ensureInjected();
> }
> }
>
> And so, when I need something, I can do *Resources.col().primaryColor()* for 
> example. *Note*: I call init() in my EntryPoint.onModuleLoad()
>
> Thanks in advance for any advice
>

-- 
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 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.


Chrome says I need to download the developer plugin, but it won't let me.

2016-10-05 Thread dalzinm
I've just recently started using GWT and the Google plugin for Eclipse for 
a school project, but I'm coming to a weird problem when trying to run 
programs in Chrome. When I made my first Hello World program, it worked 
perfectly fine, but then the next day when I tried to run it, it said I 
needed to download a Google developer's plugin. When I clicked the download 
button, I was given an Error 404 message. I kept trying to run it, and 
seemingly out of nowhere, it eventually started working again. I thought my 
problem was averted, but today, I'm getting the same message. Does anyone 
know what's going on? Thanks!

-- 
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 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 remove EventListener

2016-10-05 Thread Thomas Broyer


On Wednesday, October 5, 2016 at 12:59:53 PM UTC+2, Henrik wrote:
>
> Surprised at your reaction to this.  I find myself doing the same more and 
> more as I'm using less and less widgets.  Is there a better way when 
> dealing with non-widget elements?
>

Use JsInterop (and/or Elemental) to directly add a @JsFunction?
Or use event delegation at the enclosing widget (if/when there's one)

-- 
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 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.


call GWT compiler from servlet

2016-10-05 Thread David
How do I use GWT compiler from servlet? I want to use GWT compile to 
compile source and send the compiled javascript to web client like super 
dev debug mode in servlet? 

Thanks,

David

-- 
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 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 RC2 with Polymer: Issue while calling click handler from Java.

2016-10-05 Thread Thomas Broyer


On Wednesday, October 5, 2016 at 12:59:29 PM UTC+2, GAURAV GUPTA wrote:
>
> Hi All,
>
> I am using below code for creating my custom element, 
>
> package com.test;
>
> import jsinterop.annotations.JsConstructor;
> import jsinterop.annotations.JsMethod;
> import jsinterop.annotations.JsType;
>
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.user.client.Window;
> import com.google.gwt.user.client.ui.Button;
>
> @JsType(namespace = "ctb")
> public class CustomGWTButton{
> @JsConstructor
> public CustomGWTButton() {
> }
> @JsMethod
> public Button getButton(){
> //#1 java handler not working
> return new Button("Test11", new ClickHandler() {
> @Override
> public void onClick(ClickEvent event) {
> Window.alert("How are you?"); 
> }
> });
> }
> }
>
>
> 
> 
> 
> 
> 
> Hello
> 
> 
> 
> Polymer({
> is: "gwt-button",
> attached: function(){
> var obj = new ctb.CustomGWTButton();
> var button = obj.getButton();
> //*#2* not working 
> button.onclick = function(){
> alert('Not Working Fine!!');
> }
> var line = document.createElement("p");
> line.innerHTML = button;
> document.getElementById("buttonId").appendChild(line);
> //when I do like this, it is working
> var ch = line.childNodes[0];
> ch.onclick = function(){
> alert('Working Fine!!');
> }
> }
> });
> 
> 
>
> Below issues I am facing (RED COLOR handlers not working):
> 1. Click handler defined in java class not working (#1).
>

This is because the widget is never "attached", so the event handler is 
never actually added (sinkEvents is not called).
See 
http://googlewebtoolkit.blogspot.fr/2009/05/widget-best-practices-widget-building.html
 
for example about the widgets lifecycle.
 

> 2. Then I tried to add onclick in javascript (#2) but it also didnt 
> worked for me.
>

This is because 'button' is a Button widget, not a  DOM element 
(HTMLButtonElement in JS).
 

> 3. then I again added onclick Handler in javascrpt (#3), It worked for 
> me. 
>

This is because when you did line.innerHTML=button it called the button's 
toString(), which happens to be calling toString() on its underlying 
HTMLButtonElement DOM element, which will end up as something like Test11.
When getting that element (which will *not* be the button backing the 
Button widget in your CustomGWTButton class, but a new one, a copy with the 
same HTML representation), you can now add a click handler, as it'll be an 
HTMLButtonElement DOM element.
 

> Can you please help me, How I can make work java handler #1 and #2 
> handler here.
>

Easiest would be to not mix widgets and non-widgets (DOM elements), and use 
Elemental or JSNI or JsInterop or whatever to attach an event listener for 
the click event.

-- 
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 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: NoClassDefFoundError (HttpSessionIdListener) when launching SDM, after switching from gwt-2.8.0-beta1 to rc2

2016-10-05 Thread Thomas Broyer
Or maybe adjust the classpathScope to include provided 
dependencies? 
http://tbroyer.github.io/gwt-maven-plugin/devmode-mojo.html#classpathScope 
/ http://tbroyer.github.io/gwt-maven-plugin/codeserver-mojo.html#classpathScope
(see also the samples from the GWT SDK, or the POM generated by 
webAppCreator)

On Wednesday, October 5, 2016 at 2:13:26 PM UTC+2, N Troncoso wrote:
>
> For anyone with the same issue as me, I had to remove the 
> *provided* in the dependency management for javax.servlet
>
> On Monday, October 3, 2016 at 9:22:48 AM UTC-4, N Troncoso wrote:
>>
>>
>> I'm having the same issue as Boris, except my dependency tree shows that 
>> I'm using 3.1:
>>
>> [INFO] +- com.google.gwt:gwt-user:jar:2.8.0-rc2:compile
>> [INFO] |  \- javax.servlet:javax.servlet-api:jar:3.1.0:provided (scope 
>> managed from compile)
>> [INFO] \- com.google.gwt:gwt-dev:jar:2.8.0-rc2:compile
>> [INFO]\- org.eclipse.jetty:apache-jsp:jar:9.2.14.v20151106:compile
>> [INFO]   +- 
>> org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106:compile
>> [INFO]   |  \- (javax.servlet:javax.servlet-api:jar:3.1.0:provided - 
>> scope managed from compile; omitted for duplicate)
>> [INFO]   \- (javax.servlet:javax.servlet-api:jar:3.1.0:provided - 
>> scope managed from compile; omitted for duplicate)
>>
>> The only place this is specified is in the parent pom:
>>
>>
>> 
>> 
>> 
>> com.google.gwt
>> gwt
>> 2.8.0-rc2
>> pom
>> import
>> 
>> 
>> javax.servlet
>> javax.servlet-api
>> 3.1.0
>> provided
>> 
>> 
>> 
>>
>> I get the exact same error that he posted when trying to run the 
>> codeserver. The only difference is that he's using 
>> *gwt-maven-plugin:1.0-rc-4* and I'm using *gwt-maven-plugin:1.0-rc-6*
>>
>

-- 
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 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: NoClassDefFoundError (HttpSessionIdListener) when launching SDM, after switching from gwt-2.8.0-beta1 to rc2

2016-10-05 Thread N Troncoso
For anyone with the same issue as me, I had to remove the 
*provided* in the dependency management for javax.servlet

On Monday, October 3, 2016 at 9:22:48 AM UTC-4, N Troncoso wrote:
>
>
> I'm having the same issue as Boris, except my dependency tree shows that 
> I'm using 3.1:
>
> [INFO] +- com.google.gwt:gwt-user:jar:2.8.0-rc2:compile
> [INFO] |  \- javax.servlet:javax.servlet-api:jar:3.1.0:provided (scope 
> managed from compile)
> [INFO] \- com.google.gwt:gwt-dev:jar:2.8.0-rc2:compile
> [INFO]\- org.eclipse.jetty:apache-jsp:jar:9.2.14.v20151106:compile
> [INFO]   +- org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106:compile
> [INFO]   |  \- (javax.servlet:javax.servlet-api:jar:3.1.0:provided - 
> scope managed from compile; omitted for duplicate)
> [INFO]   \- (javax.servlet:javax.servlet-api:jar:3.1.0:provided - 
> scope managed from compile; omitted for duplicate)
>
> The only place this is specified is in the parent pom:
>
>
> 
> 
> 
> com.google.gwt
> gwt
> 2.8.0-rc2
> pom
> import
> 
> 
> javax.servlet
> javax.servlet-api
> 3.1.0
> provided
> 
> 
> 
>
> I get the exact same error that he posted when trying to run the 
> codeserver. The only difference is that he's using 
> *gwt-maven-plugin:1.0-rc-4* and I'm using *gwt-maven-plugin:1.0-rc-6*
>

-- 
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 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.


GSS changes aren't recognized in SDM

2016-10-05 Thread N Troncoso
I'm starting a new project using GWT 2.8-rc2, and am setting up my GSS 
resources. It all works and the pages render correctly, but if I change a 
GSS file, the changes aren't loading when I refresh the browser.

I have my ResourceBundles in 
*src/main/java/com/company/project/client/resources*

And I have my gss files in 
*src/main/resources/com/company/project/client/resources/gss*

So, when setting up my ResourceBundle, I do *@Source("gss/style.gss")*

Just in case this is relevant, here are the properties in my gwt.xml file 
for GSS:




This works, but like I said, if I make a change in style.gss, the change is 
not loaded when refreshing the browser. I have to stop the codeserver and 
restart it

I don't think this matters, but the way I set up my resources is to have a 
CssResource per gss file. Then, I have a singleton Resource.java class. In 
it, I have a single ClientBundle that hooks each CssResource to its gss 
file. Then, I create static methods for each Resource. It looks like this:

public class Resources
{
public static interface ResourceBundle extends ClientBundle
{
@Source("gss/flex.gss")
FlexStyleResource flex();

@Source("gss/colors.gss")
ColorResource col();

@Source("gss/fonts.gss")
FontResource font();

@Source("gss/widgets.gss")
WidgetResource widget();
}

private static Resources INSTANCE;

public synchronized static Resources get()
{
if (INSTANCE == null)
{
INSTANCE = new Resources();
}

return INSTANCE;
}

public static FlexStyleResource flex()
{
return get().resources.flex();
}

public static ColorResource col()
{
return get().resources.col();
}

public static FontResource font()
{
return get().resources.font();
}

public static WidgetResource widget()
{
return get().resources.widget();
}

private final ResourceBundle resources;

public Resources()
{
resources = GWT.create(ResourceBundle.class);
}

public void init()
{
resources.flex().ensureInjected();
resources.col().ensureInjected();
resources.widget().ensureInjected();
resources.font().ensureInjected();
}
}

And so, when I need something, I can do *Resources.col().primaryColor()* for 
example. *Note*: I call init() in my EntryPoint.onModuleLoad()

Thanks in advance for any advice

-- 
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 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 remove EventListener

2016-10-05 Thread Henrik
Surprised at your reaction to this.  I find myself doing the same more and 
more as I'm using less and less widgets.  Is there a better way when 
dealing with non-widget elements? 

On Tuesday, October 4, 2016 at 11:57:24 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Tuesday, October 4, 2016 at 1:04:06 AM UTC+2, David wrote:
>>
>> I use the following code to create an EventListener:
>>
>>   Event.sinkEvents(divElement, Event.ONCLICK);
>>  final EventListener listener = new EventListener() 
>> {...};
>>  Event.setEventListener(divElement, listener);
>>
>
> Please tell me this is legacy code from GWT 1.x times…
> (why not use a widget? or event delegation?)
>  
>
>> How do I remove EventListener late if I don't want to delete the created 
>> divElement?
>>
>
> If you want to stop listening to all events (and easily reattach the 
> listener later on, triggered on the same events):
> Event.setEventListener(divElement, null);
> to stop listening to click events:
> Event.sinkEvents(divElement, 0); // unsinks all events, but you only had 
> ONCLICK
> or
> Event.sinkEvents(divElement, Event.getEventsSunk() & ~Event.ONCLICK);
>  
>

-- 
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 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 RC2 with Polymer: Issue while calling click handler from Java.

2016-10-05 Thread GAURAV GUPTA
Hi All,

I am using below code for creating my custom element, 

package com.test;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;

@JsType(namespace = "ctb")
public class CustomGWTButton{
@JsConstructor
public CustomGWTButton() {
}
@JsMethod
public Button getButton(){
//#1 java handler not working
return new Button("Test11", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("How are you?"); 
}
});
}
}







Hello



Polymer({
is: "gwt-button",
attached: function(){
var obj = new ctb.CustomGWTButton();
var button = obj.getButton();
//*#2* not working 
button.onclick = function(){
alert('Not Working Fine!!');
}
var line = document.createElement("p");
line.innerHTML = button;
document.getElementById("buttonId").appendChild(line);
//when I do like this, it is working
var ch = line.childNodes[0];
ch.onclick = function(){
alert('Working Fine!!');
}
}
});



Below issues I am facing (RED COLOR handlers not working):
1. Click handler defined in java class not working (#1).
2. Then I tried to add onclick in javascript (#2) but it also didnt worked 
for me.
3. then I again added onclick Handler in javascrpt (#3), It worked for me. 

Can you please help me, How I can make work java handler #1 and #2 handler 
here.

Thanks,
Gaurav

-- 
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 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.