1 11 12 package org.eclipse.ui.internal.intro.impl.model; 13 14 import org.eclipse.ui.internal.intro.impl.model.util.BundleUtil; 15 import org.osgi.framework.Bundle; 16 import org.w3c.dom.Element ; 17 18 21 public class IntroImage extends AbstractBaseIntroElement { 22 23 protected static final String TAG_IMAGE = "img"; 25 private static final String ATT_SRC = "src"; private static final String ATT_ALT = "alt"; 28 private Element element; 29 private String src; 30 private String base; 31 32 IntroImage(Element element, Bundle bundle, String base) { 33 super(element, bundle); 34 this.element = element; 35 this.base = base; 36 } 37 38 41 public String getAlt() { 42 return getAttribute(element, ATT_ALT); 43 } 44 45 46 51 public int getType() { 52 return AbstractIntroElement.IMAGE; 53 } 54 55 58 public String getSrc() { 59 if (src==null) src = BundleUtil.getResolvedResourceLocation(base, getSrcAsIs(), getBundle()); 61 return src; 62 } 63 64 68 public String getSrcAsIs() { 69 return getAttribute(element, ATT_SRC); 70 } 71 } 72 | Popular Tags |