1 11 package org.eclipse.debug.internal.ui; 12 13 import java.util.HashSet ; 14 import java.util.Set ; 15 16 import org.eclipse.core.runtime.CoreException; 17 import org.eclipse.core.runtime.IConfigurationElement; 18 import org.eclipse.debug.internal.core.IConfigurationElementConstants; 19 import org.eclipse.debug.ui.ILaunchConfigurationTab; 20 21 26 public final class LaunchConfigurationTabExtension { 27 28 31 IConfigurationElement fElement = null; 32 private Set fDelegates = null; 33 34 38 public LaunchConfigurationTabExtension(IConfigurationElement element) { 39 fElement = element; 40 } 41 42 46 public String getIdentifier() { 47 return fElement.getAttribute(IConfigurationElementConstants.ID); 48 } 49 50 54 public String getName() { 55 return fElement.getAttribute(IConfigurationElementConstants.NAME); 56 } 57 58 62 public ILaunchConfigurationTab getTab() { 63 try { 64 Object object = fElement.createExecutableExtension(IConfigurationElementConstants.CLASS); 65 if(object instanceof ILaunchConfigurationTab) { 66 return (ILaunchConfigurationTab) object; 67 } 68 } catch (CoreException e) {DebugUIPlugin.log(e);} 69 return null; 70 } 71 72 76 public String getTabGroupId() { 77 return fElement.getAttribute(IConfigurationElementConstants.GROUP); 78 } 79 80 85 public String getRelativeTabId() { 86 IConfigurationElement[] elems = fElement.getChildren(IConfigurationElementConstants.PLACEMENT); 87 if(elems.length == 1) { 88 return elems[0].getAttribute(IConfigurationElementConstants.AFTER); 89 } 90 return null; 91 } 92 93 97 public String getPluginIdentifier() { 98 return fElement.getContributor().getName(); 99 } 100 101 105 public Set getDelegateSet() { 106 if(fDelegates == null) { 107 fDelegates = new HashSet (); 108 IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.ASSOCIATED_DELEGATE); 109 String id = null; 110 for(int i = 0; i < children.length; i++) { 111 id = children[i].getAttribute(IConfigurationElementConstants.DELEGATE); 112 if(id != null) { 113 fDelegates.add(id); 114 } 115 } 116 } 117 return fDelegates; 118 } 119 } 120 | Popular Tags |