1 | |
package org.paneris.jammyjoes.mvp; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
|
5 | |
import org.melati.poem.Selectable; |
6 | |
|
7 | |
public class CatalogueEntryPresenter extends AbstractPresenter implements Presenter { |
8 | |
|
9 | |
Selectable _productTable; |
10 | |
Context _context; |
11 | |
ArrayList _list; |
12 | |
|
13 | 1 | public CatalogueEntryPresenter(Selectable productTable, Context context) { |
14 | 1 | _productTable = productTable; |
15 | 1 | _context = context; |
16 | 1 | _list = new ArrayList(); |
17 | 1 | context.put("items", _list); |
18 | 1 | } |
19 | |
|
20 | |
public Selection createSelection() { |
21 | 1 | return new ProductSelectionFromContext(_productTable, _context); |
22 | |
} |
23 | |
|
24 | |
public Command createCommand() { |
25 | 1 | return new CollectOverTheTopCommand(_list, 8, _context); |
26 | |
} |
27 | |
|
28 | |
} |