01: /*
02: * $Id: ListItem.java 457783 2005-10-02 10:06:33Z jcompagner $ $Revision:
03: * 1.7 $ $Date: 2005-10-02 12:06:33 +0200 (Sun, 02 Oct 2005) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.markup.html.list;
19:
20: import wicket.markup.html.WebMarkupContainer;
21: import wicket.model.IModel;
22:
23: /**
24: * Container that holds components in a ListView.
25: *
26: * @author Jonathan Locke
27: */
28: public class ListItem extends WebMarkupContainer {
29: private static final long serialVersionUID = 1L;
30:
31: /** The index of the ListItem in the parent ListView */
32: private final int index;
33:
34: /**
35: * A constructor which uses the index and the list provided to create a
36: * ListItem. This constructor is the default one.
37: *
38: * @param index
39: * The index of the item
40: * @param model
41: * The model object of the item
42: */
43: public ListItem(final int index, final IModel model) {
44: super (Integer.toString(index), model);
45: this .index = index;
46: }
47:
48: /**
49: * Gets the index of the listItem in the parent listView.
50: *
51: * @return The index of this listItem in the parent listView
52: */
53: public final int getIndex() {
54: return index;
55: }
56: }
|