Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Safe to call IAdaptable.getAdapter() from inside an IAdapterFactory?
Safe to call IAdaptable.getAdapter() from inside an IAdapterFactory? [message #514860] Tue, 16 February 2010 12:02
Philipp Kursawe is currently offline Philipp Kursawe
Messages: 135
Registered: July 2009
Senior Member
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
Previous Topic:Best way to add drop support
Next Topic:How to get the command from a handler?
Goto Forum:
  


Current Time: Tue Sep 02 08:01:23 EDT 2014

Powered by FUDForum. Page generated in 0.01558 seconds