KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > toolbar > FormButtonTag


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.toolbar;
14
15 import javax.servlet.jsp.JspException JavaDoc;
16
17 import com.tonbeller.wcf.component.Component;
18 import com.tonbeller.wcf.controller.RequestContext;
19
20 /**
21  * Created on 06.01.2003
22  *
23  * @author av
24  */

25 public class FormButtonTag extends ToolButtonTag {
26   String JavaDoc action;
27   String JavaDoc forward;
28   String JavaDoc form;
29   
30   /**
31    * @see com.tonbeller.wcf.toolbar.ToolButtonTag#getToolButtonModel()
32    */

33   protected ToolButtonModel getToolButtonModel(RequestContext context) throws JspException JavaDoc {
34     Component f = (Component)context.getModelReference(form);
35     if (f == null)
36       throw new JspException JavaDoc("could not find form " + form);
37     FormButtonModel fm = new FormButtonModel(f);
38     fm.setAction(action);
39     fm.setForward(forward);
40     return fm;
41   }
42
43   /**
44    * Sets the action.
45    * @param action The action to set
46    */

47   public void setAction(String JavaDoc action) {
48     this.action = action;
49   }
50
51   /**
52    * Sets the forward.
53    * @param forward The forward to set
54    */

55   public void setForward(String JavaDoc forward) {
56     this.forward = forward;
57   }
58
59   /**
60    * @param string
61    */

62   public void setForm(String JavaDoc string) {
63     form = string;
64   }
65
66 }
67
Popular Tags