1 11 package org.eclipse.update.internal.configurator; 12 13 import java.util.*; 14 15 import org.eclipse.core.runtime.*; 16 import org.eclipse.update.configurator.*; 17 18 21 public class ProductProvider implements IProductProvider{ 22 25 public IProduct[] getProducts() { 26 IPlatformConfiguration configuration = ConfiguratorUtils.getCurrentPlatformConfiguration(); 27 if (configuration == null) 28 return new IProduct[0]; 29 else { 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()) 34 primaryFeatures.add(features[i]); 35 return (IProduct[])primaryFeatures.toArray(new IProduct[primaryFeatures.size()]); 37 } 38 } 39 40 43 public String getName() { 44 return Messages.ProductProvider; 45 } 46 } 47 | Popular Tags |