Search in sources :

Example 1 with HasUiCommandClickHandlers

use of org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers in project ovirt-engine by oVirt.

the class AbstractModelBoundPopupPresenterWidget method addFooterButtons.

void addFooterButtons(T model) {
    for (int i = model.getCommands().size() - 1; i >= 0; i--) {
        UICommand command = model.getCommands().get(i);
        final HasUiCommandClickHandlers button = getView().addFooterButton(command.getTitle(), command.getName(), model.getDefaultCommand() != null && model.getDefaultCommand().equals(command));
        button.setCommand(command);
        // Register command execution handler
        registerHandler(button.addClickHandler(event -> {
            getView().flush();
            beforeCommandExecuted(button.getCommand());
            button.getCommand().execute();
        }));
    }
}
Also used : ModelBoundPopupHandler(org.ovirt.engine.ui.common.uicommon.model.ModelBoundPopupHandler) WebUtils(org.ovirt.engine.ui.common.utils.WebUtils) ModelBoundPopupResolver(org.ovirt.engine.ui.common.uicommon.model.ModelBoundPopupResolver) EventBus(com.google.gwt.event.shared.EventBus) HasEditorDriver(org.ovirt.engine.ui.common.widget.HasEditorDriver) HasUiCommandClickHandlers(org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers) AsyncOperationCompleteEvent(org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent) AsyncOperationStartedEvent(org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) ContextSensitiveHelpManager(org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) List(java.util.List) Provider(com.google.inject.Provider) HasCleanup(org.ovirt.engine.ui.uicommonweb.HasCleanup) DeferredModelCommandInvoker(org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker) DefaultConfirmationPopupPresenterWidget(org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget) ObservableCollection(org.ovirt.engine.ui.uicompat.ObservableCollection) Model(org.ovirt.engine.ui.uicommonweb.models.Model) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) HasUiCommandClickHandlers(org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers)

Aggregations

EventBus (com.google.gwt.event.shared.EventBus)1 Provider (com.google.inject.Provider)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DefaultConfirmationPopupPresenterWidget (org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget)1 ContextSensitiveHelpManager (org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager)1 DeferredModelCommandInvoker (org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker)1 ModelBoundPopupHandler (org.ovirt.engine.ui.common.uicommon.model.ModelBoundPopupHandler)1 ModelBoundPopupResolver (org.ovirt.engine.ui.common.uicommon.model.ModelBoundPopupResolver)1 WebUtils (org.ovirt.engine.ui.common.utils.WebUtils)1 HasEditorDriver (org.ovirt.engine.ui.common.widget.HasEditorDriver)1 HasUiCommandClickHandlers (org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers)1 AsyncOperationCompleteEvent (org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent)1 AsyncOperationStartedEvent (org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent)1 HasCleanup (org.ovirt.engine.ui.uicommonweb.HasCleanup)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 ListModel (org.ovirt.engine.ui.uicommonweb.models.ListModel)1 Model (org.ovirt.engine.ui.uicommonweb.models.Model)1