|
Lines 10-17
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.pde.internal.runtime.registry; |
11 |
package org.eclipse.pde.internal.runtime.registry; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.pde.internal.runtime.PDERuntimeMessages; |
|
|
| 14 |
|
| 15 |
import java.util.Arrays; |
13 |
import java.util.Arrays; |
| 16 |
import org.eclipse.jface.resource.ImageDescriptor; |
14 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 17 |
import org.eclipse.jface.viewers.*; |
15 |
import org.eclipse.jface.viewers.*; |
|
Lines 20-25
Link Here
|
| 20 |
import org.eclipse.pde.internal.runtime.registry.model.*; |
18 |
import org.eclipse.pde.internal.runtime.registry.model.*; |
| 21 |
import org.eclipse.swt.graphics.Image; |
19 |
import org.eclipse.swt.graphics.Image; |
| 22 |
import org.osgi.framework.Constants; |
20 |
import org.osgi.framework.Constants; |
|
|
21 |
import org.osgi.framework.ServiceReference; |
| 23 |
|
22 |
|
| 24 |
public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implements ILabelProvider { |
23 |
public class RegistryBrowserLabelProvider extends StyledCellLabelProvider implements ILabelProvider { |
| 25 |
|
24 |
|
|
Lines 47-52
Link Here
|
| 47 |
private Image fServicePropertyImage; |
46 |
private Image fServicePropertyImage; |
| 48 |
private Image fFragmentImage; |
47 |
private Image fFragmentImage; |
| 49 |
private Image fPackageImage; |
48 |
private Image fPackageImage; |
|
|
49 |
private Image fRemoteServiceProxyImage; |
| 50 |
private RegistryBrowser fRegistryBrowser; |
50 |
private RegistryBrowser fRegistryBrowser; |
| 51 |
|
51 |
|
| 52 |
public RegistryBrowserLabelProvider(RegistryBrowser browser) { |
52 |
public RegistryBrowserLabelProvider(RegistryBrowser browser) { |
|
Lines 70-75
Link Here
|
| 70 |
fPluginsImage = PDERuntimePluginImages.DESC_PLUGINS_OBJ.createImage(); |
70 |
fPluginsImage = PDERuntimePluginImages.DESC_PLUGINS_OBJ.createImage(); |
| 71 |
fFragmentImage = PDERuntimePluginImages.DESC_FRAGMENT_OBJ.createImage(); |
71 |
fFragmentImage = PDERuntimePluginImages.DESC_FRAGMENT_OBJ.createImage(); |
| 72 |
fPackageImage = PDERuntimePluginImages.DESC_PACKAGE_OBJ.createImage(); |
72 |
fPackageImage = PDERuntimePluginImages.DESC_PACKAGE_OBJ.createImage(); |
|
|
73 |
fRemoteServiceProxyImage = PDERuntimePluginImages.DESC_REMOTE_SERVICE_PROXY_OBJ.createImage(); |
| 73 |
|
74 |
|
| 74 |
ImageDescriptor activePluginDesc = new OverlayIcon(PDERuntimePluginImages.DESC_PLUGIN_OBJ, new ImageDescriptor[][] {{PDERuntimePluginImages.DESC_RUN_CO}}); |
75 |
ImageDescriptor activePluginDesc = new OverlayIcon(PDERuntimePluginImages.DESC_PLUGIN_OBJ, new ImageDescriptor[][] {{PDERuntimePluginImages.DESC_RUN_CO}}); |
| 75 |
fActivePluginImage = activePluginDesc.createImage(); |
76 |
fActivePluginImage = activePluginDesc.createImage(); |
|
Lines 115-120
Link Here
|
| 115 |
fPackageImage.dispose(); |
116 |
fPackageImage.dispose(); |
| 116 |
} |
117 |
} |
| 117 |
|
118 |
|
|
|
119 |
private boolean isProxyService(ServiceReference ref) { |
| 120 |
if (ref == null) |
| 121 |
return false; |
| 122 |
Object o = ref.getProperty(Constants.SERVICE_IMPORTED); |
| 123 |
return (o != null); |
| 124 |
} |
| 125 |
|
| 126 |
private boolean isProxyService(ServiceRegistration reg) { |
| 127 |
if (reg == null) |
| 128 |
return false; |
| 129 |
Object o = reg.getProperty(Constants.SERVICE_IMPORTED); |
| 130 |
return (o != null); |
| 131 |
} |
| 132 |
|
| 118 |
public Image getImage(Object element) { |
133 |
public Image getImage(Object element) { |
| 119 |
if (element instanceof Bundle) { |
134 |
if (element instanceof Bundle) { |
| 120 |
Bundle bundle = (Bundle) element; |
135 |
Bundle bundle = (Bundle) element; |
|
Lines 139-148
Link Here
|
| 139 |
} |
154 |
} |
| 140 |
|
155 |
|
| 141 |
if (element instanceof ServiceName) { |
156 |
if (element instanceof ServiceName) { |
|
|
157 |
ServiceName serviceName = (ServiceName) element; |
| 158 |
if (isProxyService(serviceName.getServiceReference())) |
| 159 |
return fRemoteServiceProxyImage; |
| 142 |
return fServiceImage; |
160 |
return fServiceImage; |
| 143 |
} |
161 |
} |
| 144 |
|
162 |
|
| 145 |
if (element instanceof ServiceRegistration) { |
163 |
if (element instanceof ServiceRegistration) { |
|
|
164 |
ServiceRegistration reg = (ServiceRegistration) element; |
| 165 |
if (isProxyService(reg)) |
| 166 |
return fRemoteServiceProxyImage; |
| 146 |
return fPluginImage; |
167 |
return fPluginImage; |
| 147 |
} |
168 |
} |
| 148 |
|
169 |
|