Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to access the kind of an extension attribute ?
How to access the kind of an extension attribute ? [message #288731] Fri, 22 July 2005 10:26 Go to next message
Eclipse UserFriend
Hi,

From the extensions defined for a given extension point in a plugin, I'm
trying to determine programmatically the ones that have an attribute with
"Java" kind. So basically, the attribute that contains a fully qualified
name of a Java class.
From what I'm seeing in the interfaces, IExtension or
IConfigurationElement seems not to provide such possibilities. After some
research, it sounds that this information is available in ISchemaAttribute
(accessible via ISchema)... But those interfaces are internal. I'm not
very enclined to use them, but if it's the only place where I can reach
such data I think I'll resign myself to do it. Could you tell me if there
are more proper solution to access the "type/kind" of an extension
attribute ?
If no, could you describe me how I could get the "ISchema" instance
related to a given plugin using the less internal classes as possible ?

I'm using Eclipse 3.1.

Thanks for your consideration,

Regards,

Emmanuel.
Re: How to access the kind of an extension attribute ? [message #288732 is a reply to message #288731] Fri, 22 July 2005 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Emmanuel,

Won't IConfigurationElement.getAttribute do the trick?



egeay@us.ibm.com wrote:

>Hi,
>
>From the extensions defined for a given extension point in a plugin, I'm
>trying to determine programmatically the ones that have an attribute with
>"Java" kind. So basically, the attribute that contains a fully qualified
>name of a Java class.
>From what I'm seeing in the interfaces, IExtension or
>IConfigurationElement seems not to provide such possibilities. After some
>research, it sounds that this information is available in ISchemaAttribute
>(accessible via ISchema)... But those interfaces are internal. I'm not
>very enclined to use them, but if it's the only place where I can reach
>such data I think I'll resign myself to do it. Could you tell me if there
>are more proper solution to access the "type/kind" of an extension
>attribute ?
>If no, could you describe me how I could get the "ISchema" instance
>related to a given plugin using the less internal classes as possible ?
>
>I'm using Eclipse 3.1.
>
>Thanks for your consideration,
>
>Regards,
>
>Emmanuel.
>
>
Re: How to access the kind of an extension attribute ? [message #288733 is a reply to message #288732] Fri, 22 July 2005 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

He wants to know whether attribute is just a string, or the name of a
class. That info is only available during development in the schema. It
is not available during runtime. The PDE is the only one that uses it so
that it can give a nicer experience when editing the plugin.xml. If the
schema says it is a class attribute it knows to verify if the class
exists in the development workspace.

Ed Merks wrote:
> Emmanuel,
>
> Won't IConfigurationElement.getAttribute do the trick?
>
>
> egeay@us.ibm.com wrote:
>
>> Hi,
>>
>> From the extensions defined for a given extension point in a plugin,
>> I'm trying to determine programmatically the ones that have an
>> attribute with "Java" kind. So basically, the attribute that contains
>> a fully qualified name of a Java class.
>> From what I'm seeing in the interfaces, IExtension or
>> IConfigurationElement seems not to provide such possibilities. After
>> some research, it sounds that this information is available in
>> ISchemaAttribute (accessible via ISchema)... But those interfaces are
>> internal. I'm not very enclined to use them, but if it's the only
>> place where I can reach such data I think I'll resign myself to do it.
>> Could you tell me if there are more proper solution to access the
>> "type/kind" of an extension attribute ?
>> If no, could you describe me how I could get the "ISchema" instance
>> related to a given plugin using the less internal classes as possible ?
>>
>> I'm using Eclipse 3.1.
>>
>> Thanks for your consideration,
>>
>> Regards,
>>
>> Emmanuel.
>>
>>

--
Thanks,
Rich Kulp
Re: How to access the kind of an extension attribute ? [message #288734 is a reply to message #288732] Fri, 22 July 2005 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Well, I would have to give the string resulting from
IConfigurationElement.getAttribute to the Eclipse class loader to know if
really this string is a Java class name, right ?
Not only it's kind of a hack but it's also a bit time-consuming to verify
such simple information. Don't you think ?

Regards,

Emmanuel.
Re: How to access the kind of an extension attribute ? [message #288735 is a reply to message #288733] Fri, 22 July 2005 11:46 Go to previous messageGo to next message
Eclipse UserFriend
> The PDE is the only one that uses it so
> that it can give a nicer experience when editing the plugin.xml. If the
> schema says it is a class attribute it knows to verify if the class
> exists in the development workspace.

So how practically can I access the schema ? I've seen few things by
browing into the code. Via PDECore facilities ?

Thanks,

Emmanuel.
Re: How to access the kind of an extension attribute ? [message #288738 is a reply to message #288734] Fri, 22 July 2005 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Emmanuel,

Yes, I misunderstood that your concern was about processing extensions you know nothing about and hence for which you want metadata. Loading classes could cause lots plugins to be loaded, so you really wouldn't want to take that approach...



egeay@us.ibm.com wrote:

>Well, I would have to give the string resulting from
>IConfigurationElement.getAttribute to the Eclipse class loader to know if
>really this string is a Java class name, right ?
>Not only it's kind of a hack but it's also a bit time-consuming to verify
>such simple information. Don't you think ?
>
>Regards,
>
>Emmanuel.
>
>
Re: How to access the kind of an extension attribute ? [message #288740 is a reply to message #288735] Fri, 22 July 2005 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It's not exposed. I don't know how to get to it. Never had a need to.

egeay@us.ibm.com wrote:
>>The PDE is the only one that uses it so
>>that it can give a nicer experience when editing the plugin.xml. If the
>>schema says it is a class attribute it knows to verify if the class
>>exists in the development workspace.
>
>
> So how practically can I access the schema ? I've seen few things by
> browing into the code. Via PDECore facilities ?
>
> Thanks,
>
> Emmanuel.
>

--
Thanks,
Rich Kulp
Re: How to access the kind of an extension attribute ? [message #288754 is a reply to message #288740] Fri, 22 July 2005 14:59 Go to previous messageGo to next message
Eclipse UserFriend
PDECore to access IPluginExtension instances for a given plugin gave me an
entry point to get access to the schema.

Thanks.

Emmanuel.
Re: How to access the kind of an extension attribute ? [message #288755 is a reply to message #288754] Fri, 22 July 2005 15:41 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

But it works against the target not against the running eclipse. So if
you are interested in the target eclipse instead of the one that is
currently running, then ok. But if you wanted the one that is currently
running then you are out of luck if it happens to be different than the
target eclipse.

egeay@us.ibm.com wrote:
> PDECore to access IPluginExtension instances for a given plugin gave me an
> entry point to get access to the schema.
>
> Thanks.
>
> Emmanuel.

--
Thanks,
Rich Kulp
Previous Topic:dragSetData: Windows WebDAV/WebFolder and FileTransfer
Next Topic:Make Intro page not closeable
Goto Forum:
  


Current Time: Thu Jul 17 21:27:09 EDT 2025

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

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

Back to the top