View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
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, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.plugin.database.component;
17  
18  import java.io.ObjectInputStream.GetField;
19  import java.util.List;
20  
21  import org.seasar.tuigwaa.database.DataRow;
22  import org.seasar.tuigwaa.database.DataTable;
23  import org.seasar.tuigwaa.view.TableFormComponent;
24  
25  public class EditTableDto {
26  
27  	private DataTable dataTable;
28  
29  	private TableFormComponent tableForm;
30  
31  	private List actionLinks;
32  
33  	private int blankRowSize;
34  
35  	private String forwardPage;
36  
37  	public EditTableDto(DataTable dataTable, TableFormComponent editableForm) {
38  		this.dataTable = dataTable;
39  		this.tableForm = editableForm;
40  	}
41  
42  	public DataTable getDataTable() {
43  		return dataTable;
44  	}
45  
46  	public TableFormComponent getTableForm() {
47  		return tableForm;
48  	}
49  
50  	public void setActionLinks(List actionLinks) {
51  		this.actionLinks = actionLinks;
52  	}
53  
54  	public List getActionLinks() {
55  		return actionLinks;
56  	}
57  
58  	public List toEditableHtml(int lineNumber, DataRow dataRow) {
59  		Object obj = null;
60  		if (dataRow != null) {
61  			obj = dataRow.getDataObject();
62  		}
63  		return tableForm.toRowElements(lineNumber, obj, dataTable.getHeaders());
64  	}
65  
66  	public void setBlankRowSize(int blankRowSize) {
67  		this.blankRowSize = blankRowSize;
68  	}
69  
70  	public int getBlankRowSize() {
71  		return blankRowSize;
72  	}
73  
74  	public void setForwardPage(String forwardPage) {
75  		this.forwardPage = forwardPage;
76  	}
77  
78  	public String getForwardPage() {
79  		return forwardPage;
80  	}
81  }