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 121016 Details for
Bug 259348
[plug-in registry] show service properties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
shows service properties in Properties View
pde-runtime-serviceproperties-2-propertyview.patch (text/plain), 6.27 KB, created by
Wolfgang Schell
on 2008-12-20 20:31:58 EST
(
hide
)
Description:
shows service properties in Properties View
Filename:
MIME Type:
Creator:
Wolfgang Schell
Created:
2008-12-20 20:31:58 EST
Size:
6.27 KB
patch
obsolete
>Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.runtime/plugin.xml,v >retrieving revision 1.49 >diff -u -r1.49 plugin.xml >--- plugin.xml 13 Nov 2008 14:41:21 -0000 1.49 >+++ plugin.xml 21 Dec 2008 01:16:21 -0000 >@@ -62,5 +62,15 @@ > commandId="org.eclipse.pde.runtime.spy.commands.spyCommand"> > </handler> > </extension> >+ <extension >+ point="org.eclipse.core.runtime.adapters"> >+ <factory >+ adaptableType="org.eclipse.pde.internal.runtime.registry.model.ServiceRegistration" >+ class="org.eclipse.pde.internal.runtime.registry.ServiceRegistrationAdapterFactory"> >+ <adapter >+ type="org.eclipse.ui.views.properties.IPropertySource"> >+ </adapter> >+ </factory> >+ </extension> > > </plugin> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.runtime/META-INF/MANIFEST.MF,v >retrieving revision 1.27 >diff -u -r1.27 MANIFEST.MF >--- META-INF/MANIFEST.MF 20 Oct 2008 22:10:47 -0000 1.27 >+++ META-INF/MANIFEST.MF 21 Dec 2008 01:16:21 -0000 >@@ -13,7 +13,8 @@ > org.eclipse.core.resources;bundle-version="[3.3.0,4.0.0)";resolution:=optional, > org.eclipse.jdt.ui;bundle-version="[3.3.0,4.0.0)";resolution:=optional, > org.eclipse.pde.ui;bundle-version="[3.3.0,4.0.0)";resolution:=optional, >- org.eclipse.help;bundle-version="[3.3.0,4.0.0)";resolution:=optional >+ org.eclipse.help;bundle-version="[3.3.0,4.0.0)";resolution:=optional, >+ org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)";resolution:=optional > Eclipse-LazyStart: true > Export-Package: org.eclipse.pde.internal.runtime;x-internal:=true, > org.eclipse.pde.internal.runtime.registry;x-internal:=true, >Index: src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationAdapterFactory.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationAdapterFactory.java >diff -N src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationAdapterFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationAdapterFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.pde.internal.runtime.registry; >+ >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.pde.internal.runtime.registry.model.ServiceRegistration; >+import org.eclipse.ui.views.properties.IPropertySource; >+ >+public class ServiceRegistrationAdapterFactory implements IAdapterFactory { >+ >+ public Object getAdapter(Object adaptableObject, Class adapterType) { >+ Object adapter = null; >+ >+ if (adaptableObject instanceof ServiceRegistration) { >+ ServiceRegistration serviceRegistration = (ServiceRegistration) adaptableObject; >+ if (adapterType == IPropertySource.class) { >+ adapter = new ServiceRegistrationPropertySource(serviceRegistration); >+ } >+ } >+ >+ return adapter; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() >+ */ >+ public Class[] getAdapterList() { >+ return new Class[] {IPropertySource.class,}; >+ } >+ >+} >Index: src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationPropertySource.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationPropertySource.java >diff -N src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationPropertySource.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/runtime/registry/ServiceRegistrationPropertySource.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.pde.internal.runtime.registry; >+ >+import org.eclipse.pde.internal.runtime.registry.model.Attribute; >+import org.eclipse.pde.internal.runtime.registry.model.ServiceRegistration; >+import org.eclipse.ui.views.properties.*; >+ >+public class ServiceRegistrationPropertySource implements IPropertySource { >+ private final ServiceRegistration serviceRegistration; >+ >+ public ServiceRegistrationPropertySource(ServiceRegistration serviceRegistration) { >+ this.serviceRegistration = serviceRegistration; >+ } >+ >+ public Object getEditableValue() { >+ return serviceRegistration; >+ } >+ >+ public IPropertyDescriptor[] getPropertyDescriptors() { >+ Attribute[] attributes = serviceRegistration.getAttributes(); >+ IPropertyDescriptor[] descriptors = new IPropertyDescriptor[(attributes != null ? attributes.length : 0)]; >+ if (attributes != null) { >+ for (int p = 0; p < attributes.length; p++) { >+ Attribute attribute = attributes[p]; >+ String name = attribute.getName(); >+ descriptors[p] = new PropertyDescriptor(name, name); >+ } >+ } >+ return descriptors; >+ } >+ >+ public Object getPropertyValue(Object id) { >+ Attribute attribute = serviceRegistration.getAttribute((String) id); >+ if (attribute != null) { >+ return attribute.getValue(); >+ } >+ return null; >+ } >+ >+ public boolean isPropertySet(Object id) { >+ return (serviceRegistration.getAttribute((String) id) != null); >+ } >+ >+ public void resetPropertyValue(Object id) { >+ // ignore >+ } >+ >+ public void setPropertyValue(Object id, Object value) { >+ // ignore >+ } >+}
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 259348
:
120927
|
121015
|
121016
|
121346
|
121608
|
121609
|
121611
|
121612
|
121618