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.list;
16:
17: import org.araneaframework.core.Assert;
18: import org.araneaframework.uilib.form.formlist.BeanFormListWidget;
19: import org.araneaframework.uilib.form.formlist.FormRowHandler;
20: import org.araneaframework.uilib.form.formlist.model.ListWidgetFormListModel;
21:
22: /**
23: * @author Jevgeni Kabanov (ekabanov <i>at</i> araneaframework <i>dot</i> org)
24: */
25: public class EditableBeanListWidget extends BeanListWidget {
26:
27: protected BeanFormListWidget formList;
28:
29: //*********************************************************************
30: //* CONSTRUCTORS
31: //*********************************************************************
32:
33: public EditableBeanListWidget(FormRowHandler rowHandler,
34: Class beanClass) {
35: super (beanClass);
36:
37: formList = new BeanFormListWidget(rowHandler,
38: new ListWidgetFormListModel(this ), beanClass);
39: }
40:
41: //*********************************************************************
42: //* PUBLIC METHODS
43: //*********************************************************************
44:
45: /**
46: * Returns the editable row manager.
47: * @return the editable row manager.
48: */
49: public BeanFormListWidget getFormList() {
50: return formList;
51: }
52:
53: public void setFormRowHandler(FormRowHandler rowHandler) {
54: formList.setFormRowHandler(rowHandler);
55: }
56:
57: //*********************************************************************
58: //* WIDGET METHODS
59: //*********************************************************************
60:
61: protected void init() throws Exception {
62: super .init();
63:
64: Assert
65: .notNull(formList,
66: "You must provide a form row handler to the editable list!");
67:
68: addWidget("formList", formList);
69: }
70: }
|