1 17 package org.alfresco.web.ui.common.component; 18 19 import javax.faces.context.FacesContext; 20 import javax.faces.el.ValueBinding; 21 22 25 public class UIListItem extends SelfRenderingComponent 26 { 27 30 33 public String getFamily() 34 { 35 return "org.alfresco.faces.Controls"; 36 } 37 38 41 public Object saveState(FacesContext context) 42 { 43 Object values[] = new Object [5]; 44 values[0] = super.saveState(context); 45 values[1] = this.value; 46 values[2] = this.disabled; 47 values[3] = this.label; 48 values[4] = this.tooltip; 49 return ((Object ) (values)); 50 } 51 52 55 public void restoreState(FacesContext context, Object state) 56 { 57 Object values[] = (Object [])state; 58 super.restoreState(context, values[0]); 59 this.value = values[1]; 60 this.disabled = (Boolean )values[2]; 61 this.label = (String )values[3]; 62 this.tooltip = (String )values[4]; 63 } 64 65 66 69 75 public Object getValue() 76 { 77 ValueBinding vb = getValueBinding("value"); 78 if (vb != null) 79 { 80 this.value = vb.getValue(getFacesContext()); 81 } 82 83 return this.value; 84 } 85 86 92 public void setValue(Object value) 93 { 94 this.value = value; 95 } 96 97 102 public boolean isDisabled() 103 { 104 ValueBinding vb = getValueBinding("disabled"); 105 if (vb != null) 106 { 107 this.disabled = (Boolean )vb.getValue(getFacesContext()); 108 } 109 110 if (this.disabled != null) 111 { 112 return this.disabled.booleanValue(); 113 } 114 else 115 { 116 return false; 118 } 119 } 120 121 126 public void setDisabled(boolean disabled) 127 { 128 this.disabled = disabled; 129 } 130 131 134 public String getLabel() 135 { 136 ValueBinding vb = getValueBinding("label"); 137 if (vb != null) 138 { 139 this.label = (String )vb.getValue(getFacesContext()); 140 } 141 142 return this.label; 143 } 144 145 148 public void setLabel(String label) 149 { 150 this.label = label; 151 } 152 153 156 public String getTooltip() 157 { 158 ValueBinding vb = getValueBinding("tooltip"); 159 if (vb != null) 160 { 161 this.tooltip = (String )vb.getValue(getFacesContext()); 162 } 163 164 return this.tooltip; 165 } 166 167 170 public void setTooltip(String tooltip) 171 { 172 this.tooltip = tooltip; 173 } 174 175 176 179 180 private Object value = null; 181 182 183 private Boolean disabled = null; 184 185 186 private String tooltip; 187 188 189 private String label; 190 } 191 | Popular Tags |