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());
}
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;
}
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;
}
Aggregations