1 5 package org.exoplatform.faces.core.component; 6 7 import java.io.IOException ; 8 import java.util.List ; 9 10 import javax.faces.application.FacesMessage; 11 import javax.faces.context.FacesContext; 12 import org.exoplatform.faces.core.component.model.Information; 13 14 20 public class UIPortlet extends UINode implements InformationProvider { 21 private Information information_ = new Information() ; 22 private int displayMessageType_ = FOOTER_MESSAGE_TYPE ; 23 24 public int getDisplayMessageType() { return displayMessageType_ ; } 25 public void setDisplayMessageType(int type) { displayMessageType_ = type ; } 26 public void addMessage(FacesMessage message) { information_.addMessage(message); } 27 public void clearMessages() { information_.clearMessages() ;} 28 public List getMessages() { return information_.getMessages() ; } 29 public boolean hasMessage() { return information_.hasMessage() ; } 30 31 public void encodeChildren(FacesContext context) throws IOException { 32 if(information_.hasMessage()) { 33 if(displayMessageType_ == BODY_MESSAGE_TYPE) { 34 Information.renderBodyInformation(context, this) ; 35 return ; 36 } 37 } 38 super.encodeChildren(context); 39 if(information_.hasMessage()) { 40 if(displayMessageType_ == FOOTER_MESSAGE_TYPE) { 41 Information.renderFooterInformation(context, this) ; 42 return ; 43 } 44 } 45 } 46 } | Popular Tags |