use of org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider 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.common.uicommon.model.SearchableDetailTabModelProvider in project ovirt-engine by oVirt.
the class VirtualMachineModule method getVmDiskListProvider.
@Provides
@Singleton
public SearchableDetailModelProvider<Disk, VmListModel<Void>, VmDiskListModel> getVmDiskListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VmDiskPopupPresenterWidget> popupProvider, final Provider<VmDiskAttachPopupPresenterWidget> attachPopupProvider, final Provider<VmDiskRemovePopupPresenterWidget> removeConfirmPopupProvider, final Provider<VmDiskSparsifyPopupPresenterWidget> sparsifyConfirmPopupProvider, final Provider<DisksAllocationPopupPresenterWidget> movePopupProvider, final Provider<ChangeQuotaPopupPresenterWidget> changeQutoaPopupProvider, final Provider<VmListModel<Void>> mainModelProvider, final Provider<VmDiskListModel> modelProvider) {
SearchableDetailTabModelProvider<Disk, VmListModel<Void>, VmDiskListModel> result = new SearchableDetailTabModelProvider<Disk, VmListModel<Void>, VmDiskListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(VmDiskListModel source, UICommand lastExecutedCommand, Model windowModel) {
VmDiskListModel model = getModel();
if (lastExecutedCommand == model.getNewCommand() || lastExecutedCommand == model.getEditCommand()) {
return popupProvider.get();
} else if (lastExecutedCommand == getModel().getAttachCommand()) {
return attachPopupProvider.get();
} else if (lastExecutedCommand == getModel().getMoveCommand()) {
return movePopupProvider.get();
} else if (lastExecutedCommand == getModel().getChangeQuotaCommand()) {
return changeQutoaPopupProvider.get();
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VmDiskListModel source, UICommand lastExecutedCommand) {
if (lastExecutedCommand == getModel().getRemoveCommand()) {
return removeConfirmPopupProvider.get();
} else if (lastExecutedCommand == getModel().getSparsifyCommand()) {
return sparsifyConfirmPopupProvider.get();
} else {
return super.getConfirmModelPopup(source, lastExecutedCommand);
}
}
};
result.setMainModelProvider(mainModelProvider);
result.setModelProvider(modelProvider);
return result;
}
use of org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider in project ovirt-engine by oVirt.
the class DataCenterModule method getDataCenterStorageListProvider.
// Search-able Detail Models
@Provides
@Singleton
public SearchableDetailModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel> getDataCenterStorageListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<FindSingleStoragePopupPresenterWidget> singlePopupProvider, final Provider<FindMultiStoragePopupPresenterWidget> multiPopupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<DataCenterListModel> mainModelProvider, final Provider<DataCenterStorageListModel> modelProvider) {
SearchableDetailTabModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel> result = new SearchableDetailTabModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(DataCenterStorageListModel source, UICommand lastExecutedCommand, Model windowModel) {
DataCenterStorageListModel model = getModel();
if (lastExecutedCommand == model.getAttachStorageCommand()) {
return multiPopupProvider.get();
} else if (lastExecutedCommand == model.getAttachISOCommand() || lastExecutedCommand == model.getAttachBackupCommand()) {
return singlePopupProvider.get();
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(DataCenterStorageListModel source, UICommand lastExecutedCommand) {
if (lastExecutedCommand == getModel().getDetachCommand() || lastExecutedCommand.getName().equals("OnAttach")) {
// $NON-NLS-1$ ) {
return removeConfirmPopupProvider.get();
} else if (lastExecutedCommand == getModel().getMaintenanceCommand() || lastExecutedCommand.getName().equals("OnMaintenance")) {
// $NON-NLS-1$) {
return removeConfirmPopupProvider.get();
} else {
return super.getConfirmModelPopup(source, lastExecutedCommand);
}
}
};
result.setMainModelProvider(mainModelProvider);
result.setModelProvider(modelProvider);
return result;
}
use of org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider in project ovirt-engine by oVirt.
the class StorageModule method getStorageDataCenterListProvider.
// Searchable Detail Models
@Provides
@Singleton
public SearchableDetailModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel> getStorageDataCenterListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<FindSingleDcPopupPresenterWidget> singlePopupProvider, final Provider<FindMultiDcPopupPresenterWidget> multiPopupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<StorageListModel> mainModelProvider, final Provider<StorageDataCenterListModel> modelProvider) {
SearchableDetailTabModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel> result = new SearchableDetailTabModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(StorageDataCenterListModel source, UICommand lastExecutedCommand, Model windowModel) {
StorageDataCenterListModel model = getModel();
if (lastExecutedCommand == model.getAttachCommand()) {
if (model.getAttachMultiple()) {
return multiPopupProvider.get();
} else {
return singlePopupProvider.get();
}
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(StorageDataCenterListModel source, UICommand lastExecutedCommand) {
if (lastExecutedCommand == getModel().getDetachCommand() || lastExecutedCommand.getName().equals("OnAttach")) {
// $NON-NLS-1$) {
return removeConfirmPopupProvider.get();
} else if (lastExecutedCommand == getModel().getMaintenanceCommand() || lastExecutedCommand.getName().equals("OnMaintenance")) {
// $NON-NLS-1$) {
return removeConfirmPopupProvider.get();
} else {
return super.getConfirmModelPopup(source, lastExecutedCommand);
}
}
};
result.setMainModelProvider(mainModelProvider);
result.setModelProvider(modelProvider);
return result;
}
use of org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider in project ovirt-engine by oVirt.
the class VirtualMachineModule method getVmInterfaceListProvider.
@Provides
@Singleton
public SearchableDetailModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel> getVmInterfaceListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VmInterfacePopupPresenterWidget> popupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<VmListModel<Void>> mainModelProvider, final Provider<VmInterfaceListModel> modelProvider) {
SearchableDetailTabModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel> result = new SearchableDetailTabModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(VmInterfaceListModel source, UICommand lastExecutedCommand, Model windowModel) {
VmInterfaceListModel model = getModel();
if (lastExecutedCommand == model.getNewCommand() || lastExecutedCommand == model.getEditCommand()) {
return popupProvider.get();
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VmInterfaceListModel source, UICommand lastExecutedCommand) {
if (lastExecutedCommand == getModel().getRemoveCommand()) {
return removeConfirmPopupProvider.get();
} else {
return super.getConfirmModelPopup(source, lastExecutedCommand);
}
}
};
result.setMainModelProvider(mainModelProvider);
result.setModelProvider(modelProvider);
return result;
}
Aggregations