use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ClusterGlusterHookListModel method disableHook.
private void disableHook() {
if (getWindow() != null) {
return;
}
if (getSelectedItems() == null || getSelectedItems().size() == 0) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks());
model.setHelpTag(HelpTag.disable_hooks);
// $NON-NLS-1$
model.setHashName("disable_hooks");
model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage());
ArrayList<String> list = new ArrayList<>();
for (GlusterHookEntity hook : getSelectedItems()) {
list.add(hook.getName());
}
model.setItems(list);
// $NON-NLS-1$
UICommand okCommand = UICommand.createDefaultOkUiCommand("OnDisableHook", this);
model.getCommands().add(okCommand);
// $NON-NLS-1$
UICommand cancelCommand = UICommand.createCancelUiCommand("OnCancelConfirmation", this);
model.getCommands().add(cancelCommand);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ClusterGuideModel method onConfirmPMHost.
public void onConfirmPMHost() {
HostModel model = (HostModel) getWindow();
if (!model.validate()) {
return;
}
if (!model.getIsPm().getEntity() && ApplicationModeHelper.getUiMode() != ApplicationMode.GlusterOnly) {
ConfirmationModel confirmModel = new ConfirmationModel();
setConfirmWindow(confirmModel);
confirmModel.setTitle(ConstantsManager.getInstance().getConstants().powerManagementConfigurationTitle());
confirmModel.setHelpTag(HelpTag.power_management_configuration);
// $NON-NLS-1$
confirmModel.setHashName("power_management_configuration");
confirmModel.setMessage(ConstantsManager.getInstance().getConstants().youHavntConfigPmMsg());
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddHost", this);
confirmModel.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmWithFocus", this);
confirmModel.getCommands().add(tempVar2);
} else {
onAddHost();
}
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ClusterListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeClusterTitle());
model.setHelpTag(HelpTag.remove_cluster);
// $NON-NLS-1$
model.setHashName("remove_cluster");
ArrayList<String> list = new ArrayList<>();
for (Cluster a : getSelectedItems()) {
list.add(a.getName());
}
model.setItems(list);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", 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 ClusterListModel method onResetClusterEmulatedMachine.
public void onResetClusterEmulatedMachine() {
final ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> prms = new ArrayList<>();
for (Cluster cluster : getSelectedItems()) {
ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster);
currentParam.setForceResetEmulatedMachine(true);
prms.add(currentParam);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.UpdateCluster, prms, result -> {
model.stopProgress();
cancel();
});
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ClusterListModel method onSaveConfirmCV.
private void onSaveConfirmCV(ClusterModel model) {
if (!model.getVersion().getSelectedItem().equals(getSelectedItem().getCompatibilityVersion())) {
final ConfirmationModel confirmModel = new ConfirmationModel();
setConfirmWindow(confirmModel);
confirmModel.setTitle(constants.changeClusterCompatibilityVersionTitle());
confirmModel.setHelpTag(HelpTag.change_cluster_compatibility_version);
// $NON-NLS-1$
confirmModel.setHashName("change_cluster_compatibility_version");
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveConfirmCpuThreads", this);
getConfirmWindow().getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmation", this);
getConfirmWindow().getCommands().add(tempVar2);
checkForActiveVms(model, confirmModel);
} else {
onSaveConfirmCpuThreads();
}
}
Aggregations