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 UIDescription extends SelfRenderingComponent 30 { 31 private String controlValue; 32 private String text; 33 34 37 public String getControlValue() 38 { 39 if (this.controlValue == null) 40 { 41 ValueBinding vb = getValueBinding("controlValue"); 42 if (vb != null) 43 { 44 this.controlValue = (String )vb.getValue(getFacesContext()); 45 } 46 } 47 48 return this.controlValue; 49 } 50 51 54 public void setControlValue(String controlValue) 55 { 56 this.controlValue = controlValue; 57 } 58 59 62 public String getText() 63 { 64 if (this.text == null) 65 { 66 ValueBinding vb = getValueBinding("text"); 67 if (vb != null) 68 { 69 this.text = (String )vb.getValue(getFacesContext()); 70 } 71 } 72 73 return this.text; 74 } 75 76 79 public void setText(String text) 80 { 81 this.text = text; 82 } 83 84 87 public String getFamily() 88 { 89 return "org.alfresco.faces.Description"; 90 } 91 92 95 public void restoreState(FacesContext context, Object state) 96 { 97 Object values[] = (Object [])state; 98 super.restoreState(context, values[0]); 100 this.controlValue = (String )values[1]; 101 this.text = (String )values[2]; 102 } 103 104 107 public Object saveState(FacesContext context) 108 { 109 Object values[] = new Object [3]; 110 values[0] = super.saveState(context); 112 values[1] = this.controlValue; 113 values[2] = this.text; 114 return (values); 115 } 116 117 120 public boolean getRendersChildren() 121 { 122 return false; 123 } 124 } 125 | Popular Tags |