use of org.talend.core.model.components.AbstractComponentsProvider in project tdi-studio-se by Talend.
the class ComponentsFactory method loadUserComponentsFromComponentsProviderExtension.
@Override
public void loadUserComponentsFromComponentsProviderExtension() {
getComponents();
ComponentsProviderManager.getInstance().getProviders();
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
AbstractComponentsProvider componentsProvider = componentsProviderManager.loadUserComponentsProvidersFromExtension();
// remove old user components
if (!this.userComponentList.isEmpty()) {
ComponentsCache cache = ComponentManager.getComponentCache();
for (IComponent component : userComponentList) {
if (componentList != null && componentList.contains(component)) {
componentList.remove(component);
}
if (customComponentList.contains(component)) {
customComponentList.remove(component);
}
if (cache.getComponentEntryMap().get(component.getName()) != null) {
cache.getComponentEntryMap().remove(component.getName());
ComponentManager.setModified(true);
}
}
}
loadComponents(componentsProvider);
ComponentManager.saveResource();
}
use of org.talend.core.model.components.AbstractComponentsProvider in project tdi-studio-se by Talend.
the class ComponentsProviderManager method loadComponentsProvidersFromExtension.
private void loadComponentsProvidersFromExtension() {
if (providers == null) {
providers = new ArrayList<AbstractComponentsProvider>();
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
//$NON-NLS-1$
IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint("org.talend.core.components_provider");
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configurationElements = extension.getConfigurationElements();
for (IConfigurationElement configurationElement : configurationElements) {
//$NON-NLS-1$
String id = configurationElement.getAttribute("id");
//$NON-NLS-1$
String folderName = configurationElement.getAttribute("folderName");
String contributerName = configurationElement.getContributor().getName();
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (!brandingService.isPoweredOnlyCamel() && id.equals("org.talend.designer.camel.components.localprovider.CamelLocalComponentsProvider")) {
folderName = "camel";
}
try {
AbstractComponentsProvider componentsProvider = (AbstractComponentsProvider) configurationElement.createExecutableExtension(//$NON-NLS-1$
"class");
componentsProvider.setId(id);
componentsProvider.setFolderName(folderName);
componentsProvider.setContributer(contributerName);
providers.add(componentsProvider);
} catch (CoreException e) {
//$NON-NLS-1$
log.error("unable to load component provider" + id, e);
}
}
}
}
}
Aggregations