1 11 package org.eclipse.update.internal.configurator.branding; 12 13 import java.net.*; 14 import java.util.Hashtable ; 15 16 import org.eclipse.core.runtime.*; 17 18 19 27 public final class AboutInfo { 28 private final static String INI_FILENAME = "about.ini"; private final static String PROPERTIES_FILENAME = "about.properties"; private final static String MAPPINGS_FILENAME = "about.mappings"; 32 private String featureId; 33 private String versionId = ""; private String featurePluginLabel; 35 private String providerName; 36 private String appName; 37 private URL windowImageURL; 38 private URL[] windowImagesURLs; 39 private URL aboutImageURL; 40 private URL featureImageURL; 41 private URL welcomePageURL; 42 private String aboutText; 43 private String welcomePerspective; 44 private String tipsAndTricksHref; 45 46 47 50 AboutInfo(String featureId) { 51 super(); 52 this.featureId = featureId; 53 } 54 55 64 public static AboutInfo readFeatureInfo(String featureId, String versionId, String pluginId) { 65 IniFileReader reader = new IniFileReader(featureId, pluginId, INI_FILENAME, PROPERTIES_FILENAME, MAPPINGS_FILENAME); 69 reader.load(); 70 76 AboutInfo info = new AboutInfo(featureId); 77 Hashtable runtimeMappings = new Hashtable (); 78 runtimeMappings.put("{featureVersion}", versionId); info.versionId = versionId; 80 info.featurePluginLabel = reader.getFeaturePluginLabel(); 81 info.providerName = reader.getProviderName(); 82 info.appName = reader.getString("appName", true, runtimeMappings); info.aboutText = reader.getString("aboutText", true, runtimeMappings); info.windowImageURL = reader.getURL("windowImage"); info.windowImagesURLs = reader.getURLs("windowImages"); info.aboutImageURL = reader.getURL("aboutImage"); info.featureImageURL = reader.getURL("featureImage"); info.welcomePageURL = reader.getURL("welcomePage"); info.welcomePerspective = reader.getString("welcomePerspective", false, runtimeMappings); info.tipsAndTricksHref = reader.getString("tipsAndTricksHref", false, runtimeMappings); return info; 94 } 95 96 103 public URL getAboutImageURL() { 104 return aboutImageURL; 105 } 106 107 113 public URL getFeatureImageURL() { 114 return featureImageURL; 115 } 116 117 123 public String getFeatureImageName() { 124 if (featureImageURL != null) { 125 IPath path = new Path(featureImageURL.getPath()); 126 return path.lastSegment(); 127 } 128 return null; 129 } 130 131 132 135 public String getFeatureLabel() { 136 return featurePluginLabel; 137 } 138 139 144 public String getFeatureId() { 145 return featureId; 146 } 147 148 154 public String getAboutText() { 155 return aboutText; 156 } 157 158 169 public String getAppName() { 170 return appName; 171 } 172 173 179 public String getProductName() { 180 return featurePluginLabel; 181 } 182 183 188 public String getProviderName() { 189 return providerName; 190 } 191 192 197 public String getVersionId() { 198 return versionId; 199 } 200 201 207 public URL getWelcomePageURL() { 208 return welcomePageURL; 209 } 210 211 217 public String getWelcomePerspectiveId() { 218 return welcomePerspective; 219 } 220 221 226 public String getTipsAndTricksHref() { 227 return tipsAndTricksHref; 228 } 229 230 236 public URL getWindowImageURL() { 237 return windowImageURL; 238 } 239 240 250 public URL[] getWindowImagesURLs() { 251 return windowImagesURLs; 252 } 253 } 254 | Popular Tags |