use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.
the class ClusterGuideModel method addHost.
public void addHost() {
HostModel model = new NewHostModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
model.setHelpTag(HelpTag.new_host);
// $NON-NLS-1$
model.setHashName("new_host");
model.getPort().setEntity(54321);
model.getOverrideIpTables().setEntity(true);
model.setSpmPriorityValue(null);
model.getCluster().setSelectedItem(getEntity());
model.getCluster().setIsChangeable(false);
AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> {
HostModel model1 = (HostModel) getWindow();
model1.getDataCenter().setItems(dataCenters);
if (getEntity().getStoragePoolId() != null) {
model1.getDataCenter().setSelectedItem(Linq.firstOrNull(dataCenters, new Linq.IdPredicate<>(getEntity().getStoragePoolId())));
}
model1.getDataCenter().setIsChangeable(false);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", ClusterGuideModel.this);
model1.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", ClusterGuideModel.this);
model1.getCommands().add(tempVar2);
}));
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.
the class ClusterGuideModel method postOnAddHost.
public void postOnAddHost(ActionReturnValue returnValue) {
HostModel model = (HostModel) getWindow();
model.stopProgress();
if (returnValue != null && returnValue.getSucceeded()) {
cancel();
postAction();
}
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.
the class DataCenterGuideModel method addHost.
public void addHost() {
final HostModel model = new NewHostModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
model.setHelpTag(HelpTag.new_host_guide_me);
// $NON-NLS-1$
model.setHashName("new_host_guide_me");
model.getPort().setEntity(54321);
model.getOverrideIpTables().setEntity(true);
model.setSpmPriorityValue(null);
model.getDataCenter().setItems(Collections.singletonList(getEntity()), getEntity());
model.getDataCenter().setIsChangeable(false);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", this);
tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
tempVar.setIsDefault(true);
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.hosts.HostModel in project ovirt-engine by oVirt.
the class DataCenterGuideModel method postOnAddHost.
public void postOnAddHost(ActionReturnValue returnValue) {
HostModel model = (HostModel) getWindow();
model.stopProgress();
if (returnValue != null && returnValue.getSucceeded()) {
cancel();
postAction();
}
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel in project ovirt-engine by oVirt.
the class DataCenterGuideModel method onConfirmPMHost.
public void onConfirmPMHost() {
HostModel model = (HostModel) getWindow();
if (!model.validate()) {
return;
}
if (!model.getIsPm().getEntity()) {
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();
}
}
Aggregations