public static List<ComboBox> getComboBox(List all, List in, ComboBox comboBox) {
List<ComboBox> comboxBoxs = new ArrayList<ComboBox>();
String[] fields = new String[] { comboBox.getId(), comboBox.getText() };
Object[] values = new Object[fields.length];
for (Object node : all) {
ComboBox box = new ComboBox();
ReflectHelper reflectHelper=new ReflectHelper(node);
for (int i = 0; i < fields.length; i++) {
String fieldName = fields[i].toString();
values[i] = reflectHelper.getMethodValue(fieldName);
}
box.setId(values[0].toString());
box.setText(values[1].toString());
if (in != null) {
for (Object node1 : in) {
ReflectHelper reflectHelper2=new ReflectHelper(node);
if (node1 != null) {
String fieldName = fields[0].toString();
String test = reflectHelper2.getMethodValue(fieldName).toString();
if (values[0].toString().equals(test)) {
box.setSelected(true);
}
}
}
}
comboxBoxs.add(box);