Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to use IResourcePool
How to use IResourcePool [message #804103] Wed, 22 February 2012 07:47 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 43
Registered: July 2011
Member
I'd like to know how to use IResourcePool.

I can inject IResourcePool, but don't know how to set resources.

I read the source code.
It seems it (eventually?) calls an OSGi Service and uses IResourceProviderService's properties to get resources.

Do I have to implement IResourceProviderService and it's properties in my app?
Or is there an easy way to set resources?

It would be great if I can get resources from preference setting.
(by Color: rgb,Image: uri, Font: fontname etc)

Thank you in advance. Smile
Re: How to use IResourcePool [message #804126 is a reply to message #804103] Wed, 22 February 2012 08:20 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 22.02.12 08:47, schrieb Watabe Kichi:
> I'd like to know how to use IResourcePool.
>
> I can inject IResourcePool, but don't know how to set resources.
>
> I read the source code.
> It seems it (eventually?) calls an OSGi Service and uses
> IResourceProviderService's properties to get resources.
>
> Do I have to implement IResourceProviderService and it's properties in
> my app?
> Or is there an easy way to set resources?
>

No - currently the only way is to provide an OSGi-Service but you are
free to grab the sources and implement new features, provide a patch and
we can discuss if this feature is feasable.

There is a base class available which you can simply subclass
(BasicResourceProvider) and use DS to contribute.

An example can be found here:

http://git.eclipse.org/c/e4/org.eclipse.e4.tools.git/tree/bundles/org.eclipse.e4.tools.emf.ui

> It would be great if I can get resources from preference setting.
> (by Color: rgb,Image: uri, Font: fontname etc)
>

That would be a nice addition for a base class which queries the
preference store for a value.

Tom
Re: How to use IResourcePool [message #804928 is a reply to message #804126] Thu, 23 February 2012 06:36 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 43
Registered: July 2011
Member
Thank you very much for the quick reply.

It seems org.eclipse.e4.tools.emf.ui.internal.ResourceProvider just defines properties as String.
So I made an empty subclass of BasicResourceProvider and set the service's properties entry to preference setting file.

like this,
<properties entry="preferences.ini"/>


I don't know if this is the correct way, but it works for now.
Previous Topic:RCP can not say hello world
Next Topic:HandlerServiceImpl scoping
Goto Forum:
  


Current Time: Tue Apr 23 16:05:42 GMT 2024

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

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

Back to the top