1 package org.paneris.jammyjoes.mvp; 2 3 import java.util.HashMap; 4 import java.util.List; 5 import java.util.Map; 6 7 import org.melati.poem.Selectable; 8 import org.paneris.jammyjoes.controller.MonthlyTimesliceFactory; 9 10 public class OrdersByMonthPresenter extends AbstractPresenter implements Presenter { 11 12 private Selectable _ordersTable; 13 private Map _monthMap; 14 private TimesliceValue _max; 15 private List _status; 16 17 public OrdersByMonthPresenter(Selectable ordersTable, Context context, List status) { 18 _ordersTable = ordersTable; 19 _monthMap = new HashMap(); 20 _status = status; 21 _max = new TimesliceValue(null, 0); 22 context.put("months", _monthMap); 23 context.put("max", _max); 24 context.put("sorter", new CollectionSorter()); 25 context.put("reversesorter", new ReverseCollectionSorter()); 26 } 27 28 public Selection createSelection() { 29 return new OrderSelection(_ordersTable, _status, null, null, null); 30 } 31 32 public Command createCommand() { 33 return new CollectingCommand(_monthMap, _max , new MonthlyTimesliceFactory(null), new AffiliateTotals()); 34 } 35 36 }