Search in sources :

Example 1 with UserListModel

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

the class UserSubTabPanelPresenter method initDetailTabToModelMapping.

@Override
protected void initDetailTabToModelMapping(Map<TabData, Model> mapping) {
    UserListModel mainModel = modelProvider.getModel();
    mapping.put(DetailTabDataIndex.USER_GENERAL, mainModel.getGeneralModel());
    mapping.put(DetailTabDataIndex.USER_PERMISSION, mainModel.getPermissionListModel());
    mapping.put(DetailTabDataIndex.USER_QUOTA, mainModel.getQuotaListModel());
    mapping.put(DetailTabDataIndex.USER_GROUP, mainModel.getGroupListModel());
    mapping.put(DetailTabDataIndex.USER_EVENT_NOTIFIER, mainModel.getEventNotifierListModel());
    mapping.put(DetailTabDataIndex.USER_EVENT, mainModel.getEventListModel());
}
Also used : UserListModel(org.ovirt.engine.ui.uicommonweb.models.users.UserListModel)

Example 2 with UserListModel

use of org.ovirt.engine.ui.uicommonweb.models.users.UserListModel 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)

Example 3 with UserListModel

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

the class UserModule method getUserListProvider.

// Main List Model
@Provides
@Singleton
public MainModelProvider<DbUser, UserListModel> getUserListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<AssignTagsPopupPresenterWidget> assignTagsPopupProvider, final Provider<PermissionsPopupPresenterWidget> popupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<UserListModel> modelProvider) {
    MainViewModelProvider<DbUser, UserListModel> result = new MainViewModelProvider<DbUser, UserListModel>(eventBus, defaultConfirmPopupProvider) {

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

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(UserListModel source, UICommand lastExecutedCommand) {
            if (lastExecutedCommand == getModel().getRemoveCommand()) {
                return removeConfirmPopupProvider.get();
            } else {
                return super.getConfirmModelPopup(source, lastExecutedCommand);
            }
        }
    };
    result.setModelProvider(modelProvider);
    return result;
}
Also used : MainViewModelProvider(org.ovirt.engine.ui.common.uicommon.model.MainViewModelProvider) 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) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

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