Thursday, June 18, 2020

StyleInjector chokes on startup

Probably unrelated with StyleInjector but with Scheduler.scheduleFinally,
but I'll try to explain:

Imagine class that defines ClientBundle as follows:

public class Foo {

public static interface Resources extends ClientBundle {
static final Resources $ = GWT.create(Resources.class);
Foo.Style style();
static {

public static interface Style extends CssResource {
String foo();

// ...


This class is GUI element that gets initialized through Activities/Places
framework, if that makes any difference.

Problem is, given style is NOT injected on app startup, but IT GETS INJECTED
if a do something as simple as:

Scheduler.get().scheduleFixedDelay(() -> {
return false;
}, 0);

in Foo's contructor.

Since StyleInjector injects styles using:


it looks like Scheduler doesn't recognize switch from GWT to browser event
loop if scheduleFinally is called sufficiently early during app startup
(like in static initializer of a class).

GWT 2.9.

Like I said, I've found a workaround (albeit a *very* dirty one), but
shouldn't this be treated as a bug in GWT?


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
To view this discussion on the web visit

No comments:

Post a Comment