本文整理汇总了Java中org.eclipse.core.runtime.Platform.getExtensionRegistry方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.getExtensionRegistry方法的具体用法?Java Platform.getExtensionRegistry怎么用?Java Platform.getExtensionRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.Platform
的用法示例。
在下文中一共展示了Platform.getExtensionRegistry方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveLocators
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
* Retrieve all the locators registered with the extension point, and additionally store them in a cache.
*
* @return All locators registered with the extension point.
*/
public List<ILocator> retrieveLocators() {
if (locators == null) {
IExtensionRegistry reg = Platform.getExtensionRegistry();
IExtensionPoint ep = reg.getExtensionPoint("org.eclipse.gemoc.dsl.debug.locator");
IExtension[] extensions = ep.getExtensions();
ArrayList<ILocator> contributors = new ArrayList<ILocator>();
for (int i = 0; i < extensions.length; i++) {
IExtension ext = extensions[i];
IConfigurationElement[] ce = ext.getConfigurationElements();
for (int j = 0; j < ce.length; j++) {
ILocator locator;
try {
locator = (ILocator)ce[j].createExecutableExtension("class");
contributors.add(locator);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
locators = contributors;
}
return locators;
}
示例2: readExtensions
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
private static void readExtensions(Map<Class<? extends IScanPathModel>, Class<? extends IPointGenerator<?>>> gens,
Map<String, GeneratorInfo> tids) throws CoreException {
if (Platform.getExtensionRegistry()!=null) {
final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.generator");
for (IConfigurationElement e : eles) {
final IPointGenerator<?> generator = (IPointGenerator<?>)e.createExecutableExtension("class");
final IScanPathModel model = (IScanPathModel)e.createExecutableExtension("model");
final Class<? extends IScanPathModel> modelClass = model.getClass();
@SuppressWarnings("unchecked")
final Class<? extends IPointGenerator<?>> generatorClass = (Class<? extends IPointGenerator<?>>) generator.getClass();
gens.put(modelClass, generatorClass);
final GeneratorInfo info = new GeneratorInfo();
info.setModelClass(model.getClass());
info.setGeneratorClass(generator.getClass());
info.setLabel(e.getAttribute("label"));
info.setDescription(e.getAttribute("description"));
String id = e.getAttribute("id");
tids.put(id, info);
}
}
}
示例3: loadCodeLensProviders
import org.eclipse.core.runtime.Platform; //导入方法依赖的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;
}
}
示例4: loadFactories
import org.eclipse.core.runtime.Platform; //导入方法依赖的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;
}
}
示例5: getAvailableCodegenWizards
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public ElementList getAvailableCodegenWizards() {
ElementList wizards = new ElementList("CodegenWizards"); //$NON-NLS-1$
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(org.eclipse.gemoc.commons.eclipse.pde.Activator.PLUGIN_ID, PLUGIN_POINT);
if (point == null)
return wizards;
IExtension[] extensions = point.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
if (elements[j].getName().equals(TAG_WIZARD)) {
String targetPluginId = elements[j].getAttribute(WizardElement.ATT_TARGETPLUGINID);
if( targetPluginId == null || targetPluginId.equals(getTargetPluginId())){
WizardElement element = createWizardElement(elements[j]);
if (element != null) {
wizards.add(element);
}
}
}
}
}
return wizards;
}
示例6: getExtensions
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
* Returns the extensions for a given extension point.
*
* @param pointID
* The extension point ID
*
* @return The extensions
*/
private static IExtension[] getExtensions(final String pointID) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(pointID);
if (point == null) {
throw new IllegalStateException("Invalid extension point : " + pointID);
}
return point.getExtensions();
}
示例7: initialize
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public void initialize() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
registry.addRegistryChangeListener(this, CodeLensPlugin.PLUGIN_ID);
}
示例8: initialize
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
public void initialize() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
registry.addRegistryChangeListener(this, CodeLensEditorPlugin.PLUGIN_ID);
}
示例9: getExtensionRegistry
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
* Gets the extension registry.
* @return the extension registry
*/
private IExtensionRegistry getExtensionRegistry() {
return Platform.getExtensionRegistry();
}