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.panel.api.CompositePanelDescription; 30 import org.objectweb.util.explorer.core.panel.api.PanelDescription; 31 import org.objectweb.util.explorer.core.panel.lib.BasicCompositePanelDescription; 32 33 41 public class PanelProperty 42 extends AbstractProperty 43 { 44 45 51 57 63 68 protected PanelDescription mergePanelDescription(PanelDescription source, PanelDescription target){ 69 if(target instanceof CompositePanelDescription){ 70 ((CompositePanelDescription)target).addPanelDescription(source); 71 if(source.inheritTypePanel()){ 72 ((CompositePanelDescription)target).setInheritTypePanel(true); 73 } 74 } else { 75 CompositePanelDescription composite = new BasicCompositePanelDescription(); 76 composite.addPanelDescription(target); 77 composite.addPanelDescription(source); 78 composite.setInheritTypePanel(source.inheritTypePanel()||target.inheritTypePanel()); 79 target=composite; 80 } 81 return target; 82 } 83 84 90 93 public void feed(String propertyType, Object key, Description value) { 94 if(value!=null && value instanceof PanelDescription){ 95 properties_.put(key,value); 99 } 100 } 101 102 108 111 public Description getPropertyDescription(String propertyType, Object key) { 112 return (Description)properties_.get(key); 113 } 114 115 } 116 117 118 | Popular Tags |