Bug 259348 - [plug-in registry] show service properties
Summary: [plug-in registry] show service properties
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2008-12-19 05:21 EST by Wolfgang Schell CLA
Modified: 2009-01-06 07:32 EST (History)
3 users (show)

See Also:


Attachments
pde-runtime-serviceproperties-1.patch (9.85 KB, patch)
2008-12-19 05:21 EST, Wolfgang Schell CLA
no flags Details | Diff
implements service properties in plugin registry (4.83 KB, patch)
2008-12-20 20:31 EST, Wolfgang Schell CLA
caniszczyk: iplog+
Details | Diff
shows service properties in Properties View (6.27 KB, patch)
2008-12-20 20:31 EST, Wolfgang Schell CLA
no flags Details | Diff
org.eclipse.pde.runtime.patch (10.03 KB, patch)
2008-12-30 10:42 EST, Chris Aniszczyk CLA
no flags Details | Diff
pde-runtime-serviceproperties-3-sorting-icons.patch (6.98 KB, patch)
2009-01-06 06:22 EST, Wolfgang Schell CLA
no flags Details | Diff
pde-runtime-serviceproperties-3-propertyview.patch (6.39 KB, patch)
2009-01-06 06:23 EST, Wolfgang Schell CLA
no flags Details | Diff
pde-runtime-serviceproperties-3-sorting-icons-screenshot1.jpg (50.83 KB, image/jpeg)
2009-01-06 06:47 EST, Wolfgang Schell CLA
no flags Details
pde-runtime-serviceproperties-3-sorting-icons-screenshot2.jpg (53.63 KB, image/jpeg)
2009-01-06 06:48 EST, Wolfgang Schell CLA
no flags Details
pde-runtime-serviceproperties-4-sorting-icons.patch (7.15 KB, patch)
2009-01-06 07:32 EST, Wolfgang Schell CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Schell CLA 2008-12-19 05:21:27 EST
Created attachment 120927 [details]
pde-runtime-serviceproperties-1.patch

Build ID: I20081211-1908

Steps To Reproduce:
1. Create a (RCP) app exposing some OSGi services
2. Launch it with the PDE Runtime oplugin included
3. Open the PDE Plugin Registry
4. Open Properties view
5. Locate the OSGi service in the Plugin Registry
6. No service properties shown

More information:
The Plugin registry is an invaluable tool, when inspecting and diagnosing problems from within a RCP application. Unfortunately it is very difficult to determine whether a specific OSGI service is registered or used, as the Plugin Registry simply shows the service by its registered interfaces. 

The attached patch for the PDE Runtime plugin provides a simple IPropertySource and adapter for the Properties View, which lists the service properties.
Comment 1 Jacek Pospychala CLA 2008-12-19 05:54:55 EST
Wolfgang,
this is cool addition!

I'm only wondering whether it's better to keep service properties in Properties view, or directly in Plug-in registry view as nodes under the service node. Having it in plug-in registry would benefit in easy searching (thru the filter at the top of the view). For start we can have it in properties.
Comment 2 Wolfgang Schell CLA 2008-12-19 06:30:15 EST
Hi Jacek!

Thanks for the flowers :-)

I think you're right regarding showing the service properties in the plugin registry view itself. Additional to searching it does not required an additional view.

I try to come up with another patch including both options. Showing the service properties in plugin registry view would only need some additional changes to the content provider, as the service properties are already part of the ServiceRegistration object as of my patch.
Comment 3 Wolfgang Schell CLA 2008-12-20 20:29:58 EST
I have now created two patches:

pde-runtime-serviceproperties-2-pluginregistry.patch
-> implements service properties (re-using class Attribute as property)
   and shows them in the tree as children of ServiceRegistration

pde-runtime-serviceproperties-2-propertyview.patch
(based on pde-runtime-serviceproperties-2-pluginregistry.patch)
-> shows service properties in Properties View
Comment 4 Wolfgang Schell CLA 2008-12-20 20:31:13 EST
Created attachment 121015 [details]
implements service properties in plugin registry

