@Override public void onCommandRemove(CommandImpl command) { dialogFactory .createConfirmDialog( messages.removeCommandConfirmationTitle(), messages.removeCommandConfirmationMessage(command.getName()), () -> commandManager .removeCommand(command.getName()) .catchError(showErrorNotification(messages.unableRemove())), null) .show(); }
/** {@inheritDoc} */ @Override public void actionPerformed(ActionEvent e) { if (activePart instanceof CommandsExplorerPresenter) { CommandImpl command = ((CommandsExplorerView) commandsExplorer.getView()).getSelectedCommand(); if (command != null) { commandManager .removeCommand(command.getName()) .then(this::onSuccess) .catchError(this::onFailure); } } else { deleteResourceManager .delete(true, appContext.getResources()) .then(this::onSuccess) .catchError(this::onFailure); } }