Project: Eclipse_Platform_UI
Bug 21726 DrillDownAdapter blindly assumes IAdaptable interface on selected object.
Reported: 2002-07-19 04:34:12 | Status: resolved fixed

I found following problem: * When TreeContentProvider.getChildren() returns objects that do not implement IAdaptable interface and when DrillDownAdapter is defined and selection appears on that element, than DrillDownAdapter.canGoInto() makes class cast exception. * It is because blind assumption, that every selection implements IAdaptable interface. Here is a excerpt from canGoInto: ... if (oSelection == null || oSelection.size() != 1) return false; IAdaptable anElement = (IAdaptable) oSelection.getFirstElement(); ... This cause lot of problems when using "external" objects as tree elements (let say parsed xml file - these elements does not deal with eclipse IAdaptable interface). Wrapping these to some kind of "TreeNode" causes another problem - how to do update/refresh on such tree (tracking backward object change to TreeNode is not simple). Is there any chance that DrillDownAdapter (and possibly others ) shall not require IAdaptable interface?

Files changed in fix:
bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/part/DrillDownAdapter.java bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/part/DrillFrame.java