I am moving a simple CSS mesh system to GWT. My CSS file currently has classes like .size1 , .size2 etc., and I have a CSS resource that looks like
interface MyResource extends CSSResource { @ClassName("size1") String size1(); @ClassName("size2") String size2();
However, what I really want is to have one function, such as:
String size(int size);
which will generate the appropriate class when passing the size as a whole at runtime. This is necessary as I do some calculations to determine the actual space available / needed for the widget in javascript, and then append the appropriate class name.
Is this possible with GWT?
Change To clarify, I can easily write such a method for myself like this:
String size(int size) { switch(size) { case 1: return size1(); case 2: return size2(); ... and so on } }
However, MyResource is an interface, and its implementation is generated at runtime by the GWT. This means that I cannot add the size method to the MyResource type. Therefore, I suggest that I ask you to specify a way to add custom methods to the MyResource .
source share