There are 8 code examples for org.eclipse.core.runtime.IExtensionRegistry.

The API names are highlighted below. You can use suckoo button to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.

Project Name: rssowl.core Package: org.rssowl.core.internal

Source Code: ApplicationServiceImpl.java (Click to view .java file)

Method Code:
vote
like

private void loadNewsActions(){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(NEWS_ACTION_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      String id=element.getAttribute("id");
      fNewsActions.put(id,(INewsAction)element.createExecutableExtension("class"));
    }
 catch (    InvalidRegistryObjectException e) {
      Activator.getDefault().logError(e.getMessage(),e);
    }
catch (    CoreException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }
  }
}
 

Project Name: rssowl.core Package: org.rssowl.core.internal.connection

Source Code: ConnectionServiceImpl.java (Click to view .java file)

Method Code:
vote
like

private void loadCredentialsProvider(){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(CREDPROVIDER_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      String protocol=element.getAttribute("protocol");
      String nsId=element.getNamespaceIdentifier();
      if (fCredentialsProvider.containsKey(protocol) && nsId.contains(ExtensionUtils.RSSOWL_NAMESPACE) && !nsId.contains(ExtensionUtils.RSSOWL_TESTS_NAMESPACE))       continue;
      fCredentialsProvider.put(protocol,(ICredentialsProvider)element.createExecutableExtension("class"));
    }
 catch (    InvalidRegistryObjectException e) {
      Activator.getDefault().logError(e.getMessage(),e);
    }
catch (    CoreException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }
  }
}
 

Project Name: rssowl.core Package: org.rssowl.core.internal.interpreter

Source Code: InterpreterServiceImpl.java (Click to view .java file)

Method Code:
vote
like

private void loadTypeExporters(){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(TYPEEXPORTER_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      IConfigurationElement[] formats=element.getChildren("format");
      for (      IConfigurationElement format : formats) {
        String formatName=format.getAttribute("name").toLowerCase();
        if (fTypeExporters.containsKey(formatName) && element.getNamespaceIdentifier().contains(ExtensionUtils.RSSOWL_NAMESPACE))         continue;
        fTypeExporters.put(formatName,(ITypeExporter)element.createExecutableExtension("class"));
      }
    }
 catch (    InvalidRegistryObjectException e) {
      Activator.getDefault().logError(e.getMessage(),e);
    }
catch (    CoreException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }
  }
}
 

Project Name: rssowl.core Package: org.rssowl.core.internal.persist.service

Source Code: PreferenceServiceImpl.java (Click to view .java file)

Method Code:
vote
like

private void initScopedPreferences(){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(PREFERENCES_INITIALIZER_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      IPreferencesInitializer initializer=(IPreferencesInitializer)element.createExecutableExtension("class");
      initializer.initialize(fDefaultScope);
    }
 catch (    CoreException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }
  }
}
 

Project Name: rssowl.core Package: org.rssowl.core.util

Source Code: ExtensionUtils.java (Click to view .java file)

Method Code:
vote
like

/** 
 * Returns the result of creating an executable extension from the "class"
 * attribute of the first contribution that matches the given extension point.
 * Third-Party contributions will be chosen over the default contribution. If
 * no contribution is found, the default is returned if provided.
 * @param extensionPoint The fully qualified identifier of the extension point
 * to use (e.g. "org.rssowl.core.ApplicationLayer")
 * @param defaultExecutable The default executable that should be returned if
 * no contribution was found.
 * @return Returns the result of creating an executable extension from the
 * "class" attribute of the first contribution that matches the given
 * extension point. Third-Party contributions will be chosen over the default
 * contribution. If no contribution is found, the default is returned if
 * provided.
 * @throws IllegalStateException if no contribution was found and the default
 * executable is <code>NULL</code>.
 */
public static Object loadSingletonExecutableExtension(String extensionPoint,Object defaultExecutable){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(extensionPoint);
  if (elements.length > 1) {
    for (    IConfigurationElement element : elements) {
      if (!element.getNamespaceIdentifier().contains(RSSOWL_NAMESPACE)) {
        try {
          return element.createExecutableExtension(EXECUTABLE_ATTRIBUTE);
        }
 catch (        CoreException e) {
          Activator.getDefault().getLog().log(e.getStatus());
        }
      }
    }
  }
 else   if (elements.length == 1) {
    try {
      return elements[0].createExecutableExtension(EXECUTABLE_ATTRIBUTE);
    }
 catch (    CoreException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }
  }
  if (defaultExecutable != null)   return defaultExecutable;
  throw new IllegalStateException("Unable to load contributions for " + extensionPoint);
}
 

Project Name: rssowl.ui Package: org.rssowl.ui.internal

Source Code: Controller.java (Click to view .java file)

Method Code:
vote
like

private String loadFeedSearchUrl(){
  String feedSearch=null;
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(FEED_SEARCH_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      feedSearch=element.getAttribute("searchUrl");
      String nsId=element.getNamespaceIdentifier();
      if (!nsId.contains(ExtensionUtils.RSSOWL_NAMESPACE))       return feedSearch;
    }
 catch (    InvalidRegistryObjectException e) {
      Activator.getDefault().logError(e.getMessage(),e);
    }
  }
  return feedSearch;
}
 

Project Name: rssowl.ui Package: org.rssowl.ui.internal.dialogs.bookmark

Source Code: KeywordSubscriptionPage.java (Click to view .java file)

Method Code:
vote
like

private static List<SearchEngine> loadSearchEngines(){
  List<SearchEngine> engines=new ArrayList<SearchEngine>(5);
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(KEYWORD_FEED_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    String id=element.getAttribute("id");
    String name=element.getAttribute("name");
    String iconPath=element.getAttribute("icon");
    String url=element.getAttribute("url");
    engines.add(new SearchEngine(id,element.getNamespaceIdentifier(),name,iconPath,url));
  }
  return engines;
}
 

Project Name: rssowl.ui Package: org.rssowl.ui.internal.filter

Source Code: NewsActionPresentationManager.java (Click to view .java file)

Method Code:
vote
like

private void loadNewsActionPresentations(){
  IExtensionRegistry reg=Platform.getExtensionRegistry();
  IConfigurationElement elements[]=reg.getConfigurationElementsFor(NEWS_ACTION_PRESENTATION_EXTENSION_POINT);
  for (  IConfigurationElement element : elements) {
    try {
      String id=element.getAttribute("actionId");
      fNewsActionPresentations.put(id,element);
    }
 catch (    InvalidRegistryObjectException e) {
      Activator.getDefault().logError(e.getMessage(),e);
    }
  }
}