1 26 package org.objectweb.util.explorer.property.lib; 27 28 import org.objectweb.util.explorer.core.common.api.Description; 29 import org.objectweb.util.explorer.core.menu.api.MenuDescription; 30 import org.objectweb.util.explorer.core.menu.api.MenuElement; 31 32 40 public class MenuProperty 41 extends AbstractProperty 42 { 43 44 50 56 62 65 protected void mergeMenuDescription(MenuDescription source, MenuDescription target) { 66 MenuElement[] elements = target.getAllMenuElements(); 67 for (int i = 0; i < elements.length; i++) { 68 source.addMenuElement(elements[i]); 69 } 70 } 71 72 78 81 public void feed(String propertyType, Object key, Description value) { 82 if(value!=null && value instanceof MenuDescription){ 83 if(properties_.containsKey(key)){ 84 Description description = (Description)properties_.get(key); 85 mergeMenuDescription((MenuDescription)description, (MenuDescription)value); 86 } else { 87 properties_.put(key,value); 88 } 89 } 90 } 91 92 98 101 public Description getPropertyDescription(String propertyType, Object key) { 102 return (Description)properties_.get(key); 103 } 104 105 } 106 107 | Popular Tags |