Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356557 - Compatibility Layer - Getting services via getViewSite().getServices()
Summary: Compatibility Layer - Getting services via getViewSite().getServices()
Status: CLOSED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-02 04:29 EDT by Lars Vogel CLA
Modified: 2012-05-10 13:57 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2011-09-02 04:29:06 EDT
I tried using getViewSite().getServices(MyService) for a View in the compatibility layer and hoped to get my own defined service. 

I checked in the console and saw that my service was registered. Is this supposed to work?
Comment 1 Remy Suen CLA 2011-09-02 06:26:48 EDT
(In reply to comment #0)
> I tried using getViewSite().getServices(MyService) for a View in the
> compatibility layer and hoped to get my own defined service.

How did you define this service? Is this an OSGi service or are you using a service factory of Eclipse?
Comment 2 Lars Vogel CLA 2011-10-11 15:45:48 EDT
@Remy: I registered it as OSGi service. My assumption was that this would be one of the enhancements of e4 for "old" RCP applications.
Comment 3 Remy Suen CLA 2011-10-11 16:11:50 EDT
(In reply to comment #2)
> @Remy: I registered it as OSGi service.

If it's an OSGi service then this should certainly work, I'll take a look. Thanks for the info, Lars.
Comment 4 Remy Suen CLA 2011-10-12 08:01:58 EDT
(In reply to comment #2)
> @Remy: I registered it as OSGi service.

Lars, was it a service registered through code or a DS?
Comment 5 Remy Suen CLA 2011-10-12 10:55:00 EDT
I declared a DS and my view's getSite().getService(*) method was able to return the object.
Comment 6 Lars Vogel CLA 2011-10-14 16:40:25 EDT
Thanks Remy. I will re-test and post the results.
Comment 7 Lars Vogel CLA 2012-05-10 13:57:19 EDT
Retested. Works. For for the long delay in testing.