当前位置: 首页>>代码示例>>Java>>正文


Java IExtensionRegistry.getConfigurationElementsFor方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.IExtensionRegistry.getConfigurationElementsFor方法的典型用法代码示例。如果您正苦于以下问题:Java IExtensionRegistry.getConfigurationElementsFor方法的具体用法?Java IExtensionRegistry.getConfigurationElementsFor怎么用?Java IExtensionRegistry.getConfigurationElementsFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.IExtensionRegistry的用法示例。


在下文中一共展示了IExtensionRegistry.getConfigurationElementsFor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Reads information from extensions defined in plugin.xml files.
 */
private void initialize() {
	if (isInitialized)
		throw new IllegalStateException("may invoke method initialize() only once");
	isInitialized = true;

	final IExtensionRegistry registry = RegistryFactory.getRegistry();
	if (registry != null) {
		final IConfigurationElement[] configElems = registry
				.getConfigurationElementsFor(TESTERS_EXTENSION_POINT_ID);

		for (IConfigurationElement elem : configElems) {
			try {
				final EclipseTesterDescriptor descriptor = new EclipseTesterDescriptor(elem);
				injector.injectMembers(descriptor);
				register(descriptor);
			} catch (Exception ex) {
				log.error("Error while reading extensions for extension point " + TESTERS_EXTENSION_POINT_ID, ex);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:TesterRegistry.java

示例2: initialize

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Reads information from extensions defined in plugin.xml files.
 */
private void initialize() {
	if (isInitialized)
		throw new IllegalStateException("may invoke method initialize() only once");
	isInitialized = true;

	final IExtensionRegistry registry = RegistryFactory.getRegistry();
	if (registry != null) {
		final IConfigurationElement[] configElems = registry
				.getConfigurationElementsFor(RUNNERS_EXTENSION_POINT_ID);

		for (IConfigurationElement elem : configElems) {
			try {
				final EclipseRunnerDescriptor descriptor = new EclipseRunnerDescriptor(elem);
				injector.injectMembers(descriptor);
				register(descriptor);
			} catch (Exception ex) {
				log.error("Error while reading extensions for extension point " + RUNNERS_EXTENSION_POINT_ID, ex);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:RunnerRegistry.java

示例3: loadCodeLensProviders

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Load the SourceMap language supports.
 */
private synchronized void loadCodeLensProviders() {
	if (codeLensProviderLoaded) {
		return;
	}

	try {
		IExtensionRegistry registry = Platform.getExtensionRegistry();
		if (registry == null) {
			return;
		}
		IConfigurationElement[] cf = registry.getConfigurationElementsFor(CodeLensPlugin.PLUGIN_ID,
				EXTENSION_CODELENS_PROVIDERS);
		loadCodeLensProvidersFromExtension(cf);
	} finally {
		codeLensProviderLoaded = true;
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:21,代码来源:CodeLensProviderRegistry.java

示例4: loadFactories

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Load the SourceMap language supports.
 */
private synchronized void loadFactories() {
	if (loaded) {
		return;
	}

	try {
		IExtensionRegistry registry = Platform.getExtensionRegistry();
		if (registry == null) {
			return;
		}
		IConfigurationElement[] cf = registry.getConfigurationElementsFor(CodeLensEditorPlugin.PLUGIN_ID,
				EXTENSION_CODELENS_CONTROLLER_FACTORIES);
		loadCodeLensProvidersFromExtension(cf);
	} finally {
		loaded = true;
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:21,代码来源:CodeLensControllerRegistry.java

示例5: VariablesProviderRegistry

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public VariablesProviderRegistry() {

	List<VariableProvider> variableProviders=new ArrayList<>();
	
	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IConfigurationElement[] config = registry.getConfigurationElementsFor(VARIABLE_PROVIDER_ID);
	try {
		for (IConfigurationElement e : config) {
			final Object o = e.createExecutableExtension("class");
			if (o instanceof VariableProvider) {
				VariableProvider provider = (VariableProvider) o;
				variableProviders.add(provider);
			}
		}
		
	} catch (CoreException ex) {
		EclipseUtil.logError("Was not able to initialize variable providers registry", ex);
	}
	
	providers = Collections.unmodifiableList(variableProviders);
	
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:23,代码来源:VariablesProviderRegistry.java

示例6: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionOptionProvider provider = (eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					eu.hyvar.feature.expression.resource.hyexpression.util.HyexpressionMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new eu.hyvar.feature.expression.resource.hyexpression.util.HyexpressionRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyexpressionEclipseProxy.java

示例7: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestOptionProvider provider = (eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					eu.hyvar.mspl.manifest.resource.hymanifest.util.HymanifestMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new eu.hyvar.mspl.manifest.resource.hymanifest.util.HymanifestRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymanifestEclipseProxy.java

示例8: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				eu.hyvar.feature.mapping.resource.hymapping.IHymappingOptionProvider provider = (eu.hyvar.feature.mapping.resource.hymapping.IHymappingOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					eu.hyvar.feature.mapping.resource.hymapping.util.HymappingMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new eu.hyvar.feature.mapping.resource.hymapping.util.HymappingRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymappingEclipseProxy.java

示例9: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsOptionProvider provider = (eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					eu.hyvar.feature.constraint.resource.hyconstraints.util.HyconstraintsMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new eu.hyvar.feature.constraint.resource.hyconstraints.util.HyconstraintsRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyconstraintsEclipseProxy.java

示例10: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaPlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaOptionProvider provider = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					eu.hyvar.context.contextValidity.resource.hyvalidityformula.util.HyvalidityformulaMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new eu.hyvar.context.contextValidity.resource.hyvalidityformula.util.HyvalidityformulaRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HyvalidityformulaEclipseProxy.java

示例11: getAllPropertyContributions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Retrieves all property contributions from the checkcfg property extension point.
 *
 * @return the collection of all available property contributions, never {@code null}
 */
public static Collection<ICheckCfgPropertySpecification> getAllPropertyContributions() {
  Set<ICheckCfgPropertySpecification> contributions = Sets.newHashSet();
  IExtensionRegistry registry = Platform.getExtensionRegistry();
  if (registry != null) { // registry is null in the standalone builder...
    IConfigurationElement[] elements = registry.getConfigurationElementsFor(PROPERTY_EXTENSION_POINT);
    for (IConfigurationElement element : elements) {
      try {
        contributions.add((ICheckCfgPropertySpecification) element.createExecutableExtension(PROPERTY_EXECUTABLE_EXTENSION_ATTRIBUTE));
      } catch (CoreException e) {
        LOGGER.log(Level.WARN, "Failed to instantiate property from " + element.getContributor(), e);
      }
    }
  }
  return contributions;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:CheckCfgUtil.java

示例12: getDefaultLoadOptionProviderExtensions

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
/**
 * Adds all registered load option provider extension to the given map. Load
 * option providers can be used to set default options for loading resources (e.g.
 * input stream pre-processors).
 */
public void getDefaultLoadOptionProviderExtensions(Map<Object, Object> optionsMap) {
	if (Platform.isRunning()) {
		// find default load option providers
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement configurationElements[] = extensionRegistry.getConfigurationElementsFor(de.darwinspl.preferences.resource.dwprofile.mopp.DwprofilePlugin.EP_DEFAULT_LOAD_OPTIONS_ID);
		for (IConfigurationElement element : configurationElements) {
			try {
				de.darwinspl.preferences.resource.dwprofile.IDwprofileOptionProvider provider = (de.darwinspl.preferences.resource.dwprofile.IDwprofileOptionProvider) element.createExecutableExtension("class");
				final Map<?, ?> options = provider.getOptions();
				final Collection<?> keys = options.keySet();
				for (Object key : keys) {
					de.darwinspl.preferences.resource.dwprofile.util.DwprofileMapUtil.putAndMergeKeys(optionsMap, key, options.get(key));
				}
			} catch (CoreException ce) {
				new de.darwinspl.preferences.resource.dwprofile.util.DwprofileRuntimeUtil().logError("Exception while getting default options.", ce);
			}
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:DwprofileEclipseProxy.java

示例13: getClientWrappers

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public synchronized Map getClientWrappers() {
	if (clients == null) {
		clients = new HashMap();
		IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
		IConfigurationElement[] configurationElements = pluginRegistry.getConfigurationElementsFor("org.tigris.subversion.clientadapter.wrapper");
		for (int i = 0; i < configurationElements.length; i++) {
			IConfigurationElement configurationElement = configurationElements[i];
			try {
				ISVNClientWrapper client = (ISVNClientWrapper)configurationElement.createExecutableExtension("class");
				client.setDisplayName(configurationElement.getAttribute("name"));
				clients.put(client.getAdapterID(), client);
			} catch(Exception e) {
			}
		}	
	}
	return clients;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:AdapterManager.java

示例14: getRepositorySourceProviders

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
public static ISVNRepositorySourceProvider[] getRepositorySourceProviders() throws Exception {
	if (repositorySourceProviders == null) {
		List<ISVNRepositorySourceProvider> repositorySourceProviderList = new ArrayList<ISVNRepositorySourceProvider>();
		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
		IConfigurationElement[] configurationElements = extensionRegistry.getConfigurationElementsFor(REPOSITORY_SOURCE_PROVIDERS);
		for (int i = 0; i < configurationElements.length; i++) {
			IConfigurationElement configurationElement = configurationElements[i];
			ISVNRepositorySourceProvider repositorySourceProvider = (ISVNRepositorySourceProvider)configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
			repositorySourceProvider.setId(configurationElement.getAttribute("id")); //$NON-NLS-1$
			repositorySourceProviderList.add(repositorySourceProvider);
		}
		repositorySourceProviders = new ISVNRepositorySourceProvider[repositorySourceProviderList.size()];
		repositorySourceProviderList.toArray(repositorySourceProviders);
		Arrays.sort(repositorySourceProviders, new Comparator<ISVNRepositorySourceProvider>() {
			public int compare(ISVNRepositorySourceProvider o1, ISVNRepositorySourceProvider o2) {
				return o1.getName().compareTo(o2.getName());
			}		
		});
	}
	return repositorySourceProviders;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:SVNUIPlugin.java

示例15: loadExtensionResourceParticipants

import org.eclipse.core.runtime.IExtensionRegistry; //导入方法依赖的package包/类
private synchronized void loadExtensionResourceParticipants() {
	if (extensionResourceParticipantsLoaded)
		return;
	// Immediately set the flag, as to ensure that this method is never
	// called twice
	extensionResourceParticipantsLoaded = true;

	Trace.trace(Trace.EXTENSION_POINT, "->- Loading .typeScriptResourceParticipants extension point ->-");

	IExtensionRegistry registry = Platform.getExtensionRegistry();
	IConfigurationElement[] cf = registry.getConfigurationElementsFor(TypeScriptCorePlugin.PLUGIN_ID,
			EXTENSION_TYPESCRIPT_RESOURCE_PARTICIPANTS);
	
	addExtensionResourceParticipants(cf);
	addRegistryListenerIfNeeded();

	Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .typeScriptResourceParticipants extension point -<-");
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:19,代码来源:IDEResourcesManager.java


注:本文中的org.eclipse.core.runtime.IExtensionRegistry.getConfigurationElementsFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。