Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Get extension point from plugin..
Get extension point from plugin.. [message #334777] Fri, 27 February 2009 09:39 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I have a problem getting information from an plugin.xml .
Following situation:
I have an plugin A in which depends on an other plugin B.

Now I want to get from plugin A some information of this extension point
of plugin B:

<extension point="org.eclipse.team.core.fileTypes">
<?gmfgen generated="true"?>
<fileTypes
type="text"
extension="dm">
</fileTypes>
</extension>

So what I want is to get in plugin A the file type defined in an extension
poit of (see above) in plugin B

Thanks for your help!
Best regards
Alex
Re: Get extension point from plugin.. [message #334786 is a reply to message #334777] Fri, 27 February 2009 14:28 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There are extensions and extension points. One plugin defines an
extension point (like org.eclipse.ui defines org.eclipse.ui.commands).
All the other plugins contribute extensions to that extension point.

It seems that your plugin B is contributing an extension, and you would
like to read that in plugin A? If that is the case, all you need to do
is get the IExtensionRegistry and track down the IExtension from plugin B.

Check out the API (java docs) for those 2 classes.

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


Re: Get extension point from plugin.. [message #334881 is a reply to message #334786] Fri, 06 March 2009 10:40 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
first thanks for your reply.

Now I can get the IExtensionPoint:

<extension point="org.eclipse.team.core.fileTypes">
<?gmfgen generated="true"?>
<fileTypes
type="text"
extension="dm">
</fileTypes>
</extension>

By:
Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core.fileTypes ");

But how can I now get that attribute: extension="dm" ?

Thanks for your help.
Best regards
Alex
Re: Get extension point from plugin.. [message #334882 is a reply to message #334881] Fri, 06 March 2009 10:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mickael.istria.openwide.fr

Hello Alexander,

You'd rather try to use

Platform.getExtensionRegistry().getConfigurationElementsFor( "org.eclipse.team.core.fileTypes")

that returns you some IConfigurationElement s (see javadoc) which
contains everything you'll need to know about the extensions of
"org.eclipse.team.core.fileTypes".

Hope that helps
Mickael


Alexander Mack a écrit :
> Hello,
> first thanks for your reply.
>
> Now I can get the IExtensionPoint:
>
> <extension point="org.eclipse.team.core.fileTypes">
> <?gmfgen generated="true"?>
> <fileTypes
> type="text"
> extension="dm">
> </fileTypes>
> </extension>
>
> By:
> Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core.fileTypes ");
>
>
> But how can I now get that attribute: extension="dm" ?
>
> Thanks for your help.
> Best regards
> Alex
>
>
>
Re: Get extension point from plugin.. [message #334884 is a reply to message #334882] Fri, 06 March 2009 12:07 Go to previous message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hi,
thanks for your reply.

Okay, I knew about the method getConfigurationElementsFor("..")

The problem is that I get an Array with about 300 entries.

So I tried to reduce it by giving the namespace but then my array has 0
entries.

But I am not really sure what the namespace of that plugin is.
Could you pleas give me an example?

Great thanks for your help

Alex
Previous Topic:Activator.stop() is not called at shutdown of OS (Windows XP)
Next Topic:Shared eclipse settings for a team
Goto Forum:
  


Current Time: Thu Jul 25 18:50:38 GMT 2024

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

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

Back to the top