View Javadoc

1   package org.rcfaces.core.component;
2   
3   import org.rcfaces.core.internal.component.Properties;
4   import org.rcfaces.core.internal.component.CameliaItemComponent;
5   import javax.el.ValueExpression;
6   import org.apache.commons.logging.Log;
7   import java.util.HashSet;
8   import java.lang.String;
9   import org.apache.commons.logging.LogFactory;
10  import java.util.Arrays;
11  import java.util.Set;
12  
13  public abstract class FileItemComponent extends CameliaItemComponent {
14  
15  	private static final Log LOG = LogFactory.getLog(FileItemComponent.class);
16  
17  	protected static final Set CAMELIA_ATTRIBUTES=new HashSet(CameliaItemComponent.CAMELIA_ATTRIBUTES);
18  	static {
19  		CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"charSet","src"}));
20  	}
21  
22  
23  	public void setSrc(String src) {
24  
25  
26  			setItemValue(src);
27  			
28  	}
29  
30  	public String getSrc() {
31  
32  
33  			return (String)getItemValue();
34  			
35  	}
36  
37  	public String getCharSet() {
38  		return getCharSet(null);
39  	}
40  
41  	public String getCharSet(javax.faces.context.FacesContext facesContext) {
42  		return engine.getStringProperty(Properties.CHAR_SET, facesContext);
43  	}
44  
45  	public void setCharSet(String charSet) {
46  		engine.setProperty(Properties.CHAR_SET, charSet);
47  	}
48  
49  	/**
50  	 * Returns <code>true</code> if the attribute "charSet" is set.
51  	 * @return <code>true</code> if the attribute is set.
52  	 */
53  	public boolean isCharSetSetted() {
54  		return engine.isPropertySetted(Properties.CHAR_SET);
55  	}
56  
57  	protected Set getCameliaFields() {
58  		return CAMELIA_ATTRIBUTES;
59  	}
60  
61  	public void setValueExpression(String name, ValueExpression binding) {
62  		if (Properties.SRC.equals(name)) {
63  			name=Properties.ITEM_VALUE;
64  		}
65  		super.setValueExpression(name, binding);
66  	}
67  }