KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > navigation > tags > InWizardTag


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.navigation.tags;
21
22 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
23
24 import org.apache.commons.logging.Log;
25 import org.apache.commons.logging.LogFactory;
26
27 import com.sslexplorer.security.Constants;
28 import com.sslexplorer.wizard.AbstractWizardSequence;
29
30 public class InWizardTag extends TagSupport JavaDoc {
31     final static Log log = LogFactory.getLog(InWizardTag.class);
32     
33     private String JavaDoc value;
34     private String JavaDoc finish = "true";
35
36     /**
37      * @return Returns the finish.
38      */

39     public String JavaDoc getFinish() {
40         return finish;
41     }
42
43     /**
44      * @param finish The finish to set.
45      */

46     public void setFinish(String JavaDoc finish) {
47         this.finish = finish;
48     }
49
50     public InWizardTag() {
51         value = "true";
52     }
53
54     public int doStartTag() {
55         AbstractWizardSequence seq = (AbstractWizardSequence)pageContext.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
56         if (seq != null && ( finish.equals("true") || seq.getCurrentPageForm().getStepIndex() != 0 ) ) {
57             return value.equalsIgnoreCase("false") ? SKIP_BODY : EVAL_BODY_INCLUDE;
58         }
59         return value.equalsIgnoreCase("false") ? EVAL_BODY_INCLUDE : SKIP_BODY;
60     }
61
62     /**
63      * @return Returns the value.
64      */

65     public String JavaDoc getValue() {
66         return value;
67     }
68
69     /**
70      * @param value The value to set.
71      */

72     public void setValue(String JavaDoc value) {
73         this.value = value;
74     }
75 }
Popular Tags