Community
Participate
Working Groups
Build ID: M20070212-1330 I don't see any reason why the object passed in has to implement IAdaptable. I could understand that *if* it does, then we should call the Object's getAdapter(Class) method, but if it does not implement IAdaptable, we could then use the AdapterManager to try to get the adapter. I was able to subclass and override this behavior for the WorkbenchContentProvider, and that is okay. The problem lies with the WorkbenchLabelProvider, because its getAdapter() method is marked final, so no one can override. I think that there are two mistakes here: 1) not being a little more open/accomodating in the implementation of the getAdapter() method and 2) not allowing the method to be overridden. There are many cases where we have domain objects that should not have to be tied directly to Eclipse interfaces (most particularly for portability). The Eclipse Platform provides a great way of getting adapters without having to rely on a particular interface. If it were up to me, I would completely deprecate the IAdaptable interface. Please get this fixed, so that we don't have to continually jump through hoops to get some real work done. Thank you.
You're in luck, it's already fixed in 3.3 PW
Hooray! You guys are awesome!!
I think it was fixed as part of bug 156581 ... our standard implementation does an instanceof check for the type, the if the object implements IAdapatable asks that for the type, and then goes to the AdapterManager and asks for the type. PW
*** This bug has been marked as a duplicate of bug 156581 ***