use of org.ovirt.engine.ui.uicommonweb.ICommandTarget in project ovirt-engine by oVirt.
the class RegisterDiskModel method init.
public void init() {
ICommandTarget target = (ICommandTarget) getEntity();
// $NON-NLS-1$
UICommand actionCommand = new UICommand("OnExecute", this);
actionCommand.setTitle(constants.ok());
actionCommand.setIsDefault(true);
getCommands().add(actionCommand);
// $NON-NLS-1$
UICommand cancelCommand = new UICommand("Cancel", target);
cancelCommand.setTitle(constants.cancel());
cancelCommand.setIsCancel(true);
getCommands().add(cancelCommand);
}
use of org.ovirt.engine.ui.uicommonweb.ICommandTarget in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method postCopyOrMoveInit.
protected void postCopyOrMoveInit() {
ICommandTarget target = (ICommandTarget) getEntity();
if (getActiveStorageDomains().isEmpty()) {
setMessage(constants.noStorageDomainAvailableMsg());
// $NON-NLS-1$
UICommand closeCommand = new UICommand("Cancel", target);
closeCommand.setTitle(constants.close());
closeCommand.setIsDefault(true);
closeCommand.setIsCancel(true);
getCommands().add(closeCommand);
} else {
if (!problematicDisks.isEmpty()) {
setMessage(getWarning(problematicDisks));
}
// $NON-NLS-1$
UICommand actionCommand = new UICommand("OnExecute", this);
actionCommand.setTitle(constants.ok());
actionCommand.setIsDefault(true);
getCommands().add(actionCommand);
// $NON-NLS-1$
UICommand cancelCommand = new UICommand("Cancel", target);
cancelCommand.setTitle(constants.cancel());
cancelCommand.setIsCancel(true);
getCommands().add(cancelCommand);
}
stopProgress();
}
use of org.ovirt.engine.ui.uicommonweb.ICommandTarget in project ovirt-engine by oVirt.
the class DataCenterListModel method checkForQuotaInDC.
private void checkForQuotaInDC(StoragePool storage_pool, final ICommandTarget commandTarget) {
IdQueryParameters parameters = new IdQueryParameters(storage_pool.getId());
Frontend.getInstance().runQuery(QueryType.GetQuotaByStoragePoolId, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
if (((ArrayList<Quota>) returnValue.getReturnValue()).size() == 0) {
promptNoQuotaInDCMessage();
} else {
onSaveInternal();
}
}));
}
use of org.ovirt.engine.ui.uicommonweb.ICommandTarget in project ovirt-engine by oVirt.
the class RemoveDiskModel method onRemove.
public void onRemove(final ICommandTarget target) {
boolean removeDisk = getLatch().getEntity();
ActionType actionType = removeDisk ? ActionType.RemoveDisk : ActionType.DetachDiskFromVm;
List<ActionParametersBase> parameterList = disksToRemove.stream().map(disk -> removeDisk ? new RemoveDiskParameters(disk.getId()) : new AttachDetachVmDiskParameters(new DiskVmElement(disk.getId(), vm.getId()))).collect(Collectors.toList());
startProgress();
Frontend.getInstance().runMultipleAction(actionType, parameterList, result -> {
stopProgress();
target.executeCommand(cancelCommand);
}, this);
}
Aggregations