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[]
{String.class,String.class});
Widget PopUp = (Widget)c.newInstance(new Object[]{"text 1", "text
2"});


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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment