You could make all you Composite components implement an interface having a single getValue()
method:
public interface HasValue {
public String getValue();
}
Then you can easilly extract the value of all widgets implementing that interface:
while (vPanelWidgets.hasNext()){
Widget childWidget = vPanelWidgets.next();
if(childWidget instanceof HasValue){
HasValue xx = (HasValue) childWidget;
values = xx.getValue();
}
}
If you need to return values other than strings, you could use generics. Take a look at GWT's com.google.gwt.user.client.ui.HasValue
for an example of that (you could also use that interface instead of creating your own).