/** * Gets a list of all the bundles that can be added as implicit dependencies * * @return list of possible dependencies */ protected BundleInfo[] getValidBundles() throws CoreException { NameVersionDescriptor[] current = getTargetDefinition().getImplicitDependencies(); Set<String> currentBundles = new HashSet<String>(); if (current != null) { for (int i = 0; i < current.length; i++) { if (!currentBundles.contains(current[i].getId())) { currentBundles.add(current[i].getId()); } } } List<BundleInfo> targetBundles = new ArrayList<BundleInfo>(); TargetBundle[] allTargetBundles = getTargetDefinition().getAllBundles(); if (allTargetBundles == null || allTargetBundles.length == 0) { throw new CoreException( new Status( IStatus.WARNING, PDEPlugin.getPluginId(), PDEUIMessages.ImplicitDependenciesSection_0)); } for (int i = 0; i < allTargetBundles.length; i++) { BundleInfo bundleInfo = allTargetBundles[i].getBundleInfo(); if (!currentBundles.contains(bundleInfo.getSymbolicName())) { currentBundles.add(bundleInfo.getSymbolicName()); // to avoid duplicate entries targetBundles.add(bundleInfo); } } return targetBundles.toArray(new BundleInfo[targetBundles.size()]); }
protected void fillIdMapsTable() { // fill user idmaps from plugin.xml fillIdMaps(true); // fill user idmaps from Preference Store fillIdMaps(false); // add user idmaps that have ordered entries but no id mappings // they do not appear in the preference store with name IDMAP_PREFERENCE_NAME Set OrderedKeys = fOrderedElements.keySet(); Set IdMapKeys = fIdMaps.keySet(); for (Iterator iter_orderedElements = OrderedKeys.iterator(); iter_orderedElements.hasNext(); ) { String IdMapName = (String) iter_orderedElements.next(); if (!IdMapKeys.contains(IdMapName)) { IdMap idmap = new IdMap(IdMapName, false); ArrayList idmapOrdered = (ArrayList) fOrderedElements.get(IdMapName); setOrdered(idmap, idmapOrdered); newIdMapsTableItem(idmap, false); } } }