Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Which Adapters available?
Which Adapters available? [message #331209] Thu, 28 August 2008 10:41 Go to next message
Eclipse UserFriend
Hi there,

as I understand a common pattern used in Eclipse is the "Extensible
Objects" pattern: you can extend an existing class by adding adapters to it.

How can I find out what adapters are available for a certain class? To
find out what to do with a class, I usually look at the class API.
Obviously that's not enough to find out about its adapters, because the
meaning of adapters is to define them outside of the class. So how to
know where to look? And how to know if it's a good idea to use a certain
adapter as it might bring in new dependencies to those outside projects
where the adapter is defined...

Cheers,
Hauke
Re: Which Adapters available? [message #331213 is a reply to message #331209] Thu, 28 August 2008 13:15 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------060103040709030506080400
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hauke,

I don't think you really can. The whole point of an adapter is to
provide something not provided by the base implementation. I suppose
the closest that comes to what you want is the registrations for the
|org.eclipse.core.runtime.adapters extension point.|
< http://www.eclipse.org/articles/article.php?file=Article-Ada pters/index.html>


http://www.eclipse.org/articles/article.php?file=Article-Ada pters/index.html

And yes, if you use some other API, you'll depend on (or at least load)
the plugins that provide it.


Hauke Fuhrmann wrote:
> Hi there,
>
> as I understand a common pattern used in Eclipse is the "Extensible
> Objects" pattern: you can extend an existing class by adding adapters to it.
>
> How can I find out what adapters are available for a certain class? To
> find out what to do with a class, I usually look at the class API.
> Obviously that's not enough to find out about its adapters, because the
> meaning of adapters is to define them outside of the class. So how to
> know where to look? And how to know if it's a good idea to use a certain
> adapter as it might bring in new dependencies to those outside projects
> where the adapter is defined...
>
> Cheers,
> Hauke
>

--------------060103040709030506080400
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hauke,<br>
<br>
I don't think you really can.&nbsp; The whole point of an adapter is to
provide something not provided by the base implementation.&nbsp; I suppose
the closest that comes to what you want is the registrations for the <code>org.eclipse.core.runtime.adapters
extension point.</code><a
href=" http://www.eclipse.org/articles/article.php?file=Article-Ada pters/index.html"><br>
</a>
<blockquote><a
href=" http://www.eclipse.org/articles/article.php?file=Article-Ada pters/index.html"> http://www.eclipse.org/articles/article.php?file=Article-Ada pters/index.html</a><br>
</blockquote>
And yes, if you use some other API, you'll depend on (or at least load)
the plugins that provide it.<br>
<br>
<br>
Hauke Fuhrmann wrote:
<blockquote cite="mid:g95vc2$gbi$1@build.eclipse.org" type="cite">
<pre wrap="">Hi there,

as I understand a common pattern used in Eclipse is the "Extensible
Objects" pattern: you can extend an existing class by adding adapters to it.

How can I find out what adapters are available for a certain class? To
find out what to do with a class, I usually look at the class API.
Obviously that's not enough to find out about its adapters, because the
meaning of adapters is to define them outside of the class. So how to
know where to look? And how to know if it's a good idea to use a certain
adapter as it might bring in new dependencies to those outside projects
where the adapter is defined...

Cheers,
Hauke
</pre>
</blockquote>
</body>
</html>

--------------060103040709030506080400--
Re: Which Adapters available? [message #331253 is a reply to message #331209] Thu, 28 August 2008 15:09 Go to previous message
Eclipse UserFriend
There is some API in org.eclipse.core.runtime.IAdapterManager to query
adapters without actually loading the adapter targets. Some of the
methods take the object instance in question (as an Object) and a string
for the adapter target (so you don't have to load the class).

Do you have the object to be adapted already?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Previous Topic:Menu item visibleWhen a handler is active
Next Topic:InfoCenter Exception
Goto Forum:
  


Current Time: Wed Feb 19 00:06:38 GMT 2025

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

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

Back to the top