use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class DataCenterGuideModel method addCluster.
public void addCluster() {
if (getWindow() != null) {
return;
}
ClusterModel model = ClusterListModel.createNewClusterModel();
setWindow(model);
ArrayList<StoragePool> dataCenters = new ArrayList<>();
dataCenters.add(getEntity());
model.getDataCenter().setItems(dataCenters, getEntity());
model.getDataCenter().setIsChangeable(false);
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", 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.UICommand in project ovirt-engine by oVirt.
the class DataCenterGuideModel method updateAddClusterAvailability.
private void updateAddClusterAvailability() {
// Add cluster action.
// $NON-NLS-1$
UICommand addClusterAction = new UICommand("AddCluster", this);
if (clusters.isEmpty()) {
addClusterAction.setTitle(DataCenterConfigureClustersAction);
getCompulsoryActions().add(addClusterAction);
} else {
addClusterAction.setTitle(DataCenterAddAnotherClusterAction);
getOptionalActions().add(addClusterAction);
}
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class DataCenterGuideModel method forceCreationWarning.
private void forceCreationWarning(ArrayList<String> usedLunsMessages) {
StorageModel storageModel = (StorageModel) getWindow();
SanStorageModelBase sanStorageModelBase = (SanStorageModelBase) storageModel.getCurrentStorageItem();
sanStorageModelBase.setForce(true);
ConfirmationModel model = new ConfirmationModel();
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().forceStorageDomainCreation());
model.setMessage(ConstantsManager.getInstance().getConstants().lunsAlreadyInUse());
model.setHelpTag(HelpTag.force_storage_domain_creation);
// $NON-NLS-1$
model.setHashName("force_storage_domain_creation");
model.setItems(usedLunsMessages);
// $NON-NLS-1$
UICommand onSaveSanStorageCommand = UICommand.createDefaultOkUiCommand("OnSaveSanStorage", this);
model.getCommands().add(onSaveSanStorageCommand);
// $NON-NLS-1$
UICommand cancelConfirmCommand = UICommand.createCancelUiCommand("CancelConfirm", this);
model.getCommands().add(cancelConfirmCommand);
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class DataCenterGuideModel method updateAddAndAttachDataDomainAvailability.
private void updateAddAndAttachDataDomainAvailability(List<VDS> upHosts, List<StorageDomain> unattachedStorage, List<StorageDomain> attachedDataStorages) {
// $NON-NLS-1$
UICommand addDataStorageAction = new UICommand("AddDataStorage", this);
addDataStorageAction.getExecuteProhibitionReasons().add(NoUpHostReason);
addDataStorageAction.setIsExecutionAllowed(upHosts.size() > 0);
if (unattachedStorage.isEmpty() && attachedDataStorages.isEmpty()) {
addDataStorageAction.setTitle(DataCenterConfigureStorageAction);
getCompulsoryActions().add(addDataStorageAction);
} else {
addDataStorageAction.setTitle(DataCenterAddMoreStorageAction);
getOptionalActions().add(addDataStorageAction);
}
// Attach data storage action.
// $NON-NLS-1$
UICommand attachDataStorageAction = new UICommand("AttachDataStorage", this);
if (upHosts.isEmpty()) {
attachDataStorageAction.getExecuteProhibitionReasons().add(NoUpHostReason);
}
attachDataStorageAction.setIsExecutionAllowed(unattachedStorage.size() > 0 && upHosts.size() > 0);
if (attachedDataStorages.isEmpty()) {
attachDataStorageAction.setTitle(DataCenterAttachStorageAction);
getCompulsoryActions().add(attachDataStorageAction);
} else {
attachDataStorageAction.setTitle(DataCenterAttachMoreStorageAction);
getOptionalActions().add(attachDataStorageAction);
}
}
use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.
the class DataCenterIscsiBondListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
model.setTitle(ConstantsManager.getInstance().getConstants().removeIscsiBondTitle());
model.setHelpTag(HelpTag.remove_iscsi_bundle);
// $NON-NLS-1$
model.setHashName("remove_iscsi_bundle");
setWindow(model);
model.getLatch().setEntity(false);
ArrayList<String> items = new ArrayList<>();
for (IscsiBond selected : getSelectedItems()) {
items.add(selected.getName());
}
model.setItems(items);
// $NON-NLS-1$
UICommand removeCommand = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(removeCommand);
model.getCommands().add(createCancelCommand());
}
Aggregations