1 11 package org.eclipse.core.internal.registry; 12 13 import org.eclipse.core.runtime.*; 14 15 23 public class BaseExtensionHandle extends Handle implements IExtension { 24 25 public BaseExtensionHandle(IObjectManager objectManager, int id) { 26 super(objectManager, id); 27 } 28 29 protected Extension getExtension() { 30 return (Extension) objectManager.getObject(getId(), RegistryObjectManager.EXTENSION); 31 } 32 33 protected boolean shouldPersist() { 34 return getExtension().shouldPersist(); 35 } 36 37 public String getNamespace() { 39 return getContributor().getName(); 40 } 41 42 public String getNamespaceIdentifier() { 43 return getExtension().getNamespaceIdentifier(); 44 } 45 46 public IContributor getContributor() { 47 return getExtension().getContributor(); 48 } 49 50 String getContributorId() { 51 return getExtension().getContributorId(); 52 } 53 54 public String getExtensionPointUniqueIdentifier() { 55 return getExtension().getExtensionPointIdentifier(); 56 } 57 58 public String getLabel() { 59 return getExtension().getLabel(); 60 } 61 62 public String getSimpleIdentifier() { 63 return getExtension().getSimpleIdentifier(); 64 } 65 66 public String getUniqueIdentifier() { 67 return getExtension().getUniqueIdentifier(); 68 } 69 70 public IConfigurationElement[] getConfigurationElements() { 71 return (IConfigurationElement[]) objectManager.getHandles(getExtension().getRawChildren(), RegistryObjectManager.CONFIGURATION_ELEMENT); 72 } 73 74 RegistryObject getObject() { 75 return getExtension(); 76 } 77 78 public boolean isValid() { 79 try { 80 getExtension(); 81 } catch (InvalidRegistryObjectException e) { 82 return false; 83 } 84 return true; 85 } 86 } 87 | Popular Tags |