コード例 #1
0
 /**
  * Parses a single extension contribution.
  *
  * @param extension Parses the given extension and adds its contribution to the registry.
  */
 private static void parseExtension(IExtension extension) {
   final IConfigurationElement[] configElements = extension.getConfigurationElements();
   for (IConfigurationElement elem : configElements) {
     if (VIEW_LABELPROVIDER_TAG.equals(elem.getName())) {
       ViewLabelProviderExtensionRegistry.addViewLabelProvider(
           new ViewLabelProviderIDEExtensionDescriptor(elem));
     }
   }
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtension[])
  */
 public void removed(IExtension[] extensions) {
   for (IExtension extension : extensions) {
     final IConfigurationElement[] configElements = extension.getConfigurationElements();
     for (IConfigurationElement elem : configElements) {
       if (VIEW_LABELPROVIDER_TAG.equals(elem.getName())) {
         final String extensionClassName =
             elem.getAttribute(ViewLabelProviderIDEExtensionDescriptor.ATTRIBUTE_CLASS);
         ViewLabelProviderExtensionRegistry.removeExtension(extensionClassName);
       }
     }
   }
 }