mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added method for loading features from custom xml file #IDEA-171797
This commit is contained in:
+12
@@ -16,6 +16,10 @@
|
||||
package com.intellij.featureStatistics;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
@@ -29,4 +33,12 @@ public abstract class ProductivityFeaturesProvider {
|
||||
public abstract GroupDescriptor[] getGroupDescriptors();
|
||||
|
||||
public abstract ApplicabilityFilter[] getApplicabilityFilters();
|
||||
|
||||
/**
|
||||
* @return list of xml file urls with features configurations
|
||||
*/
|
||||
@NotNull
|
||||
public Collection<String> getXmlFilesUrls() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -85,6 +85,16 @@ public class ProductivityFeaturesRegistryImpl extends ProductivityFeaturesRegist
|
||||
|
||||
private void loadFeaturesFromProviders(ProductivityFeaturesProvider[] providers) {
|
||||
for (ProductivityFeaturesProvider provider : providers) {
|
||||
|
||||
for (String xmlUrl : provider.getXmlFilesUrls()) {
|
||||
try {
|
||||
readFromXml(xmlUrl);
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.error("Error while reading " + xmlUrl + " from " + provider + ": " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
final GroupDescriptor[] groupDescriptors = provider.getGroupDescriptors();
|
||||
if (groupDescriptors != null) {
|
||||
for (GroupDescriptor groupDescriptor : groupDescriptors) {
|
||||
|
||||
Reference in New Issue
Block a user