KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > schema > SelectionList


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
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.outerj.daisy.repository.schema;
17
18 import org.outerx.daisy.x10.SelectionListDocument;
19
20 import java.util.Locale JavaDoc;
21
22 /**
23  * A list of values from which one can be selected by the end-user.
24  *
25  * <p>This SelectionList consists of ListItems.
26  */

27 public interface SelectionList {
28     /**
29      * Gets the selection list items.
30      *
31      * <p>By preference, you should use the method {@link #getItems(long, long, java.util.Locale)}.
32      * This method will fail if the selection list implementation requires a branch
33      * and language.
34      *
35      */

36     ListItem[] getItems();
37
38     /**
39      * Gets the selection list items.
40      *
41      * <p>Some selection list implementations might want to filter the items
42      * based on the branch and language of the context in which this selection
43      * list is used (= typically the document that is being edited). Therefore,
44      * it is important that the branch and language or specified.
45      *
46      * @param branchId the branch of the document that is being edited
47      * @param languageId the language of the document that is being edited
48      */

49     ListItem[] getItems(long branchId, long languageId, Locale JavaDoc locale);
50
51     /**
52      * Returns the label defined in the selection list for the given value,
53      * or null if not available.
54      */

55     String JavaDoc getLabel(Object JavaDoc value, Locale JavaDoc locale);
56
57     void addToFieldTypeXml(SelectionListDocument.SelectionList selectionListXml);
58 }
59
Popular Tags