Search in sources :

Example 1 with UserPermissionListModel

use of org.ovirt.engine.ui.uicommonweb.models.users.UserPermissionListModel in project ovirt-engine by oVirt.

the class UserModule method getPermissionListProvider.

@Provides
@Singleton
public SearchableDetailModelProvider<Permission, UserListModel, UserPermissionListModel> getPermissionListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<UserRolesPopupPresenterWidget> popupProvider, final Provider<RolePermissionsRemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<UserListModel> mainModelProvider, final Provider<UserPermissionListModel> modelProvider) {
    SearchableDetailTabModelProvider<Permission, UserListModel, UserPermissionListModel> result = new SearchableDetailTabModelProvider<Permission, UserListModel, UserPermissionListModel>(eventBus, defaultConfirmPopupProvider) {

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(UserPermissionListModel source, UICommand lastExecutedCommand, Model windowModel) {
            UserPermissionListModel model = getModel();
            if (lastExecutedCommand == model.getAddRoleToUserCommand()) {
                return popupProvider.get();
            } else {
                return super.getModelPopup(source, lastExecutedCommand, windowModel);
            }
        }

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(UserPermissionListModel source, UICommand lastExecutedCommand) {
            if (lastExecutedCommand == getModel().getRemoveCommand()) {
                return removeConfirmPopupProvider.get();
            } else {
                return super.getConfirmModelPopup(source, lastExecutedCommand);
            }
        }
    };
    result.setMainModelProvider(mainModelProvider);
    result.setModelProvider(modelProvider);
    return result;
}
Also used : Permission(org.ovirt.engine.core.common.businessentities.Permission) UserPermissionListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserPermissionListModel) UserGeneralModel(org.ovirt.engine.ui.uicommonweb.models.users.UserGeneralModel) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) UserQuotaListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserQuotaListModel) UserListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserListModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) UserEventNotifierListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserEventNotifierListModel) UserEventListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserEventListModel) UserGroupListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel) UserListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserListModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) UserPermissionListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserPermissionListModel) SearchableDetailTabModelProvider(org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 Permission (org.ovirt.engine.core.common.businessentities.Permission)1 SearchableDetailTabModelProvider (org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 Model (org.ovirt.engine.ui.uicommonweb.models.Model)1 UserEventListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserEventListModel)1 UserEventNotifierListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserEventNotifierListModel)1 UserGeneralModel (org.ovirt.engine.ui.uicommonweb.models.users.UserGeneralModel)1 UserGroupListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel)1 UserListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserListModel)1 UserPermissionListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserPermissionListModel)1 UserQuotaListModel (org.ovirt.engine.ui.uicommonweb.models.users.UserQuotaListModel)1