Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2011 Code 9 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: Code 9 - initial API and implementation IBM - ongoing development /
package org.eclipse.equinox.internal.p2.updatesite;
import java.util.*;
import  org.eclipse.equinox.p2.publisher.eclipse.*;
public class RemoteFeaturesAction extends FeaturesAction {
	public RemoteFeaturesAction(UpdateSite updateSite) {
		super((Feature[]) null);
		this. = updateSite;
	}
	public RemoteFeaturesAction(Feature[] features) {
		super(features);
	}
	public IStatus perform(IPublisherInfo publisherInfoIPublisherResult resultsIProgressMonitor monitor) {
		try {
			this. = publisherInfo;
			features = .loadFeatures(monitor);
			return super.perform(publisherInforesultsmonitor);
catch (ProvisionException e) {
catch (OperationCanceledException e) {
		}
	}
	protected void generateFeatureIUs(Feature[] featureListIPublisherResult result) {
		Map<StringStringextraProperties = new HashMap<StringString>();
		for (int i = 0; i < featureList.length; i++) {
			Feature feature = featureList[i];
			FeatureEntry[] featureEntries = feature.getEntries();
			for (int j = 0; j < featureEntries.length; j++) {
				FeatureEntry entry = featureEntries[j];
				if (entry.isPlugin() && !entry.isRequires()) {
					Dictionary<StringStringmockManifest = new Hashtable<StringString>();
					mockManifest.put("Manifest-Version""1.0"); //$NON-NLS-1$ //$NON-NLS-2$
					mockManifest.put("Bundle-ManifestVersion""2"); //$NON-NLS-1$ //$NON-NLS-2$
					mockManifest.put("Bundle-SymbolicName"entry.getId()); //$NON-NLS-1$
					mockManifest.put("Bundle-Version"entry.getVersion()); //$NON-NLS-1$
					BundleDescription bundleDescription = BundlesAction.createBundleDescription(mockManifestnull);
					IArtifactKey key = BundlesAction.createBundleArtifactKey(entry.getId(), entry.getVersion());
					IInstallableUnit[] bundleIUs = EclipsePublisherHelper.createEclipseIU(bundleDescriptionentry.isUnpack(), keyextraProperties);
					for (int n = 0; n < bundleIUs.lengthn++)
						result.addIU(bundleIUs[n], .);
				}
			}
			IInstallableUnit featureIU = createFeatureJarIU(featurenew PublisherInfo());
			childIUs.add(featureIU);
			IInstallableUnit groupIU = createGroupIU(featurechildIUsnew PublisherInfo());
			result.addIU(featureIU.);
			result.addIU(groupIU.);
			generateSiteReferences(featureresult, info);
		}
	}
New to GrepCode? Check out our FAQ X