[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Common Navigator + EMF + Properties View

Hi Omer,

EMF's ItemPropertyDescriptors implement getPropertyValue() to actually wrap the values they return in instances of PropertyValueWrapper. I must admit that I don't totally understand everything that's going on here, but it seems somehow to facilitate nesting of properties.

I believe that clients should be calling getEditableValue() on the IPropertySource, which then calls getEditableValue() on the PropertyValueWrapper, yielding the actual string value. I observe this happening in Eclipse's PropertySheetEntry.setValues() when I use an EMF-generated editor. Then, in getEditor(), the PropertySheetEntry passes that unwrapped value to the cell editor via setValue(). The DialogCellEditor records it in doSetValue() for use by openDialogBox(), at PropertyDescriptor.java:239, in your trace. So, I expect that it should actually be passing a string to EDataTypeValueHandler.toString().

Could it be that, in your use, IPropertySource.getEditableValue() is not being called? I've never worked with the Common Navigator Framework before. Can you do some debugging to see what's happening?

Cheers,
Dave


Ömer Yildiz wrote:
Hi,

I want the user to be able to modify properties of model objects, which are shown in the Project Explorer using the Common Navigator Framework. The Properties View displays their properties, but modifing a particular type of property does not work. When the user tries to modify a property, which is defined as a multi-line String in the genmodel and it already contains a string, he's getting this exception:

java.lang.ClassCastException: org.eclipse.emf.edit.provider.ItemPropertyDescriptor$PropertyValueWrapper cannot be cast to java.lang.String
at org.eclipse.emf.ecore.impl.EcoreFactoryImpl.convertEStringToString(EcoreFactoryImpl.java:654)


at org.eclipse.emf.ecore.impl.EcoreFactoryImpl.convertToString(EcoreFactoryImpl.java:224)

at org.eclipse.emf.ecore.util.EcoreUtil.convertToString(EcoreUtil.java:3112)
at org.eclipse.emf.edit.ui.provider.PropertyDescriptor$EDataTypeValueHandler.toString(PropertyDescriptor.java:199)


at org.eclipse.emf.edit.ui.provider.PropertyDescriptor$2.openDialogBox(PropertyDescriptor.java:293)

at org.eclipse.jface.viewers.DialogCellEditor$2.widgetSelected(DialogCellEditor.java:244)

...


Any hints to fix this issue?

Best regards,
Ömer Yildiz