diff options
| author | Scott Lewis | 2015-03-26 06:51:34 +0000 |
|---|---|---|
| committer | Vikas Chandra | 2015-03-26 06:51:34 +0000 |
| commit | 111b06bd9c13dc46d49273ccf58a435e33d21efd (patch) | |
| tree | 0bcf6fc3fd785c4de7a74c8bd56c750d7acf10b5 | |
| parent | d9d321ad68a91bc696b2f3369c4c2ae07fa653a9 (diff) | |
| download | eclipse.pde.ui-111b06bd9c13dc46d49273ccf58a435e33d21efd.tar.gz eclipse.pde.ui-111b06bd9c13dc46d49273ccf58a435e33d21efd.tar.xz eclipse.pde.ui-111b06bd9c13dc46d49273ccf58a435e33d21efd.zip | |
Bug 270684 - [patch] [plug-in registry] add support for OSGi Remote
Services/Remote Service Admin
Signed-off-by: Scott Lewis <slewis@composent.com >
5 files changed, 37 insertions, 8 deletions
diff --git a/ui/org.eclipse.pde.runtime/icons/obj16/rsvcproxy_obj.gif b/ui/org.eclipse.pde.runtime/icons/obj16/rsvcproxy_obj.gif Binary files differnew file mode 100644 index 0000000000..ef2c5fd711 --- /dev/null +++ b/ui/org.eclipse.pde.runtime/icons/obj16/rsvcproxy_obj.gif 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 62812c3656..1b83d0989e 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -79,6 +79,7 @@ public class PDERuntimePluginImages { 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 5516cafe97..e2a72101a0 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -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.*; 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 @@ public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implem private Image fServicePropertyImage; private Image fFragmentImage; private Image fPackageImage; + private Image fRemoteServiceProxyImage; private RegistryBrowser fRegistryBrowser; public RegistryBrowserLabelProvider(RegistryBrowser browser) { @@ -70,6 +70,7 @@ public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implem 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 @@ public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implem 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 @@ public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implem } 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 e6e733716b..3135c23eb7 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -289,7 +289,7 @@ public class LocalRegistryBackend implements IRegistryEventListener, BundleListe 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 8f7fc44d16..ec8bbf1b7b 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -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() { |
