private void notifyCommandAdded(CommandImpl command) { eventBus.fireEvent(new CommandAddedEvent(command)); }
@Inject public ExecuteCommandPresenter( ExecuteCommandView view, CommandManager commandManager, Provider<CommandExecutor> commandExecutorProvider, CommandCreationGuide commandCreationGuide, RunGoal runGoal, DebugGoal debugGoal, EventBus eventBus) { this.view = view; this.commandExecutorProvider = commandExecutorProvider; this.commandCreationGuide = commandCreationGuide; view.setDelegate(this); goals = new HashSet<>(); goals.add(runGoal); goals.add(debugGoal); eventBus.addHandler( CommandsLoadedEvent.getType(), e -> commandManager.getCommands().forEach(view::addCommand)); eventBus.addHandler(CommandAddedEvent.getType(), e -> view.addCommand(e.getCommand())); eventBus.addHandler(CommandRemovedEvent.getType(), e -> view.removeCommand(e.getCommand())); eventBus.addHandler( CommandUpdatedEvent.getType(), e -> { view.removeCommand(e.getInitialCommand()); view.addCommand(e.getUpdatedCommand()); }); }
CommandAddedEvent.getType(), e -> refreshViewAndSelectCommand(e.getCommand())); eventBus.addHandler(CommandRemovedEvent.getType(), e -> refreshView()); eventBus.addHandler(CommandUpdatedEvent.getType(), e -> refreshView());
eventBus.addHandler(CommandAddedEvent.getType(), e -> addAction(e.getCommand())); eventBus.addHandler(CommandRemovedEvent.getType(), e -> removeAction(e.getCommand())); eventBus.addHandler(