View Javadoc

1   package org.rcfaces.core.component;
2   
3   import org.rcfaces.core.internal.converter.FilterPropertiesConverter;
4   import org.rcfaces.core.internal.component.Properties;
5   import javax.el.ValueExpression;
6   import org.rcfaces.core.component.capability.IFilterCapability;
7   import org.apache.commons.logging.Log;
8   import java.util.HashSet;
9   import org.rcfaces.core.component.AbstractOutputComponent;
10  import java.lang.String;
11  import org.apache.commons.logging.LogFactory;
12  import org.rcfaces.core.model.IFilterProperties;
13  import java.util.Arrays;
14  import java.util.Set;
15  
16  public class KeyLabelComponent extends AbstractOutputComponent implements 
17  	IFilterCapability {
18  
19  	private static final Log LOG = LogFactory.getLog(KeyLabelComponent.class);
20  
21  	public static final String COMPONENT_TYPE="org.rcfaces.core.keyLabel";
22  
23  	protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractOutputComponent.CAMELIA_ATTRIBUTES);
24  	static {
25  		CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"parentsStyleClass","selectedStyleClass","filterProperties","showParents"}));
26  	}
27  
28  	public KeyLabelComponent() {
29  		setRendererType(COMPONENT_TYPE);
30  	}
31  
32  	public KeyLabelComponent(String componentId) {
33  		this();
34  		setId(componentId);
35  	}
36  
37  	public void setFilterProperties(String properties) {
38  
39  
40  			IFilterProperties filterProperties=(IFilterProperties)FilterPropertiesConverter.SINGLETON.getAsObject(null, this, properties);
41  			
42  			setFilterProperties(filterProperties);
43  		
44  	}
45  
46  	public org.rcfaces.core.model.IFilterProperties getFilterProperties() {
47  		return getFilterProperties(null);
48  	}
49  
50  	/**
51  	 * See {@link #getFilterProperties() getFilterProperties()} for more details
52  	 */
53  	public org.rcfaces.core.model.IFilterProperties getFilterProperties(javax.faces.context.FacesContext facesContext) {
54  		return (org.rcfaces.core.model.IFilterProperties)engine.getProperty(Properties.FILTER_PROPERTIES, facesContext);
55  	}
56  
57  	/**
58  	 * Returns <code>true</code> if the attribute "filterProperties" is set.
59  	 * @return <code>true</code> if the attribute is set.
60  	 */
61  	public final boolean isFilterPropertiesSetted() {
62  		return engine.isPropertySetted(Properties.FILTER_PROPERTIES);
63  	}
64  
65  	public void setFilterProperties(org.rcfaces.core.model.IFilterProperties filterProperties) {
66  		engine.setProperty(Properties.FILTER_PROPERTIES, filterProperties);
67  	}
68  
69  	public String getSelectedStyleClass() {
70  		return getSelectedStyleClass(null);
71  	}
72  
73  	public String getSelectedStyleClass(javax.faces.context.FacesContext facesContext) {
74  		return engine.getStringProperty(Properties.SELECTED_STYLE_CLASS, facesContext);
75  	}
76  
77  	public void setSelectedStyleClass(String selectedStyleClass) {
78  		engine.setProperty(Properties.SELECTED_STYLE_CLASS, selectedStyleClass);
79  	}
80  
81  	/**
82  	 * Returns <code>true</code> if the attribute "selectedStyleClass" is set.
83  	 * @return <code>true</code> if the attribute is set.
84  	 */
85  	public boolean isSelectedStyleClassSetted() {
86  		return engine.isPropertySetted(Properties.SELECTED_STYLE_CLASS);
87  	}
88  
89  	public String getParentsStyleClass() {
90  		return getParentsStyleClass(null);
91  	}
92  
93  	public String getParentsStyleClass(javax.faces.context.FacesContext facesContext) {
94  		return engine.getStringProperty(Properties.PARENTS_STYLE_CLASS, facesContext);
95  	}
96  
97  	public void setParentsStyleClass(String parentsStyleClass) {
98  		engine.setProperty(Properties.PARENTS_STYLE_CLASS, parentsStyleClass);
99  	}
100 
101 	/**
102 	 * Returns <code>true</code> if the attribute "parentsStyleClass" is set.
103 	 * @return <code>true</code> if the attribute is set.
104 	 */
105 	public boolean isParentsStyleClassSetted() {
106 		return engine.isPropertySetted(Properties.PARENTS_STYLE_CLASS);
107 	}
108 
109 	public boolean isShowParents() {
110 		return isShowParents(null);
111 	}
112 
113 	public boolean isShowParents(javax.faces.context.FacesContext facesContext) {
114 		return engine.getBoolProperty(Properties.SHOW_PARENTS, false, facesContext);
115 	}
116 
117 	public void setShowParents(boolean showParents) {
118 		engine.setProperty(Properties.SHOW_PARENTS, showParents);
119 	}
120 
121 	/**
122 	 * Returns <code>true</code> if the attribute "showParents" is set.
123 	 * @return <code>true</code> if the attribute is set.
124 	 */
125 	public boolean isShowParentsSetted() {
126 		return engine.isPropertySetted(Properties.SHOW_PARENTS);
127 	}
128 
129 	protected Set getCameliaFields() {
130 		return CAMELIA_ATTRIBUTES;
131 	}
132 }