KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > formview > displayer > Property


1 package net.sourceforge.formview.displayer;
2
3 import java.util.Map JavaDoc;
4
5 import net.sourceforge.formview.FieldView;
6
7 /**
8  * Description : Property of Displayer.
9  * @version 1.0.0
10  * @author <a HREF="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
11  *
12  */

13 public class Property extends BaseElement {
14     
15     private String JavaDoc behaviours;
16
17     public String JavaDoc getBehaviours() {
18         return behaviours;
19     }
20
21     public void setBehaviours(String JavaDoc behaviours) {
22         this.behaviours = behaviours;
23     }
24     public String JavaDoc toString() {
25         StringBuffer JavaDoc results = new StringBuffer JavaDoc(super.toString());
26         results.append("\t\tbehaviours = " + behaviours + "\n");
27         return results.toString();
28     }
29
30     public void processHTML(FieldView field, String JavaDoc defaultBehaviour, Map JavaDoc contextValuesMap, StringBuffer JavaDoc htmlContentToInsertBefore, StringBuffer JavaDoc htmlContentToInsertAfter, StringBuffer JavaDoc htmlContentToReplace, Map JavaDoc attributeMap) {
31         // Test if this field depends on Behaviour
32
String JavaDoc behaviour = defaultBehaviour;
33         if (field != null && field.getBehaviour() != null) {
34             behaviour = field.getBehaviour();
35         }
36         if (behaviours != null && behaviours.length() > 0 &&
37                 behaviour != null && behaviour.length() > 0) {
38             // Test with behaviour
39
if (behaviours.indexOf(behaviour) == -1)
40                 return;
41         }
42         
43         if (field != null) {
44             // Test if field depends on maxlength, date or required
45
if (field.isDependsOn(getName())) {
46                 super.processHTML(field, defaultBehaviour, contextValuesMap, htmlContentToInsertBefore, htmlContentToInsertAfter, htmlContentToReplace, attributeMap);
47             }
48         }
49     }
50
51     
52 }
53
Popular Tags