Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Eclipse Buddy Concept - Property File
Eclipse Buddy Concept - Property File [message #461562] Fri, 12 January 2007 08:49 Go to next message
Eclipse UserFriend
Originally posted by: search-1984.gmx.ch

hi

can the eclipse buddy concept only be used for classloading? i'm trying to make some propertyfiles visible for another plugin but they just can't be recognized. am i doing something wrong or is it just not possible?

thanks in advance

regards
Re: Eclipse Buddy Concept - Property File [message #461625 is a reply to message #461562] Sun, 14 January 2007 07:47 Go to previous messageGo to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
The buddy concept works for both classes and resources
(Bundle.getResource()).
If this does not work please open a bug report against equinox / framework
with an example reproducing the problem.

PaScaL

"search" <search-1984@gmx.ch> wrote in message
news:1818688.1168591804230.JavaMail.root@cp1.javalobby.org...
> hi
>
> can the eclipse buddy concept only be used for classloading? i'm trying to
> make some propertyfiles visible for another plugin but they just can't be
> recognized. am i doing something wrong or is it just not possible?
>
> thanks in advance
>
> regards
Re: Eclipse Buddy Concept - Property File [message #461633 is a reply to message #461625] Mon, 15 January 2007 04:56 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
What if e.g. the resource was in /resoruces, and there wasn't an Export-Package: resources in the manifest? Would that exhibit this problem?

Alex.
Re: Eclipse Buddy Concept - Property File [message #461636 is a reply to message #461633] Mon, 15 January 2007 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: search-1984.gmx.ch

hi

thanks for your answers. so far i didn't manage to get it to work though. i did the following:

i've two plugins. lets call them "client" and "framework". the client-plugin has a dependency to the framework but of course the framework hasn't got one to the client. now i want to load some client properties in the framework. i've added the following in the client manifest:

Eclipse-RegisterBuddy: properties
Export-Package: properties

the property file (usermessages.properties) is located in a package called properties (src/properties)

in my framwork manifest i have added

Eclipse-BuddyPolicy: registered

now when i try to load the property as follows file the resource can't be found.

String resourceBundleNameSmall = "properties/" + aResourceBundleName; // path: properties/usermessages

resourceBundle = ResourceBundle.getBundle(resourceBundleNameSmall);

how and were do i use Bundle.getResource()? i didn't quite get that. what else am i missing out here?

thanks for any help.

regards
Re: Eclipse Buddy Concept - Property File [message #461637 is a reply to message #461636] Mon, 15 January 2007 08:02 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
I'm pretty sure that Bundle.getEntry() will only ever search that Jar, regardless of what policies there are.

What I suspect Pascal meant was to use getClass().getResourceAsStream("/properties/file.txt") instead. If the properties was exported, then that should have the desired effect.

Alex.
Re: Eclipse Buddy Concept - Property File [message #461639 is a reply to message #461637] Mon, 15 January 2007 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: search-1984.gmx.ch

i just tried that out but the resource still can't be found. i have exported the package as follows:

Export-Package: properties

and also registered it (hope that is correct, i can register a package, right? or do i have to register each file separately?):

Eclipse-RegisterBuddy: properties

in the other manifest file i added the statement Eclipse-BuddyPolicy: registered

did i maybe forget something? or is there another way i could access that file?

regards
Re: Eclipse Buddy Concept - Property File [message #461640 is a reply to message #461639] Mon, 15 January 2007 09:23 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
You have to register a plugin. So if your plugin id is called properties
then you are correct.

Regards
Stefan

search wrote:
> i just tried that out but the resource still can't be found. i have exported the package as follows:
>
> Export-Package: properties
>
> and also registered it (hope that is correct, i can register a package, right? or do i have to register each file separately?):
>
> Eclipse-RegisterBuddy: properties
>
> in the other manifest file i added the statement Eclipse-BuddyPolicy: registered
>
> did i maybe forget something? or is there another way i could access that file?
>
> regards
Re: Eclipse Buddy Concept - Property File [message #461641 is a reply to message #461639] Mon, 15 January 2007 09:50 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
The Eclipse-RegisterBuddy is the id of a plugin, not a package name. So it should be something like com.example.foo.plugin, or whatever you've called it.

Alex.
Re: Eclipse Buddy Concept - Property File [message #461642 is a reply to message #461641] Mon, 15 January 2007 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: search-1984.gmx.ch

wohoo :-) that was it! i must have read over it or something. thanks a lot for your help! been trying to get it to work for quite a while now. thanx!
Re: Eclipse Buddy Concept - Property File [message #461664 is a reply to message #461641] Tue, 16 January 2007 02:36 Go to previous message
Jeff Higgins is currently offline Jeff HigginsFriend
Messages: 51
Registered: July 2009
Member
wohoo! :-O) from me too!
I've been fighting a ClassNotFoundException
for 3 days trying to use a bundled library.
Thanks, greatly appreciated.
JH
Previous Topic:3.3 M4 API ??
Next Topic:VM arguments in RCP Product?
Goto Forum:
  


Current Time: Thu Apr 25 12:48:34 GMT 2024

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

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

Back to the top