implements service properties (re-using class Attribute as property)
and shows them in the tree as children of ServiceRegistration
Comment 5 Wolfgang Schell CLA 2008-12-20 20:31:58 EST
Created attachment 121016 [details]
shows service properties in Properties View

(based on pde-runtime-serviceproperties-2-pluginregistry.patch)
shows service properties in Properties View
Comment 6 Chris Aniszczyk CLA 2008-12-23 15:39:15 EST
I'll look at this for 3.5M5

Thanks for the contribution ;)
Comment 7 Chris Aniszczyk CLA 2008-12-30 10:42:30 EST
Created attachment 121346 [details]
org.eclipse.pde.runtime.patch

I updated the patch and also included a new icon for service properties.

Thanks for your contribution! :)
Comment 8 Chris Aniszczyk CLA 2008-12-30 10:42:54 EST
Thanks Wolfgang!

> 20081230
Comment 9 Wolfgang Schell CLA 2009-01-06 06:20:59 EST
Hi Chris!

I applied your changes and it looks nice.

I made some more changes to show service properties by type:
The attached patch shows service properties always in the following order:

1. "objectClass" (icon is "class_obj.gif")
2. "service.*" (sorted alphabetically, icon has overlay "run_co.gif")
3. everything else (sorted alphabetically)

As the service object already shows the contents of the objectClass property, we might simply hide this property. And/or change the icon to "int_obj.gif"...

BTW, showing service properties now makes it possible to find all OSGi services by specifying "objectClass" as filter, but an option to show only services, no bundles (similar to "Show Extension Content Only") would be nice as well.

I updated the patch for showing service properties in the Properties View, although I'm not sure, if it is still required, but as the necessary plugin org.eclipse.ui.views is optional, I think it wouldn't hurt to include it.

Thanks for integrating this functionality!

Regards,

Wolfgang
Comment 10 Wolfgang Schell CLA 2009-01-06 06:22:32 EST
Created attachment 121608 [details]
pde-runtime-serviceproperties-3-sorting-icons.patch

Sort service properties and show different icons for "objectClass" and "service.*"
Comment 11 Wolfgang Schell CLA 2009-01-06 06:23:22 EST
Created attachment 121609 [details]
pde-runtime-serviceproperties-3-propertyview.patch

Updated to work with changes made by Chris
Comment 12 Wolfgang Schell CLA 2009-01-06 06:44:11 EST
> BTW, showing service properties now makes it possible to find all OSGi services
> by specifying "objectClass" as filter, but an option to show only services, no
> bundles (similar to "Show Extension Content Only") would be nice as well.

Ah, I just found bug #220110. Of course after I had created a (trivial) patch for this. FWIW, I will attach it there...
Comment 13 Wolfgang Schell CLA 2009-01-06 06:45:58 EST
See the attached screenshots for a view of the service properties. They have been taken after applying pde-runtime-serviceproperties-3-sorting-icons.patch, so the service properties are sorted as specified above and the properties "service.*" have an overlay icon.
Comment 14 Wolfgang Schell CLA 2009-01-06 06:47:53 EST
Created attachment 121611 [details]
pde-runtime-serviceproperties-3-sorting-icons-screenshot1.jpg

Screenshot showing service properties in Registry Browser as well as Properties view. The displayed service has both OSGi-specific as well as custom service properties.
Comment 15 Wolfgang Schell CLA 2009-01-06 06:48:52 EST
Created attachment 121612 [details]
pde-runtime-serviceproperties-3-sorting-icons-screenshot2.jpg

Screenshot showing service properties in Registry Browser as well as Properties view. The displayed service (part of Eclipse Equinox runtime) has only OSGi-specific service properties.
Comment 16 Wolfgang Schell CLA 2009-01-06 07:32:16 EST
Created attachment 121618 [details]
pde-runtime-serviceproperties-4-sorting-icons.patch

This updated patch also displays "component.*" service properties (from Declarative Services) with the same icon as "service.*" and sorts them between "objectClass" and "service.*".