I was wondering if someone could help me out with this problem.

I need to get and object from an especific class (that extends a class
named DDOField).

I'm doing this to get a new instance according to the type requested:

HashMap<String, DDOField> availableFields = new HashMap<String,
DDOField>();

availableFields.put("simpletext",  new SimpleTextField());
availableFields.put("password",  new PasswordField());
availableFields.put("validated", new ValidatedField());
availableFields.put("richtext", new RichTextField());
availableFields.put("textarea", new TextAreaField());
availableFields.put("simpledate", new SimpleDateField());
availableFields.put("short", new ShortField());
availableFields.put("int", new IntField());
availableFields.put("long", new LongField());
availableFields.put("enum", new EnumField());
availableFields.put("boolean", new BooleanField());

type = "simpletext";
DDOField field = availableFields.get(type);

That way I get the variable 'field' to point to a new instance of the
type 'simpletext' (new SimpleTextField()).  The problem is that I'm
creating 11 new instances just to use one of them.

I've tried to use Class.forName but it is not supported in GWT, also
tried GWT.Create() but it didn't work as I expected or maybe I'm doing
something wrong.

Any help with this matter will be greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to