View Javadoc

1   package org.rcfaces.core.component;
2   
3   import org.rcfaces.core.internal.component.Properties;
4   import javax.el.ValueExpression;
5   import org.rcfaces.core.component.ImageButtonComponent;
6   import org.apache.commons.logging.Log;
7   import java.util.HashSet;
8   import org.apache.commons.logging.LogFactory;
9   import java.util.Arrays;
10  import java.util.Set;
11  import org.rcfaces.core.component.capability.IForCapability;
12  
13  /**
14   * <p>The helpButton Component is an <A href="/comps/imageButtonComponent.html">ImageButton</A>. It opens a new page showing the url specified in the "helpUrl" property of a component linked by the "for" property.</p>
15   * <p>The helpButton Component has the following capabilities :
16   * <ul>
17   * <li>IForCapability</li>
18   * </ul>
19   * </p>
20   * 
21   * <p>The default <a href="/apidocs/index.html?org/rcfaces/core/component/HelpButtonComponent.html">helpButton</a> renderer is link to the <a href="/jsdocs/index.html?f_helpButton.html" target="_blank">f_helpButton</a> javascript class. f_helpButton extends f_imageButton</p>
22   * 
23   * 
24   * <p>Table of component style classes : </p>
25   * 
26   * <table border="1" cellpadding="3" cellspacing="0"  width="100%">
27   * <tbody >
28   * <tr  style="text-align:left">
29   * <td bgcolor="#eeeeee"  width="33%">
30   * Style Name
31   * </td>
32   * <td bgcolor="#eeeeee"  width="50%">
33   * Description
34   * </td>
35   * </tr>
36   * <tr  style="text-align:left">
37   * <td  width="33%">
38   * f_helpButton
39   * </td>The server reported an error while performing the "cvs commit" command.
40   * org.rcfaces.core: cvs commit: sticky tag `1.3' for file `metadatas/camelia-doc.xml' is not a branch
41   * org.rcfaces.core: cvs [commit aborted]: correct above errors first!
42   * <td width="50%">
43   * Defines styles for the wrapper DIV element
44   * </td>
45   * </tr>
46   * <tr style="text-align:left">
47   * <td  width="33%">
48   * f_helpButton_ctext
49   * </td>
50   * <td width="50%">
51   * Defines styles for the button Text
52   * </td>
53   * </tr>
54   * <tr style="text-align:left">
55   * <td width="33%">
56   * f_helpButton_cimage
57   * </td>
58   * <td width="50%">
59   * Defines styles for the button Image
60   * </td>
61   * </tr>
62   * </tbody>
63   * </table>
64   */
65  public class HelpButtonComponent extends ImageButtonComponent implements 
66  	IForCapability {
67  
68  	private static final Log LOG = LogFactory.getLog(HelpButtonComponent.class);
69  
70  	public static final String COMPONENT_TYPE="org.rcfaces.core.helpButton";
71  
72  	protected static final Set CAMELIA_ATTRIBUTES=new HashSet(ImageButtonComponent.CAMELIA_ATTRIBUTES);
73  	static {
74  		CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"for"}));
75  	}
76  
77  	public HelpButtonComponent() {
78  		setRendererType(COMPONENT_TYPE);
79  	}
80  
81  	public HelpButtonComponent(String componentId) {
82  		this();
83  		setId(componentId);
84  	}
85  
86  	public java.lang.String getFor() {
87  		return getFor(null);
88  	}
89  
90  	/**
91  	 * See {@link #getFor() getFor()} for more details
92  	 */
93  	public java.lang.String getFor(javax.faces.context.FacesContext facesContext) {
94  		return engine.getStringProperty(Properties.FOR, facesContext);
95  	}
96  
97  	/**
98  	 * Returns <code>true</code> if the attribute "for" is set.
99  	 * @return <code>true</code> if the attribute is set.
100 	 */
101 	public final boolean isForSetted() {
102 		return engine.isPropertySetted(Properties.FOR);
103 	}
104 
105 	public void setFor(java.lang.String forValue) {
106 		engine.setProperty(Properties.FOR, forValue);
107 	}
108 
109 	protected Set getCameliaFields() {
110 		return CAMELIA_ATTRIBUTES;
111 	}
112 }