01: /*
02: * $Id: IItemReuseStrategy.java 460550 2006-05-07 18:16:52Z ivaynberg $ $Revision:
03: * 3843 $ $Date: 2006-05-07 20:16:52 +0200 (Sun, 07 May 2006) $
04: *
05: * ==================================================================== Licensed
06: * under the Apache License, Version 2.0 (the "License"); you may not use this
07: * file except in compliance with the License. You may obtain a copy of the
08: * 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.extensions.markup.html.repeater.refreshing;
19:
20: import java.io.Serializable;
21: import java.util.Iterator;
22:
23: /**
24: * Interface for item reuse strategies.
25: * <p>
26: * <u>Notice:</u> Child items will be rendered in the order they are provided
27: * by the returned iterator, so it is important that the strategy preserve this
28: * order
29: * </p>
30: *
31: * @author Igor Vaynberg (ivaynberg)
32: *
33: */
34: public interface IItemReuseStrategy extends Serializable {
35:
36: /**
37: * Returns an iterator over items that will be added to the view. The
38: * iterator needs to return all the items because the old ones are removed
39: * prior to the new ones added.
40: *
41: * @param factory
42: * implementation of IItemFactory
43: * @param newModels
44: * iterator over models for items
45: * @param existingItems
46: * iterator over child items
47: * @return iterator over items that will be added after all the old items
48: * are moved.
49: */
50: Iterator getItems(IItemFactory factory, Iterator newModels,
51: Iterator existingItems);
52: }
|