# HG changeset patch # User dadubrow # Date 1276109912 18000 # Node ID 52ab0fedbbffa83ed8bd2bb1d4bdf94e6b064bd2 # Parent a0ba21f7cb12b2c243dbab487dfd4a16be953fbb change context id for frank diff -r a0ba21f7cb12 -r 52ab0fedbbff core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/view/DiscoveryView.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/view/DiscoveryView.java Wed Jun 09 11:35:51 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/view/DiscoveryView.java Wed Jun 09 13:58:32 2010 -0500 @@ -9,8 +9,11 @@ import java.net.URISyntaxException; import java.net.URL; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Set; @@ -27,7 +30,12 @@ import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogConfiguration; import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogViewer; 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.operations.ProvisioningSession; +import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; import org.eclipse.equinox.p2.ui.ProvisioningUI; @@ -86,7 +94,7 @@ // Create the help context id for the viewer's control PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), - "com.nokia.carbide.discovery.ui.view.DiscoveryView.viewer"); //$NON-NLS-1$ + "com.nokia.carbide.discovery.ui.view.DiscoveryView.catalogviewer"); //$NON-NLS-1$ makeActions(); contributeToActionBars(); } @@ -257,6 +265,20 @@ artifactManager.addRepository(uri); } defaultUI.openInstallWizard(null, null, null); + + String profileId = defaultUI.getProfileId(); + IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); + IProfile profile = profileRegistry.getProfile(profileId); + IQueryResult queryResult = profile.query(QueryUtil.createIUGroupQuery(), null); + List list = new ArrayList(); + for (Iterator iter = queryResult.iterator(); iter.hasNext();) { + IInstallableUnit iu = iter.next(); + list.add(iu.getId() + "|" + iu.getVersion()); + } + Collections.sort(list); + for (String s : list) { + System.out.println(s); + } } private Collection getCatalogURIs() {