Search in sources :

Example 1 with SearchableTableModelProvider

use of org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider in project ovirt-engine by oVirt.

the class AbstractActionStackPanelItem method addDoubleClickHandler.

void addDoubleClickHandler(final W widget, final M modelProvider) {
    if (modelProvider instanceof SearchableTableModelProvider<?, ?>) {
        widget.addDomHandler(event -> {
            SearchableListModel model = ((SearchableTableModelProvider<?, ?>) modelProvider).getModel();
            UICommand command = model.getDoubleClickCommand();
            if (command != null && command.getIsExecutionAllowed()) {
                DeferredModelCommandInvoker invoker = new DeferredModelCommandInvoker(model);
                invoker.invokeCommand(command);
            }
        }, DoubleClickEvent.getType());
    }
}
Also used : SearchableListModel(org.ovirt.engine.ui.uicommonweb.models.SearchableListModel) DeferredModelCommandInvoker(org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker) SearchableTableModelProvider(org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Aggregations

DeferredModelCommandInvoker (org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker)1 SearchableTableModelProvider (org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 SearchableListModel (org.ovirt.engine.ui.uicommonweb.models.SearchableListModel)1