Safe to call IAdaptable.getAdapter() from inside an IAdapterFactory? [message #514860] |
Tue, 16 February 2010 17:02 |
Eclipse User |
|
|
|
Hello,
I need to adapt the current selection item to my own interface (Copyable).
If the selection contains a MarkerItem I want it to adapt to my
interface. However MarkerItem is an internal class and I would rather
like to adapt IMarker to my own interface Copyable.
That would mean that I would have to adapt the selected MarkerItem first
to IMarker via IAdaptable (which MarkerItem implements). And after that
I would have to adapt the IMarker to my own interface.
So is it safe to call:
if (adaptableObject instanceof IAdaptable) {
adaptableObject = ((IAdaptable) adaptableObject)
.getAdapter(IMarker.class);
}
inside my IAdapterFactory? I think this could lead to circular calls
somehow.
How do I adapt MarkerItem to Copyable?
Thanks,
Phil
|
|
|
Powered by
FUDForum. Page generated in 0.02101 seconds