* @param targetID the target id
* @return the instantiated extension object, or <code>null</code> if not found
*/
private Object createExtension(String extensionPointId, String elementName,
String targetID) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
.getExtensionPoint(PI_WORKBENCH, extensionPointId);
if (extensionPoint == null) {
WorkbenchPlugin
.log("Unable to find extension. Extension point: " + extensionPointId + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
// Loop through the config elements.
IConfigurationElement targetElement = null;
IConfigurationElement[] elements = extensionPoint
.getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
IConfigurationElement element = elements[j];
if (elementName == null || elementName.equals(element.getName())) {
String strID = element.getAttribute("id"); //$NON-NLS-1$