1 11 package org.eclipse.debug.internal.ui.launchConfigurations; 12 13 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.eclipse.debug.internal.ui.DebugUIPlugin; 16 import org.eclipse.debug.ui.ILaunchGroup; 17 import org.eclipse.jface.resource.ImageDescriptor; 18 19 20 23 public class LaunchGroupExtension implements ILaunchGroup { 24 25 28 private IConfigurationElement fConfig; 29 30 33 private ImageDescriptor fImageDescriptor; 34 35 38 private ImageDescriptor fBannerImageDescriptor; 39 40 48 public LaunchGroupExtension(IConfigurationElement element) { 49 setConfigurationElement(element); 50 } 51 52 58 private void setConfigurationElement(IConfigurationElement element) { 59 fConfig = element; 60 } 61 62 69 protected IConfigurationElement getConfigurationElement() { 70 return fConfig; 71 } 72 73 78 public ImageDescriptor getImageDescriptor() { 79 if (fImageDescriptor == null) { 80 fImageDescriptor = createImageDescriptor("image"); } 82 return fImageDescriptor; 83 } 84 85 92 public ImageDescriptor getBannerImageDescriptor() { 93 if (fBannerImageDescriptor == null) { 94 fBannerImageDescriptor = createImageDescriptor("bannerImage"); } 96 return fBannerImageDescriptor; 97 } 98 99 104 public String getLabel() { 105 return getConfigurationElement().getAttribute("label"); } 107 108 113 public String getIdentifier() { 114 return getConfigurationElement().getAttribute("id"); } 116 117 122 public String getCategory() { 123 return getConfigurationElement().getAttribute("category"); } 125 126 131 public String getMode() { 132 return getConfigurationElement().getAttribute("mode"); } 134 135 141 protected ImageDescriptor createImageDescriptor(String attribute) { 142 return DebugUIPlugin.getImageDescriptor(getConfigurationElement(), attribute); 143 } 144 145 150 public boolean isPublic() { 151 String string = getConfigurationElement().getAttribute("public"); if (string == null) { 153 return true; 154 } 155 return string.equals("true"); } 157 158 } 159 160 | Popular Tags |