1 11 package org.eclipse.ui.internal; 12 13 import java.net.URL ; 14 15 import org.eclipse.core.runtime.IBundleGroup; 16 import org.eclipse.jface.resource.ImageDescriptor; 17 import org.eclipse.ui.branding.IBundleGroupConstants; 18 19 29 public class BundleGroupProperties extends BrandingProperties implements 30 IBundleGroupConstants { 31 32 private final IBundleGroup bundleGroup; 33 34 private ImageDescriptor featureImageDescriptor; 35 36 private URL featureImageUrl; 37 38 private String tipsAndTricksHref; 39 40 private URL welcomePageUrl; 41 42 private String welcomePerspective; 43 44 private URL licenseUrl; 45 46 private String featureLabel; 47 48 private String featureId; 49 50 private String providerName; 51 52 private String versionId; 53 54 59 public BundleGroupProperties(IBundleGroup bundleGroup) { 60 if (bundleGroup == null) { 61 throw new IllegalArgumentException (); 62 } 63 this.bundleGroup = bundleGroup; 64 } 65 66 69 public ImageDescriptor getFeatureImage() { 70 if (featureImageDescriptor == null) { 71 featureImageDescriptor = getFeatureImage(bundleGroup); 72 } 73 return featureImageDescriptor; 74 } 75 76 79 public URL getFeatureImageUrl() { 80 if (featureImageUrl == null) { 81 featureImageUrl = getFeatureImageUrl(bundleGroup); 82 } 83 return featureImageUrl; 84 } 85 86 89 public String getTipsAndTricksHref() { 90 if (tipsAndTricksHref == null) { 91 tipsAndTricksHref = getTipsAndTricksHref(bundleGroup); 92 } 93 return tipsAndTricksHref; 94 } 95 96 101 public URL getWelcomePageUrl() { 102 if (welcomePageUrl == null) { 103 welcomePageUrl = getWelcomePageUrl(bundleGroup); 104 } 105 return welcomePageUrl; 106 } 107 108 111 public String getWelcomePerspective() { 112 if (welcomePerspective == null) { 113 welcomePerspective = getWelcomePerspective(bundleGroup); 114 } 115 return welcomePerspective; 116 } 117 118 121 public URL getLicenseUrl() { 122 if (licenseUrl == null) { 123 licenseUrl = getLicenseUrl(bundleGroup); 124 } 125 return licenseUrl; 126 } 127 128 131 public String getFeatureLabel() { 132 if (featureLabel == null) { 133 featureLabel = getFeatureLabel(bundleGroup); 134 } 135 return featureLabel; 136 } 137 138 141 public String getFeatureId() { 142 if (featureId == null) { 143 featureId = getFeatureId(bundleGroup); 144 } 145 return featureId; 146 } 147 148 151 public String getProviderName() { 152 if (providerName == null) { 153 providerName = getProviderName(bundleGroup); 154 } 155 return providerName; 156 } 157 158 161 public String getFeatureVersion() { 162 if (versionId == null) { 163 versionId = getFeatureVersion(bundleGroup); 164 } 165 return versionId; 166 } 167 168 171 public static ImageDescriptor getFeatureImage(IBundleGroup bundleGroup) { 172 return getImage(bundleGroup.getProperty(FEATURE_IMAGE), null); 173 } 174 175 178 public static URL getFeatureImageUrl(IBundleGroup bundleGroup) { 179 return getUrl(bundleGroup.getProperty(FEATURE_IMAGE), null); 180 } 181 182 185 public static String getTipsAndTricksHref(IBundleGroup bundleGroup) { 186 return bundleGroup.getProperty(TIPS_AND_TRICKS_HREF); 187 } 188 189 194 public static URL getWelcomePageUrl(IBundleGroup bundleGroup) { 195 return getUrl(bundleGroup.getProperty(WELCOME_PAGE), null); 196 } 197 198 201 public static String getWelcomePerspective(IBundleGroup bundleGroup) { 202 String property = bundleGroup.getProperty(WELCOME_PERSPECTIVE); 203 return property == null ? null : property; 204 } 205 206 209 public static URL getLicenseUrl(IBundleGroup bundleGroup) { 210 return getUrl(bundleGroup.getProperty(LICENSE_HREF), null); 211 } 212 213 216 public static String getFeatureLabel(IBundleGroup bundleGroup) { 217 return bundleGroup.getName(); 218 } 219 220 223 public static String getFeatureId(IBundleGroup bundleGroup) { 224 return bundleGroup.getIdentifier(); 225 } 226 227 230 public static String getProviderName(IBundleGroup bundleGroup) { 231 return bundleGroup.getProviderName(); 232 } 233 234 237 public static String getFeatureVersion(IBundleGroup bundleGroup) { 238 return bundleGroup.getVersion(); 239 } 240 } 241 | Popular Tags |