1 5 package org.exoplatform.faces.core.component; 6 7 import java.util.List ; 8 import java.util.ArrayList ; 9 10 import javax.faces.component.UIComponent; 11 import javax.faces.context.FacesContext; 12 import org.exoplatform.faces.core.event.UIComponentObserver; 13 14 20 public class UINode extends UIExoComponentBase implements Node { 21 private String name_ ; 22 private String icon_ ; 23 private String description_ ; 24 private List observers_ ; 25 26 public String getName() { return name_ ; } 27 public void setName(String s) { name_ = s ;} 28 29 public String getIcon() { return icon_ ; } 30 public void setIcon(String s) { icon_ = s ; } 31 32 public String getDescription() { return description_ ;} 33 public void setDescription(String s) { description_ = s ; } 34 35 public void addObserver(UIComponentObserver observer) { 36 if(observers_ == null) observers_ = new ArrayList (3) ; 37 observers_.add(observer) ; 38 } 39 40 public void broadcastOnChange() throws Exception { 41 if(observers_ != null) { 42 for(int i = 0; i < observers_.size(); i++) { 43 UIComponentObserver observer = (UIComponentObserver) observers_.get(i) ; 44 observer.onChange(this) ; 45 } 46 } 47 } 48 49 public void processDecodes(FacesContext context) { 50 List children = getChildren() ; 51 decode(context) ; 52 if (context.getRenderResponse()) return ; 53 for(int i = 0 ; i < children.size(); i++) { 54 UIComponent child = (UIComponent) children.get(i); 55 if (child.isRendered()) { 56 child.processDecodes(context) ; 57 if (context.getRenderResponse()) return ; 58 } 59 } 60 } 61 62 } | Popular Tags |