View Javadoc

1   package org.whatsitcalled.webflange.webapp.model;
2   
3   import java.util.Iterator;
4   
5   import org.apache.wicket.markup.repeater.data.IDataProvider;
6   import org.apache.wicket.model.IModel;
7   import org.whatsitcalled.webflange.ResourceFactory;
8   import org.whatsitcalled.webflange.model.LoadTest;
9   import org.whatsitcalled.webflange.model.LoadTestDAO;
10  
11  public class LoadTestDataProvider implements IDataProvider{
12  
13  	protected LoadTestDAO getDAO() {
14  		return ResourceFactory.getLoadTestDAO();
15  	}
16  
17  	public Iterator iterator(int first, int count) {
18  		return getDAO().getLoadTests(first, count, "project").iterator();
19  	}
20  
21  	public IModel model(Object object) {
22  		return new LoadTestDetachableModel((LoadTest)object);
23  	}
24  
25  	public int size() {
26  		return getDAO().getLoadTests().size();
27  	}
28  
29  	public void detach() {
30  	}
31  
32  }