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 205648 Details for
Bug 236709
p2 should register bundle groups
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.
work in progress
BundleGroupComponent.java (text/plain), 2.54 KB, created by
DJ Houghton
on 2011-10-20 11:43:42 EDT
(
hide
)
Description:
work in progress
Filename:
MIME Type:
Creator:
DJ Houghton
Created:
2011-10-20 11:43:42 EDT
Size:
2.54 KB
patch
obsolete
>package org.eclipse.equinox.internal.p2.touchpoint.eclipse; > >import java.util.ArrayList; >import java.util.Iterator; >import java.util.List; > >import org.eclipse.core.runtime.IBundleGroup; >import org.eclipse.core.runtime.IBundleGroupProvider; >import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; >import org.eclipse.equinox.p2.core.IProvisioningAgent; >import org.eclipse.equinox.p2.engine.IProfile; >import org.eclipse.equinox.p2.engine.IProfileRegistry; >import org.eclipse.equinox.p2.metadata.IInstallableUnit; >import org.eclipse.equinox.p2.query.IQueryResult; >import org.eclipse.equinox.p2.query.QueryUtil; >import org.osgi.framework.Bundle; > >public class BundleGroupComponent implements IBundleGroupProvider { > > public class IUBundleGroup implements IBundleGroup { > IInstallableUnit iu; > > public IUBundleGroup(IInstallableUnit iu) { > this.iu = iu; > } > > public String getIdentifier() { > return iu.getId(); > } > > public String getName() { > return iu.getProperty(IInstallableUnit.PROP_NAME); > } > > public String getVersion() { > return iu.getVersion().toString(); > } > > public String getDescription() { > return iu.getProperty(IInstallableUnit.PROP_DESCRIPTION); > } > > public String getProviderName() { > return iu.getProperty(IInstallableUnit.PROP_PROVIDER); > } > > public Bundle[] getBundles() { > // TODO Auto-generated method stub > return new Bundle[0]; > } > > public String getProperty(String key) { > return iu.getProperty(key); > } > > } > > public String getName() { > return "Equinox p2 Bundle Group Provider"; > } > > public IBundleGroup[] getBundleGroups() { > IProfile profile = getProfile(); > IQueryResult<IInstallableUnit> profileQueryResult = profile.query( > QueryUtil.createIUGroupQuery(), null); > List<IBundleGroup> result = new ArrayList<IBundleGroup>(); > for (Iterator<IInstallableUnit> it = profileQueryResult.iterator(); it > .hasNext();) { > IInstallableUnit iu = it.next(); > result.add(new IUBundleGroup(iu)); > } > return (IBundleGroup[]) result > .toArray(new IUBundleGroup[result.size()]); > } > > /* > * Return the current profile or null if it cannot be retrieved. > */ > public static IProfile getProfile() { > IProvisioningAgent agent = getAgent(); > IProfileRegistry profileRegistry = (IProfileRegistry) agent > .getService(IProfileRegistry.SERVICE_NAME); > if (profileRegistry == null) > return null; > return profileRegistry.getProfile(IProfileRegistry.SELF); > } > > private static IProvisioningAgent getAgent() { > return (IProvisioningAgent) ServiceHelper.getService( > Activator.getContext(), IProvisioningAgent.SERVICE_NAME); > } > >}
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 Raw
Actions:
View
Attachments on
bug 236709
:
205648
|
209697
|
209698