1 17 package org.alfresco.web.ui.common.component.description; 18 19 import javax.faces.context.FacesContext; 20 import javax.faces.el.ValueBinding; 21 22 import org.alfresco.web.ui.common.component.SelfRenderingComponent; 23 24 29 public class UIDescriptions extends SelfRenderingComponent 30 { 31 private Object value; 32 33 36 public Object getValue() 37 { 38 if (this.value == null) 39 { 40 ValueBinding vb = getValueBinding("value"); 41 if (vb != null) 42 { 43 this.value = vb.getValue(getFacesContext()); 44 } 45 } 46 47 return this.value; 48 } 49 50 53 public void setValue(Object value) 54 { 55 this.value = value; 56 } 57 58 61 public String getFamily() 62 { 63 return "org.alfresco.faces.Descriptions"; 64 } 65 66 69 public void restoreState(FacesContext context, Object state) 70 { 71 Object values[] = (Object [])state; 72 super.restoreState(context, values[0]); 74 this.value = values[1]; 75 } 76 77 80 public Object saveState(FacesContext context) 81 { 82 Object values[] = new Object [2]; 83 values[0] = super.saveState(context); 85 values[1] = this.value; 86 return (values); 87 } 88 } 89 | Popular Tags |