View Javadoc

1   package org.rcfaces.core.component;
2   
3   import org.rcfaces.core.internal.component.Properties;
4   import org.rcfaces.core.component.capability.IOverStyleClassCapability;
5   import javax.el.ValueExpression;
6   import org.apache.commons.logging.Log;
7   import java.util.HashSet;
8   import org.rcfaces.core.component.AbstractOutputComponent;
9   import org.apache.commons.logging.LogFactory;
10  import java.util.Arrays;
11  import java.util.Set;
12  import org.rcfaces.core.component.capability.ILoadEventCapability;
13  
14  /**
15   * <p>The externalBox Component is a container based on the standard HTML tag &lt;IFrame&gt;.  .</p>
16   * <p>The externalBox Component has the following capabilities :
17   * <ul>
18   * <li>ILoadEventCapability</li>
19   * <li>IOverStyleClassCapability</li>
20   * </ul>
21   * </p>
22   * 
23   * 
24   * <p>The default <a href="/apidocs/index.html?org/rcfaces/core/component/ExternalBoxComponent.html">externalBox</a> renderer is link to the <a href="/jsdocs/index.html?f_externalBox.html" target="_blank">f_externalBox</a> javascript class. f_externalBox extends f_component</p>
25   * 
26   * <p>Table of component style classes : </p>
27   * 
28   * <p> Table of component style classes: </p>
29   * <table border="1" cellpadding="3" cellspacing="0" width="100%">
30   * <tbody>
31   * 
32   * <tr style="text-align:left">
33   * <th  width="33%">Style Name</th>
34   * <th width="50%">Description</th>
35   * </tr>
36   * 
37   * <tr  style="text-align:left">
38   * <td width="33%">f_externalBox</td>
39   * <td id="ermvsh" width="50%">Defines styles for the wrapper Frame element</td>
40   * </tr>
41   * 
42   * 
43   * </tbody>
44   * </table>
45   */
46  public class ExternalBoxComponent extends AbstractOutputComponent implements 
47  	ILoadEventCapability,
48  	IOverStyleClassCapability {
49  
50  	private static final Log LOG = LogFactory.getLog(ExternalBoxComponent.class);
51  
52  	public static final String COMPONENT_TYPE="org.rcfaces.core.externalBox";
53  
54  	protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractOutputComponent.CAMELIA_ATTRIBUTES);
55  	static {
56  		CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"scrolling","overStyleClass","contentURL","loadListener"}));
57  	}
58  	protected static final String CAMELIA_VALUE_ALIAS="contentURL";
59  
60  	public ExternalBoxComponent() {
61  		setRendererType(COMPONENT_TYPE);
62  	}
63  
64  	public ExternalBoxComponent(String componentId) {
65  		this();
66  		setId(componentId);
67  	}
68  
69  	public final void addLoadListener(org.rcfaces.core.event.ILoadListener listener) {
70  		addFacesListener(listener);
71  	}
72  
73  	public final void removeLoadListener(org.rcfaces.core.event.ILoadListener listener) {
74  		removeFacesListener(listener);
75  	}
76  
77  	public final javax.faces.event.FacesListener [] listLoadListeners() {
78  		return getFacesListeners(org.rcfaces.core.event.ILoadListener.class);
79  	}
80  
81  	public java.lang.String getOverStyleClass() {
82  		return getOverStyleClass(null);
83  	}
84  
85  	/**
86  	 * See {@link #getOverStyleClass() getOverStyleClass()} for more details
87  	 */
88  	public java.lang.String getOverStyleClass(javax.faces.context.FacesContext facesContext) {
89  		return engine.getStringProperty(Properties.OVER_STYLE_CLASS, facesContext);
90  	}
91  
92  	/**
93  	 * Returns <code>true</code> if the attribute "overStyleClass" is set.
94  	 * @return <code>true</code> if the attribute is set.
95  	 */
96  	public final boolean isOverStyleClassSetted() {
97  		return engine.isPropertySetted(Properties.OVER_STYLE_CLASS);
98  	}
99  
100 	public void setOverStyleClass(java.lang.String overStyleClass) {
101 		engine.setProperty(Properties.OVER_STYLE_CLASS, overStyleClass);
102 	}
103 
104 	public String getScrolling() {
105 		return getScrolling(null);
106 	}
107 
108 	public String getScrolling(javax.faces.context.FacesContext facesContext) {
109 		return engine.getStringProperty(Properties.SCROLLING, facesContext);
110 	}
111 
112 	public void setScrolling(String scrolling) {
113 		engine.setProperty(Properties.SCROLLING, scrolling);
114 	}
115 
116 	/**
117 	 * Returns <code>true</code> if the attribute "scrolling" is set.
118 	 * @return <code>true</code> if the attribute is set.
119 	 */
120 	public boolean isScrollingSetted() {
121 		return engine.isPropertySetted(Properties.SCROLLING);
122 	}
123 
124 	public String getContentURL() {
125 		return getContentURL(null);
126 	}
127 
128 	public String getContentURL(javax.faces.context.FacesContext facesContext) {
129 		return engine.getStringProperty(Properties.CONTENT_URL, facesContext);
130 	}
131 
132 	public void setContentURL(String contentURL) {
133 		engine.setProperty(Properties.CONTENT_URL, contentURL);
134 	}
135 
136 	/**
137 	 * Returns <code>true</code> if the attribute "contentURL" is set.
138 	 * @return <code>true</code> if the attribute is set.
139 	 */
140 	public boolean isContentURLSetted() {
141 		return engine.isPropertySetted(Properties.CONTENT_URL);
142 	}
143 
144 	protected Set getCameliaFields() {
145 		return CAMELIA_ATTRIBUTES;
146 	}
147 
148 	protected String getCameliaValueAlias() {
149 		return CAMELIA_VALUE_ALIAS;
150 	}
151 }