1 17 package org.alfresco.web.ui.common.component.data; 18 19 import javax.faces.component.UIComponent; 20 import javax.faces.component.UIComponentBase; 21 import javax.faces.context.FacesContext; 22 import javax.faces.el.ValueBinding; 23 24 27 public class UIColumn extends UIComponentBase 28 { 29 32 35 public String getFamily() 36 { 37 return "org.alfresco.faces.Data"; 38 } 39 40 45 public UIComponent getHeader() 46 { 47 return getFacet("header"); 48 } 49 50 55 public UIComponent getFooter() 56 { 57 return getFacet("footer"); 58 } 59 60 65 public UIComponent getLargeIcon() 66 { 67 return getFacet("large-icon"); 68 } 69 70 75 public UIComponent getSmallIcon() 76 { 77 return getFacet("small-icon"); 78 } 79 80 83 public void restoreState(FacesContext context, Object state) 84 { 85 Object values[] = (Object [])state; 86 super.restoreState(context, values[0]); 88 this.primary = ((Boolean )values[1]).booleanValue(); 89 this.actions = ((Boolean )values[2]).booleanValue(); 90 } 91 92 95 public Object saveState(FacesContext context) 96 { 97 Object values[] = new Object [3]; 98 values[0] = super.saveState(context); 100 values[1] = (this.primary ? Boolean.TRUE : Boolean.FALSE); 101 values[2] = (this.actions ? Boolean.TRUE : Boolean.FALSE); 102 return (values); 103 } 104 105 106 109 112 public boolean getPrimary() 113 { 114 ValueBinding vb = getValueBinding("primary"); 115 if (vb != null) 116 { 117 this.primary = (Boolean )vb.getValue(getFacesContext()); 118 } 119 return this.primary; 120 } 121 122 125 public void setPrimary(boolean primary) 126 { 127 this.primary = primary; 128 } 129 130 133 public boolean getActions() 134 { 135 ValueBinding vb = getValueBinding("actions"); 136 if (vb != null) 137 { 138 this.actions = (Boolean )vb.getValue(getFacesContext()); 139 } 140 return this.actions; 141 } 142 143 146 public void setActions(boolean actions) 147 { 148 this.actions = actions; 149 } 150 151 152 155 private boolean primary = false; 156 private boolean actions = false; 157 } 158 | Popular Tags |