Thursday, December 24, 2015

GSS eval not evaluating

I have a method that calculates a box shadow. To use it, I call getShadow(int depth). If I call this, I get the expected result. Now, I'd like to create a few predefined constants in GSS. So, I do this:

public interface ColorResources extends CssResource
String shadowZ0();
String shadowZ1();
String shadowZ2();
String shadowZ3();
String shadowZ4();
String shadowZ5();

public static class Util
private Util() {}

public static String getShadow(int dp)
return shadow;

public static String shadowZ0()  { return getShadow(0); }
public static String shadowZ1()  { return getShadow(1); }
public static String shadowZ2()  { return getShadow(2); }
public static String shadowZ3()  { return getShadow(3); }
public static String shadowZ4()  { return getShadow(4); }
public static String shadowZ5()  { return getShadow(5); }


@def SHADOW_Z0 eval('');
@def SHADOW_Z1 eval('');
@def SHADOW_Z2 eval('');
@def SHADOW_Z3 eval('');
@def SHADOW_Z4 eval('');
@def SHADOW_Z5 eval('');

But if I do GWT.log(Resources.colors().shadowZ0()) (Where Resources is my ClientBundle that ColorResources is in), the print value is:

"Java expression :"

It should be evaluating the expression, not just returning it.... anyone know what's up?

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 post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment