Wednesday, September 29, 2010

getConstructor alternative? or how to pass and use a class in another?

If I want a class to be able to create new objects of another type
parsed to it, how would I do that?
The parsed class's would need to take perimeters.

In the specific case I'm using they would all be different types of
popups, given a string of text to display in different ways.
I could probably find an alternative, but I feel if this is possible
in GWT I should know how to do it.

My last attempt was;

c = customPopUp.getConstructor(new Class[]
Widget PopUp = (Widget)c.newInstance(new Object[]{"text 1", "text

Where "customPopUp" was set just by;

public static void setCustomPopUp(Class newPopUp){
customPopUp = newPopUp;

But this method doesn't seem emulated in Gwt.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment