KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > formmodel > SelectableWidget


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
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.apache.cocoon.forms.formmodel;
17
18 import org.apache.cocoon.forms.datatype.SelectionList;
19
20 /**
21  * A {@link Widget} that can have a selection list. The initial selection list is set by the
22  * widget's {@link WidgetDefinition}, and can be changed afterwards. The selection list can
23  * be removed by setting the list to <code>null</code>.
24  *
25  * @version $Id: SelectableWidget.java 155211 2005-02-24 17:05:51Z sylvain $
26  */

27 public interface SelectableWidget extends Widget {
28
29     /**
30      * Set the widget's selection list given a {@link SelectionList}.
31      *
32      * @param selectionList the selection list or <code>null</code> to have no selection list.
33      */

34     public void setSelectionList(SelectionList selectionList);
35
36     /**
37      * Set the widget's selection list given a source URI where the list will be read from.
38      *
39      * @param uri the selection list's URI
40      */

41     public void setSelectionList(String JavaDoc uri);
42
43     /**
44      * Set the widgdet's selection given an object and XPath expressions.
45      *
46      * @param model the selection list model. This is typically a collection or an array of objects
47      * in which <code>valuePath</code> and <code>labelPath</code> will extract some data.
48      * @param valuePath the XPath expression to extract values
49      * @param labelPath the XPath expression to extract labels (can be absent in which case the value is
50      * used as label).
51      */

52     public void setSelectionList(Object JavaDoc model, String JavaDoc valuePath, String JavaDoc labelPath);
53 }
54
Popular Tags