use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel 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.uicommonweb.models.ConfirmationModel 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.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostInterfaceListModel method syncAllHostNetworks.
public void syncAllHostNetworks() {
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().syncAllHostNetworkConfirmationDialogTitle());
model.setHelpTag(HelpTag.sync_all_host_networks);
// $NON-NLS-1$
model.setHashName("sync_all_host_networks");
model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToSyncAllHostNetworksMsg());
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSyncAllHostNetworkConfirm", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostInterfaceListModel method onSyncAllHostNetworkConfirm.
private void onSyncAllHostNetworkConfirm() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
getWindow().startProgress();
Frontend.getInstance().runAction(ActionType.SyncAllHostNetworks, new VdsActionParameters(getEntity().getId()), result -> {
getWindow().stopProgress();
cancel();
}, null);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class HostInterfaceListModel method saveNetworkConfig.
public void saveNetworkConfig() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().saveNetworkConfigurationTitle());
model.setHelpTag(HelpTag.save_network_configuration);
// $NON-NLS-1$
model.setHashName("save_network_configuration");
model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToMakeTheChangesPersistentMsg());
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveNetworkConfig", this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(tempVar2);
}
Aggregations