this.modelStore = modelStore;
}
public void registerIn(final ActionRegistry registry) {
registry.register(FIRST_FILL_CMD, new CommandHandler() {
public void handleCommand(Command command, List response) {
for (int i = 0; i < 10; i++) {
String pmid = "First " + i;
Map data = new HashMap();
data.put(TEXT, pmid);
response.add(new DataCommand(data));
}
}
});
registry.register(SECOND_FILL_CMD, new CommandHandler() {
public void handleCommand(Command command, List response) {
for (int i = 0; i < 10; i++) {
String pmid = "Second " + i;
Map data = new HashMap();
data.put(TEXT, pmid);
response.add(new DataCommand(data));
}
}
});
registry.register(SEARCH_CMD, new CommandHandler() {
public void handleCommand(Command command, List response) {
PresentationModel searchCriteria = modelStore.findPresentationModelById(SEARCH_CRITERIA);
if (searchCriteria == null) {
throw new IllegalStateException("No search criteria known on the server!");
}