View Javadoc

1   /*
2    * Copyright 2004 Jeff Johnston
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.extremecomponents.table.bean;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.extremecomponents.table.FormAttributes;
20  import org.extremecomponents.table.model.TableModel;
21  import org.extremecomponents.table.model.TableProperties;
22  
23  
24  /***
25   * @author jeff johnston
26   */
27  public class Form implements FormAttributes
28  {
29  	private TableModel model;
30  	
31  	private String name;
32  	private String action;
33  	private String method;
34  	private String onsubmit;
35  	
36  	public Form(TableModel model)
37  	{
38  		this.model = model;
39  	}
40  
41  	public String getName()
42  	{
43  		return name;
44  	}
45  
46  	public void setName(String name)
47  	{
48  		this.name = name;
49  	}
50  
51  	public String getAction()
52  	{
53  		return action;
54  	}
55  
56  	public void setAction(String action)
57  	{
58  		this.action = action;
59  	}
60  
61  	public String getMethod() 
62  	{
63  		if (StringUtils.isBlank(method))
64  		{
65  			method = model.getProperties().getProperty(TableProperties.METHOD);
66  		}
67  		
68  		return method;
69  	}
70  
71  	public void setMethod(String method) 
72  	{
73  		this.method = method;
74  	}
75  
76  	public String getOnsubmit()
77  	{
78  		return onsubmit;
79  	}
80  
81  	public void setOnsubmit(String onsubmit)
82  	{
83  		this.onsubmit = onsubmit;
84  	}
85  }