Possible errors in the XSD facet item providers [message #582832] |
Fri, 16 January 2004 16:48 |
Dennis Fuglsang Messages: 77 Registered: July 2009 |
Member |
|
|
Ed,
I have been diagnosing a problem associated with the "Value" EAttribute on
XSD facets via the Eclipse properties view. The problem ultimately stems
from calling the XSD facet's eIsSet method with the wrong EStructuralFeature
reference resulting in the following exception
java.lang.IllegalArgumentException: The feature 'value' is not a valid
feature
at
org.eclipse.emf.ecore.impl.EObjectImpl.eDynamicIsSet(EObject Impl.java:480)
at
org.eclipse.xsd.impl.XSDMinLengthFacetImpl.eIsSet(XSDMinLeng thFacetImpl.java
:305)
at
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getProp ertyValue(ItemPr
opertyDescriptor.java:658)
at
org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyV alue(PropertySou
rce.java:95)
at
com.metamatrix.modeler.internal.ui.properties.ModelObjectPro pertySource.getP
ropertyValue(ModelObjectPropertySource.java:224)
at
org.eclipse.ui.views.properties.PropertySheetEntry.refreshVa lues(PropertyShe
etEntry.java:489)
at
org.eclipse.ui.views.properties.PropertySheetEntry.refreshCh ildEntries(Prope
rtySheetEntry.java:455)
at
org.eclipse.ui.views.properties.PropertySheetEntry.setValues (PropertySheetEn
try.java:611)
at
org.eclipse.ui.views.properties.PropertySheetViewer.setInput (PropertySheetVi
ewer.java:776)
at
org.eclipse.ui.views.properties.PropertySheetPage.selectionC hanged(PropertyS
heetPage.java:377)
As I have been tracking through this is seems that the PropertyDescriptor
for the "Value" feature is not constructed with the correct
EStructuralFeature reference. For example, for an XSDMinLengthFacet the
logic shown below uses the XSDMinFacet's EStructuralFeature reference
instead of the one for XSDMinLengthFacet. Is this an error ?
The logic in XSDMinLengthFacetItemProvider ...
public List getPropertyDescriptors(Object object)
{
if (itemPropertyDescriptors == null)
{
super.getPropertyDescriptors(object);
XSDMinLengthFacet xsdMinLengthFacet = ((XSDMinLengthFacet)object);
// This is for the value feature.
//
itemPropertyDescriptors.add
(new ItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
XSDEditPlugin.getString("_UI_Value_label"),
XSDEditPlugin.getString("_UI_ValueMinLengthFacet_description "),
xsdPackage.getXSDMinFacet_Value(), <==== FIX ???? Should this
be xsdPackage.getXSDMinLengthFacet_Value(),
true,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE));
}
return itemPropertyDescriptors;
}
|
|
|
Powered by
FUDForum. Page generated in 0.02395 seconds