use of org.eclipse.emf.edit.provider.IItemPropertySource in project ecf by eclipse.
the class EObjectPropertySourceFactory method getAdapter.
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.equals(IPropertySource.class) && adaptableObject instanceof EObject) {
EObject eObj = (EObject) adaptableObject;
List adapters = eObj.eAdapters();
for (Iterator itr = adapters.iterator(); itr.hasNext(); ) {
Object adapter = itr.next();
if (adapter instanceof IItemPropertySource) {
// TODO handle the case with multiple IItemPropertySource adapters for this EObject
return new PropertySource(adaptableObject, (IItemPropertySource) adapter);
}
}
}
return null;
}
Aggregations