- milestone: --> v1.2.5
- priority: 5 --> 7
- assigned_to: nobody --> remsy
I've been experimenting with the EMF feature of RPC Forms and have run into a few problems with combo boxes.
Using the net.sf.rcpforms.examples.emf.formpart.EMFExampleFormPart example from trunk (r816), I noticed the same problems with the "Gender" combo box.
I made the following observations...
1. In net.sf.rcpforms.emf.EMFFormFactory
The ValidationMangager seems to be redundant because the createModelToTargetUpdateStrategy and createTargetToModelUpdateStrategy methods don't have the right signature- the ModelAdapter parameter is missing.
2. The following exception is raised when trying to make a selection with the Gender combo box:
java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EEnumLiteralImpl cannot be cast to net.sf.rcpforms.emf.test.Gender
I found a solution to this by modifying the getInput method in net.sf.rcpforms.emf.EEnumRangeAdapter to return a list of Enumerators rather than
EEnumLiteralImpl as follows...
public Object getInput()
{
List<Enumerator> enumerators = new ArrayList<Enumerator> ();
for (EEnumLiteral literal: type.getELiterals())
{
enumerators.add(literal.getInstance());
}
return enumerators;
}
I’m really not sure if this is the correct way of dealing with this. Any feedback would be much appreciated.