@Override public String getPrimaryFeatureIdentifier() { // Return the product if defined in system properties String primaryFeatureId = ConfigurationActivator.getBundleContext().getProperty(ECLIPSE_PRODUCT); if (primaryFeatureId != null) { // check if feature exists IFeatureEntry feature = findConfiguredFeatureEntry(primaryFeatureId); if (feature != null && feature.canBePrimary()) return primaryFeatureId; } return null; }
return; String key = entry.getFeatureIdentifier(); if (key == null) return; URL url = new URL(sites[i].getURL(), FEATURES + "/" + entry.getFeatureIdentifier() + "_" + entry.getFeatureVersion() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { url = resolvePlatformURL(url, getBasePathLocation(url, config.getInstallURL(), config.getURL())); sites[i].addFeatureEntry(entry); else { url = new URL(sites[i].getURL(), FEATURES + "/" + entry.getFeatureIdentifier() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ if (new File(url.getFile()).exists()) sites[i].addFeatureEntry(entry);
public void addFeatureEntry(IFeatureEntry feature) { if (featureEntries == null) featureEntries = new HashMap<>(); // Make sure we keep the larger version of same feature IFeatureEntry existing = featureEntries.get(feature.getFeatureIdentifier()); if (existing != null) { VersionedIdentifier existingVersion = new VersionedIdentifier(existing.getFeatureIdentifier(), existing.getFeatureVersion()); VersionedIdentifier newVersion = new VersionedIdentifier(feature.getFeatureIdentifier(), feature.getFeatureVersion()); if (existingVersion.getVersion().compareTo(newVersion.getVersion()) < 0) { featureEntries.put(feature.getFeatureIdentifier(), feature); pluginsChangeStamp = 0; } else if (existingVersion.equals(newVersion)) { // log error if same feature version/id but a different url if (feature instanceof FeatureEntry && existing instanceof FeatureEntry && !((FeatureEntry)feature).getURL().equals(((FeatureEntry)existing).getURL())) Utils.log(NLS.bind(Messages.SiteEntry_duplicateFeature, (new String[] { getURL().toExternalForm(), existing.getFeatureIdentifier() }))); } } else { featureEntries.put(feature.getFeatureIdentifier(), feature); pluginsChangeStamp = 0; } if (feature instanceof FeatureEntry) ((FeatureEntry)feature).setSite(this); }
public String getApplicationIdentifier() { // Return the app if defined in system properties String application = ConfigurationActivator.getBundleContext().getProperty(ECLIPSE_APPLICATION); if (application != null) return application; // Otherwise, try to get it from the primary feature (aka product) String feature = getPrimaryFeatureIdentifier(); // lookup application for feature (specified or defaulted) if (feature != null) { IFeatureEntry fe = findConfiguredFeatureEntry(feature); if (fe != null) { if (fe.getFeatureApplication() != null) return fe.getFeatureApplication(); } } // return hardcoded default if we failed return DEFAULT_FEATURE_APPLICATION; }
public boolean unconfigureFeatureEntry(IFeatureEntry feature) { FeatureEntry existingFeature = getFeatureEntry(feature.getFeatureIdentifier()); if (existingFeature != null) featureEntries.remove(existingFeature.getFeatureIdentifier()); return existingFeature != null; }
@Override public synchronized void unconfigureFeatureEntry(IFeatureEntry entry) { if (entry == null) return; String key = entry.getFeatureIdentifier(); if (key == null) return; config.unconfigureFeatureEntry(entry); }