KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > actionflow > ImageTag


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.actionflow;
8
9
10 import javax.servlet.jsp.JspException JavaDoc;
11
12 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowMetaData;
13 import com.inversoft.verge.mvc.view.jsp.JspTools;
14
15
16 /**
17  * This class is the image submit input tag
18  *
19  * @author Brian Pontarelli
20  */

21 public class ImageTag extends com.inversoft.verge.mvc.view.jsp.html.ImageTag {
22
23     private ActionFlowMetaData metaData;
24     private String JavaDoc entry;
25     protected String JavaDoc localEntry;
26     private boolean modelEnabled = true;
27     private boolean validationEnabled = true;
28
29
30     /**
31      * Retrieves the tag's entry attribute
32      *
33      * @return Returns the tag's entry attribute
34      */

35     public String JavaDoc getEntry() {
36         return entry;
37     }
38
39     /**
40      * Populates the tag's entry attribute
41      *
42      * @param entry The value of the tag's entry attribute
43      */

44     public void setEntry(String JavaDoc entry) {
45         this.entry = entry;
46     }
47
48     /**
49      * Returns whether or not the model is enabled for this request.
50      *
51      * @return True if the model is enabled, false otherwise
52      */

53     public boolean isModelEnabled() {
54         return modelEnabled;
55     }
56
57     /**
58      * Sets whether or not the model is enabled for this request.
59      *
60      * @param modelEnabled True if the model is enabled, false otherwise
61      */

62     public void setModelEnabled(boolean modelEnabled) {
63         this.modelEnabled = modelEnabled;
64     }
65
66     /**
67      * Returns whether or not validation of the model is enabled for this request.
68      *
69      * @return True if validation is enabled, false otherwise
70      */

71     public boolean isValidationEnabled() {
72         return validationEnabled;
73     }
74
75     /**
76      * Sets whether or not validation of the model is enabled for this request.
77      *
78      * @param validationEnabled True if validation is enabled, false otherwise
79      */

80     public void setValidationEnabled(boolean validationEnabled) {
81         this.validationEnabled = validationEnabled;
82     }
83
84     /**
85      * Expands any of the attributes that require it.
86      *
87      * @throws JspException If this tag is not inside a submit tag and the submit
88      * tag is not inside a form tag, or if a property name was not specified
89      */

90     public void initialize() throws JspException JavaDoc {
91
92         // Initialize the parent reference and the bean reference
93
super.initialize();
94
95         localEntry = entry;
96
97         if (!JspTools.JSP_20) {
98             localEntry = (String JavaDoc) JspTools.expand("entry", entry, String JavaDoc.class,
99                 this, pageContext);
100         }
101
102         String JavaDoc ns = ((FormTag) getFormParent()).localNamespace;
103         String JavaDoc form = ((FormTag) getFormParent()).localForm;
104         metaData = new ActionFlowMetaData(ns, form, localEntry, localAction, null);
105         metaData.setModelEnabled(modelEnabled);
106         metaData.setValidationEnabled(validationEnabled);
107     }
108
109     /**
110      * Outputs the extra information required by the container to decode the
111      * model and handle the MVC
112      */

113     public int doEndTag() throws JspException JavaDoc {
114         super.doEndTag();
115
116         ActionFlowHelper.outputControllerExtra(localName, localAction, pageContext,
117             metaData);
118
119         return EVAL_PAGE;
120     }
121 }
Popular Tags