1 11 package org.eclipse.ui.internal.activities.ws; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.eclipse.ui.activities.ITriggerPointAdvisor; 16 import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; 17 import org.eclipse.ui.internal.registry.RegistryReader; 18 19 24 public final class TriggerPointAdvisorDescriptor { 25 26 private String id; 27 28 private IConfigurationElement element; 29 30 38 public TriggerPointAdvisorDescriptor(IConfigurationElement element) 39 throws IllegalArgumentException { 40 id = element.getAttribute(IWorkbenchRegistryConstants.ATT_ID); 41 if (id == null 42 || RegistryReader.getClassValue(element, 43 IWorkbenchRegistryConstants.ATT_CLASS) == null) { 44 throw new IllegalArgumentException (); 45 } 46 this.element = element; 47 } 48 49 54 public String getId() { 55 return id; 56 } 57 58 65 public ITriggerPointAdvisor createAdvisor() throws CoreException { 66 return (ITriggerPointAdvisor) element 67 .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); 68 } 69 } 70 | Popular Tags |