1 11 package org.eclipse.ui.internal.activities.ws; 12 13 import java.util.HashMap ; 14 import java.util.Map ; 15 16 import org.eclipse.core.runtime.IConfigurationElement; 17 import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; 18 19 22 public class RegistryTriggerPoint extends AbstractTriggerPoint { 23 24 private String id; 25 26 private IConfigurationElement element; 27 28 private Map hints; 29 30 36 public RegistryTriggerPoint(String id, IConfigurationElement element) { 37 this.id = id; 38 this.element = element; 39 } 40 41 46 public String getId() { 47 return id; 48 } 49 50 55 public String getStringHint(String key) { 56 return (String ) getHints().get(key); 57 } 58 59 64 public boolean getBooleanHint(String key) { 65 return Boolean.valueOf(getStringHint(key)).booleanValue(); 66 } 67 68 73 private Map getHints() { 74 if (hints == null) { 75 hints = new HashMap (); 76 77 IConfigurationElement[] hintElements = element 78 .getChildren(IWorkbenchRegistryConstants.TAG_HINT); 79 for (int i = 0; i < hintElements.length; i++) { 80 String id = hintElements[i] 81 .getAttribute(IWorkbenchRegistryConstants.ATT_ID); 82 String value = hintElements[i] 83 .getAttribute(IWorkbenchRegistryConstants.ATT_VALUE); 84 85 if (id != null && value != null) { 86 hints.put(id, value); 87 } 88 } 89 } 90 91 return hints; 92 } 93 } 94 | Popular Tags |