ECommandService eCommandService = context.get(ECommandService.class);
final Category lunch = eCommandService.getCategory("z.ex.view.keybindings.category");
if (!lunch.isDefined()) {
lunch.define("Lunch", "Actions take at lunch time.");
}
final Command eatTaco = eCommandService.getCommand("z.ex.view.keybindings.eatTaco");
if (!eatTaco.isDefined()) {
eatTaco.define("Eat That Taco", "Go for the taco.", lunch);
}
EHandlerService eHandlerService = context.get(EHandlerService.class);
final IHandler handler = new AbstractHandler() {
public Object execute(final ExecutionEvent event) throwsExecutionException {
System.out.println("Eat that Taco");
return null;
}
};
eHandlerService.activateHandler("z.ex.view.keybindings.eatTaco", handler);