1 26 30 31 package org.omg.lifl.eclipse.plugin.project.utils; 32 33 import org.eclipse.core.runtime.IConfigurationElement; 34 import org.omg.lifl.eclipse.plugin.project.utils.SWT.SetterGroupPreference; 35 36 45 public class AttributeManager { 46 47 private IConfigurationElement configurationElement; 48 49 52 public AttributeManager(IConfigurationElement elem) { 53 this.setConfigurationElement(elem); 54 } 55 56 61 public static String getAttribute(IConfigurationElement elem, String property) { 62 String res = elem.getAttribute(property); 63 if (res == null) { 64 return '!' + property + '!'; 65 } 66 return res; 67 } 68 69 74 public static SetterGroupPreference getAllAttribute( 75 IConfigurationElement elem, 76 String tag) { 77 String _Group = elem.getAttribute(tag + "Group"); 79 String _PathLabel = elem.getAttribute(tag + "PathLabel"); 80 String _PathName = elem.getAttribute(tag + "PathName"); 81 82 if (_Group == null || _PathName == null || _PathLabel == null) 83 return null; 84 85 return new SetterGroupPreference(_Group, _PathLabel, _PathName); 86 } 87 88 93 public String getAttribute(String property) { 94 if (elementSet()) 95 return getAttribute(getConfigurationElement(),property); 96 else return null; 97 } 98 99 public boolean elementSet(){ 100 return ( getConfigurationElement() != null ? true : false ); 101 } 102 103 106 public IConfigurationElement getConfigurationElement() { 107 return configurationElement; 108 } 109 110 113 public void setConfigurationElement(IConfigurationElement element) { 114 configurationElement = element; 115 } 116 117 } 118 | Popular Tags |