1 11 package org.eclipse.update.internal.core; 12 13 import java.util.ArrayList ; 14 15 import org.eclipse.core.runtime.*; 16 import org.eclipse.update.configurator.*; 17 import org.eclipse.update.internal.configurator.FeatureEntry; 18 19 22 public class ProductProvider implements IProductProvider { 23 26 public IProduct[] getProducts() { 27 IPlatformConfiguration configuration = ConfiguratorUtils.getCurrentPlatformConfiguration(); 28 if (configuration == null) 29 return new IProduct[0]; 30 IPlatformConfiguration.IFeatureEntry[] features = configuration.getConfiguredFeatureEntries(); 31 ArrayList primaryFeatures = new ArrayList (); 32 for (int i = 0; i < features.length; i++) 33 if (features[i].canBePrimary() && (features[i] instanceof FeatureEntry)) 34 primaryFeatures.add(new FeatureEntryWrapper((FeatureEntry) features[i])); 35 return (IProduct[]) primaryFeatures.toArray(new IProduct[primaryFeatures.size()]); 37 } 38 39 42 public String getName() { 43 return Messages.ProductProvider; 44 } 45 } 46 | Popular Tags |