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.FormListWidget;
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 EditableListWidget extends ListWidget {
26:
27: protected FormListWidget formList;
28:
29: //*********************************************************************
30: //* CONSTRUCTORS
31: //*********************************************************************
32:
33: public EditableListWidget(FormRowHandler rowHandler) {
34: formList = new FormListWidget(rowHandler,
35: new ListWidgetFormListModel(this ));
36: }
37:
38: //*********************************************************************
39: //* PUBLIC METHODS
40: //*********************************************************************
41:
42: /**
43: * Returns the editable row manager.
44: * @return the editable row manager.
45: */
46: public FormListWidget getFormList() {
47: return formList;
48: }
49:
50: public void setFormRowHandler(FormRowHandler rowHandler) {
51: formList.setFormRowHandler(rowHandler);
52: }
53:
54: //*********************************************************************
55: //* WIDGET METHODS
56: //*********************************************************************
57:
58: protected void init() throws Exception {
59: super .init();
60:
61: Assert
62: .notNull(formList,
63: "You must provide a form row handler to the editable list!");
64:
65: addWidget("formList", formList);
66: }
67: }
|