Menu

#10 EMF Feature and Combo Boxes

v1.2.5
open-postponed
Remo
None
7
2011-05-26
2011-05-02
Anonymous
No

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.

Discussion

  • Remo

    Remo - 2011-05-04
    • milestone: --> v1.2.5
    • priority: 5 --> 7
    • assigned_to: nobody --> remsy
     
  • Remo

    Remo - 2011-05-26
    • status: open --> open-postponed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.