use of org.ovirt.engine.ui.uicompat.UIConstants in project ovirt-engine by oVirt.
the class VolumeListModel method newVolume.
private void newVolume() {
if (getWindow() != null) {
return;
}
VolumeModel volumeModel = new VolumeModel();
volumeModel.setHelpTag(HelpTag.new_volume);
// $NON-NLS-1$
volumeModel.setHashName("new_volume");
volumeModel.setTitle(ConstantsManager.getInstance().getConstants().newVolumeTitle());
setWindow(volumeModel);
AsyncDataProvider.getInstance().getDataCenterByClusterServiceList(new AsyncQuery<>(dataCenters -> {
VolumeModel innerVolumeModel = (VolumeModel) getWindow();
final UIConstants constants = ConstantsManager.getInstance().getConstants();
innerVolumeModel.getDataCenter().setItems(dataCenters);
innerVolumeModel.getDataCenter().setSelectedItem(Linq.firstOrNull(dataCenters));
// $NON-NLS-1$
UICommand command = UICommand.createDefaultOkUiCommand("onCreateVolume", VolumeListModel.this);
innerVolumeModel.getCommands().add(command);
// $NON-NLS-1$
innerVolumeModel.getCommands().add(UICommand.createCancelUiCommand("Cancel", VolumeListModel.this));
}), false, true);
}
use of org.ovirt.engine.ui.uicompat.UIConstants in project ovirt-engine by oVirt.
the class VolumeListModel method optimizeForVirtStore.
private void optimizeForVirtStore() {
UIConstants constants = ConstantsManager.getInstance().getConstants();
if (getSelectedItems() == null || getSelectedItems().size() == 0) {
return;
}
ArrayList<GlusterVolumeEntity> volumesForOptimiseForVirtStore = new ArrayList<>();
Boolean isDiscouragedVolumePresent = false;
StringBuilder discouragedConfigVolumeNamesBuilder = new StringBuilder();
discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreWarning());
for (Object item : getSelectedItems()) {
GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
volumesForOptimiseForVirtStore.add(volume);
if (volume.getReplicaCount() != 3) {
// $NON-NLS-1$
discouragedConfigVolumeNamesBuilder.append(volume.getName() + "\n");
isDiscouragedVolumePresent = true;
}
}
discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage());
if (isDiscouragedVolumePresent) {
ConfirmationModel cModel = new ConfirmationModel();
cModel.setMessage(discouragedConfigVolumeNamesBuilder.toString());
cModel.setTitle(ConstantsManager.getInstance().getConstants().optimiseForVirtStoreTitle());
// $NON-NLS-1$
UICommand cancelOptimiseVirtStoreCommand = new UICommand("CancelOptimizeForVirtStore", this);
cancelOptimiseVirtStoreCommand.setTitle(constants.doNotOptimiseForVirtStore());
cancelOptimiseVirtStoreCommand.setIsCancel(true);
cModel.getCommands().add(cancelOptimiseVirtStoreCommand);
// $NON-NLS-1$
UICommand confirmOptimiseForVirtStoreCommand = new UICommand("ConfirmOptimiseForVirtStore", this);
confirmOptimiseForVirtStoreCommand.setTitle(constants.continueOptimiseForVirtStore());
confirmOptimiseForVirtStoreCommand.setIsDefault(true);
cModel.getCommands().add(confirmOptimiseForVirtStoreCommand);
setConfirmWindow(cModel);
} else {
optimizeVolumesForVirtStore(volumesForOptimiseForVirtStore);
}
}
use of org.ovirt.engine.ui.uicompat.UIConstants in project ovirt-engine by oVirt.
the class LatestVmTemplate method setNaming.
private void setNaming() {
final UIConstants constants = ConstantsManager.getInstance().getConstants();
this.setTemplateVersionName(constants.latestTemplateVersionName());
this.setDescription(constants.latestTemplateVersionDescription());
}
use of org.ovirt.engine.ui.uicompat.UIConstants in project ovirt-engine by oVirt.
the class VolumeGeoRepListModel method populateStatus.
private void populateStatus(final List<GlusterGeoRepSessionDetails> details) {
final VolumeGeoRepSessionDetailsModel windowModel = new VolumeGeoRepSessionDetailsModel();
windowModel.setHelpTag(HelpTag.geo_replication_status_detail);
// $NON-NLS-1$
windowModel.setHashName("geo_replication_status_detail");
final UIConstants constants = ConstantsManager.getInstance().getConstants();
windowModel.setTitle(constants.geoReplicationSessionDetailsTitle());
// $NON-NLS-1$
UICommand okCommand = new UICommand("closeWindow", this);
okCommand.setIsCancel(true);
okCommand.setTitle(constants.ok());
windowModel.getCommands().add(okCommand);
setWindow(windowModel);
final List<EntityModel<GlusterGeoRepSessionDetails>> detailRows = new ArrayList<>();
for (GlusterGeoRepSessionDetails detail : details) {
detailRows.add(new EntityModel<>(detail));
}
windowModel.getGeoRepSessionSummary().setItems(detailRows, detailRows.get(0));
}
use of org.ovirt.engine.ui.uicompat.UIConstants in project ovirt-engine by oVirt.
the class VolumeGeoRepListModel method createGeoRepSession.
private void createGeoRepSession() {
if (getWindow() != null || getEntity() == null) {
return;
}
final UIConstants constants = ConstantsManager.getInstance().getConstants();
GlusterVolumeEntity selectedMasterVolume = getEntity();
final GlusterVolumeGeoRepCreateModel geoRepCreateModel = new GlusterVolumeGeoRepCreateModel(selectedMasterVolume);
setWindow(geoRepCreateModel);
geoRepCreateModel.getSlaveUserName().setEntity(constants.rootUser());
geoRepCreateModel.getShowEligibleVolumes().setEntity(true);
// $NON-NLS-1$
UICommand ok = new UICommand("onCreateSession", this);
ok.setTitle(constants.ok());
ok.setIsDefault(true);
geoRepCreateModel.getCommands().add(ok);
// $NON-NLS-1$
UICommand close = new UICommand("closeWindow", this);
close.setTitle(constants.cancel());
close.setIsCancel(true);
geoRepCreateModel.getCommands().add(close);
}
Aggregations