Skip to main content


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 17:02
Philipp Kursawe is currently offline Philipp KursaweFriend
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: Sat Jul 27 10:27:37 GMT 2024

Powered by FUDForum. Page generated in 0.02939 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top