01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.uilib.form.formlist;
16:
17: import org.araneaframework.uilib.form.BeanFormWidget;
18: import org.araneaframework.uilib.form.FormWidget;
19:
20: /**
21: * Editable rows widget that is used to handle simultenous editing of multiple forms with same structure.
22: *
23: * @author Jevgeni Kabanov (ekabanov <i>at</i> araneaframework <i>dot</i> org)
24: */
25: public class BeanFormListWidget extends BaseFormListWidget {
26: //*******************************************************************
27: // FIELDS
28: //*******************************************************************
29:
30: protected Class beanClass;
31:
32: //*******************************************************************
33: // CONSTRUCTORS
34: //*******************************************************************
35:
36: /**
37: * @param rowHandler row handler.
38: * @param beanClass Class of beans in form
39: */
40: public BeanFormListWidget(FormRowHandler rowHandler, Class beanClass) {
41: super (rowHandler);
42: this .beanClass = beanClass;
43: }
44:
45: /**
46: * @param rowHandler row handler.
47: * @param beanClass Class of beans in form
48: */
49: public BeanFormListWidget(FormRowHandler rowHandler,
50: FormListModel model, Class beanClass) {
51: super (rowHandler, model);
52: this .beanClass = beanClass;
53: }
54:
55: //*******************************************************************
56: // PUBLIC METHODS
57: //*******************************************************************
58:
59: public Class getBeanClass() {
60: return this .beanClass;
61: }
62:
63: //*******************************************************************
64: // PROTECTED METHODS
65: //*******************************************************************
66:
67: protected FormWidget buildAddForm() {
68: return new BeanFormWidget(beanClass);
69: }
70: }
|