Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 243138 Details for
Bug 270684
[patch] [plug-in registry] add support for OSGi Remote Services/Remote Service Admin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for showing remote service proxy icon in RegistryBrowserLabelProvider
270684.org.eclipse.pde.runtime.patch (text/plain), 5.46 KB, created by
Scott Lewis
on 2014-05-15 13:07:51 EDT
(
hide
)
Description:
patch for showing remote service proxy icon in RegistryBrowserLabelProvider
Filename:
MIME Type:
Creator:
Scott Lewis
Created:
2014-05-15 13:07:51 EDT
Size:
5.46 KB
patch
obsolete
>diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java >index 62812c3..710e335 100644 >--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java >+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePluginImages.java >@@ -79,6 +79,7 @@ > public static final ImageDescriptor DESC_PLUGINS_OBJ = create(PATH_OBJ, "plugins_obj.gif"); //$NON-NLS-1$ > public static final ImageDescriptor DESC_FRAGMENT_OBJ = create(PATH_OBJ, "frgmt_obj.gif"); //$NON-NLS-1$ > public static final ImageDescriptor DESC_PACKAGE_OBJ = create(PATH_OBJ, "package_obj.gif"); //$NON-NLS-1$ >+ public static final ImageDescriptor DESC_REMOTE_SERVICE_PROXY_OBJ = create(PATH_OBJ, "rsvcproxy_obj.gif"); //$NON-NLS-1$ > > /* > * Overlays >diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java >index 5516caf..1a28d9a 100644 >--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java >+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowserLabelProvider.java >@@ -10,8 +10,6 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.runtime.registry; > >-import org.eclipse.pde.internal.runtime.PDERuntimeMessages; >- > import java.util.Arrays; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.viewers.*; >@@ -20,6 +18,7 @@ > import org.eclipse.pde.internal.runtime.registry.model.*; > import org.eclipse.swt.graphics.Image; > import org.osgi.framework.Constants; >+import org.osgi.framework.ServiceReference; > > public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implements ILabelProvider { > >@@ -47,6 +46,7 @@ > private Image fServicePropertyImage; > private Image fFragmentImage; > private Image fPackageImage; >+ private Image fRemoteServiceProxyImage; > private RegistryBrowser fRegistryBrowser; > > public RegistryBrowserLabelProvider(RegistryBrowser browser) { >@@ -70,6 +70,7 @@ > fPluginsImage = PDERuntimePluginImages.DESC_PLUGINS_OBJ.createImage(); > fFragmentImage = PDERuntimePluginImages.DESC_FRAGMENT_OBJ.createImage(); > fPackageImage = PDERuntimePluginImages.DESC_PACKAGE_OBJ.createImage(); >+ fRemoteServiceProxyImage = PDERuntimePluginImages.DESC_REMOTE_SERVICE_PROXY_OBJ.createImage(); > > ImageDescriptor activePluginDesc = new OverlayIcon(PDERuntimePluginImages.DESC_PLUGIN_OBJ, new ImageDescriptor[][] {{PDERuntimePluginImages.DESC_RUN_CO}}); > fActivePluginImage = activePluginDesc.createImage(); >@@ -115,6 +116,20 @@ > fPackageImage.dispose(); > } > >+ private boolean isProxyService(ServiceReference ref) { >+ if (ref == null) >+ return false; >+ Object o = ref.getProperty(Constants.SERVICE_IMPORTED); >+ return (o != null); >+ } >+ >+ private boolean isProxyService(ServiceRegistration reg) { >+ if (reg == null) >+ return false; >+ Object o = reg.getProperty(Constants.SERVICE_IMPORTED); >+ return (o != null); >+ } >+ > public Image getImage(Object element) { > if (element instanceof Bundle) { > Bundle bundle = (Bundle) element; >@@ -139,10 +154,16 @@ > } > > if (element instanceof ServiceName) { >+ ServiceName serviceName = (ServiceName) element; >+ if (isProxyService(serviceName.getServiceReference())) >+ return fRemoteServiceProxyImage; > return fServiceImage; > } > > if (element instanceof ServiceRegistration) { >+ ServiceRegistration reg = (ServiceRegistration) element; >+ if (isProxyService(reg)) >+ return fRemoteServiceProxyImage; > return fPluginImage; > } > >diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java >index e6e7337..faa3acb 100644 >--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java >+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/LocalRegistryBackend.java >@@ -289,7 +289,7 @@ > > if (classes != null) { > Arrays.sort(classes); >- service.setName(new ServiceName(classes)); >+ service.setName(new ServiceName(classes, ref)); > service.setProperties(properties); > } > return service; >diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java >index 8f7fc44..5634ae4 100644 >--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java >+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/model/ServiceName.java >@@ -12,13 +12,20 @@ > package org.eclipse.pde.internal.runtime.registry.model; > > import java.util.Arrays; >+import org.osgi.framework.ServiceReference; > > public class ServiceName extends ModelObject implements Comparable { > > private String[] classes; >+ private ServiceReference reference; > >- public ServiceName(String[] classes) { >+ public ServiceName(String[] classes, ServiceReference ref) { > this.classes = classes; >+ this.reference = ref; >+ } >+ >+ public ServiceReference getServiceReference() { >+ return this.reference; > } > > public String[] getClasses() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 270684
:
130524
|
134264
|
134265
|
243137
| 243138 |
251636