1 11 package org.eclipse.ui.internal.intro.impl.model; 12 13 import java.util.Hashtable ; 14 import java.util.Map ; 15 16 import org.eclipse.core.runtime.IConfigurationElement; 17 import org.eclipse.ui.internal.intro.impl.model.util.BundleUtil; 18 import org.osgi.framework.Bundle; 19 import org.w3c.dom.Element ; 20 21 22 public class IntroTheme extends AbstractIntroIdElement { 23 private static final String ATT_PATH = "path"; private String name; 25 private String path; 26 private Hashtable properties; 27 28 public IntroTheme(IConfigurationElement element) { 29 super(element); 30 name = element.getAttribute(name); 31 path = element.getAttribute(ATT_PATH); 32 path = BundleUtil.getResolvedResourceLocation(path, getBundle()); 33 loadProperties(element); 34 } 35 36 public IntroTheme(Element element, Bundle bundle) { 37 super(element, bundle); 38 } 39 40 public IntroTheme(Element element, Bundle bundle, String base) { 41 super(element, bundle, base); 42 } 43 44 public String getName() { 45 return name; 46 } 47 48 public String getPath() { 49 return path; 50 } 51 52 public int getType() { 53 return THEME; 54 } 55 56 public Map getProperties() { 57 return properties; 58 } 59 60 private void loadProperties(IConfigurationElement element) { 61 IConfigurationElement [] children = element.getChildren("property"); if (children.length==0) 63 return; 64 properties = new Hashtable (); 65 for (int i=0; i<children.length; i++) { 66 IConfigurationElement property = children[i]; 67 String name = property.getAttribute("name"); String value = property.getAttribute("value"); if (name!=null && value!=null) 70 properties.put(name, value); 71 } 72 } 73 } 74 | Popular Tags |