use of org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel 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.NewHostModel 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);
}
Aggregations