Search in sources :

Example 56 with UICommand

use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.

the class FenceAgentModel method confirmRemove.

/**
 * Confirm the removal of the model.
 */
public void confirmRemove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(constants.areYouSureTitle());
    String confirmMessage = "";
    if (concurrentList.isEmpty()) {
        confirmMessage = messages.confirmDeleteFenceAgent(getDisplayString());
    } else {
        StringBuilder builder = new StringBuilder();
        builder.append(getDisplayString());
        for (FenceAgentModel concurrentModel : concurrentList) {
            // $NON-NLS-1$
            builder.append("\n");
            builder.append(concurrentModel.getDisplayString());
        }
        confirmMessage = messages.confirmDeleteAgentGroup(builder.toString());
    }
    model.setMessage(confirmMessage);
    model.getLatch().setIsAvailable(true);
    model.getLatch().setIsChangeable(true);
    UICommand tempVar = UICommand.createDefaultOkUiCommand(ON_REMOVE, this);
    model.getCommands().add(tempVar);
    UICommand tempVar2 = UICommand.createCancelUiCommand(CANCEL, this);
    model.getCommands().add(tempVar2);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 57 with UICommand

use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.

the class UpgradeConfirmationModel method initialize.

@Override
public void initialize() {
    setTitle(constants.upgradeHostTitle());
    setHelpTag(HelpTag.upgrade_host);
    setHashName(HelpTag.upgrade_host.name);
    if (host.getVmCount() > 0) {
        setMessage(constants.areYouSureYouWantToUpgradeTheFollowingHostWithRunningVmsMsg());
    } else {
        setMessage(constants.areYouSureYouWantToUpgradeTheFollowingHostMsg());
    }
    UICommand upgradeCommand = new UICommand(ON_UPGRADE, this);
    upgradeCommand.setTitle(constants.ok());
    upgradeCommand.setIsDefault(true);
    getCommands().add(upgradeCommand);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 58 with UICommand

use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.

the class NumaSupportModel method initCommands.

protected void initCommands() {
    UICommand command = new UICommand(SUBMIT_NUMA_SUPPORT, this);
    command.setTitle(ConstantsManager.getInstance().getConstants().ok());
    getCommands().add(command);
    // $NON-NLS-1$
    getCommands().add(UICommand.createDefaultCancelUiCommand("Cancel", this));
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 59 with UICommand

use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.

the class StorageListModel method edit.

private void edit() {
    StorageDomain storage = getSelectedItem();
    if (getWindow() != null) {
        return;
    }
    StorageModel model = new StorageModel(new NewEditStorageModelBehavior());
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().editDomainTitle());
    model.setHelpTag(HelpTag.edit_domain);
    // $NON-NLS-1$
    model.setHashName("edit_domain");
    model.setStorage(storage);
    model.getName().setEntity(storage.getStorageName());
    model.getDescription().setEntity(storage.getDescription());
    model.getComment().setEntity(storage.getComment());
    model.setOriginalName(storage.getStorageName());
    model.getDataCenter().setIsChangeable(false);
    model.getFormat().setIsChangeable(false);
    boolean isStorageNameEditable = model.isStorageActive() || model.isNewStorage();
    boolean isStorageInMaintenance = !model.isNewStorage() && model.getStorage().getStatus() == StorageDomainStatus.Maintenance;
    model.getHost().setIsChangeable(false);
    model.getName().setIsChangeable(isStorageNameEditable);
    // set the field domain type to non editable
    model.getAvailableStorageTypeItems().setIsChangeable(false);
    model.getAvailableStorageDomainTypeItems().setIsChangeable(false);
    model.setIsChangeable(isStorageNameEditable && !isStorageInMaintenance);
    model.getWarningLowSpaceIndicator().setEntity(storage.getWarningLowSpaceIndicator());
    model.getWarningLowSpaceSize().setEntity(ConstantsManager.getInstance().getMessages().bracketsWithGB(storage.getWarningLowSpaceSize()));
    model.getWarningLowSpaceSize().setIsAvailable(true);
    model.getCriticalSpaceActionBlocker().setEntity(storage.getCriticalSpaceActionBlocker());
    IStorageModel item = prepareStorageForEdit(storage, model);
    model.setStorageModels(new ArrayList<>(Arrays.asList(new IStorageModel[] { item })));
    model.setCurrentStorageItem(item);
    model.initialize();
    UICommand command;
    // $NON-NLS-1$
    command = UICommand.createDefaultOkUiCommand("OnSave", this);
    model.getCommands().add(command);
    // $NON-NLS-1$
    command = createCancelCommand("Cancel");
    model.getCommands().add(command);
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 60 with UICommand

use of org.ovirt.engine.ui.uicommonweb.UICommand in project ovirt-engine by oVirt.

the class StorageListModel method checkDomainAttachedToDc.

private void checkDomainAttachedToDc(String commandName, List<StorageDomain> storageDomains, StorageServerConnections storageServerConnections) {
    final StorageModel storageModel = (StorageModel) getWindow();
    StoragePool storagePool = storageModel.getDataCenter().getSelectedItem();
    final UICommand okCommand = UICommand.createDefaultOkUiCommand(commandName, this);
    if (storagePool.getId().equals(Guid.Empty)) {
        okCommand.execute();
        return;
    }
    VDS host = storageModel.getHost().getSelectedItem();
    AsyncDataProvider.getInstance().getStorageDomainsWithAttachedStoragePoolGuid(new AsyncQuery<>(attachedStorageDomains -> {
        if (!attachedStorageDomains.isEmpty()) {
            ConfirmationModel model = new ConfirmationModel();
            setConfirmWindow(model);
            model.setTitle(ConstantsManager.getInstance().getConstants().storageDomainsAttachedToDataCenterWarningTitle());
            model.setMessage(ConstantsManager.getInstance().getConstants().storageDomainsAttachedToDataCenterWarningMessage());
            model.setHelpTag(HelpTag.import_storage_domain_confirmation);
            // $NON-NLS-1$
            model.setHashName("import_storage_domain_confirmation");
            List<String> stoageDomainNames = new ArrayList<>();
            for (StorageDomainStatic domain : attachedStorageDomains) {
                stoageDomainNames.add(domain.getStorageName());
            }
            model.setItems(stoageDomainNames);
            // $NON-NLS-1$
            UICommand cancelCommand = createCancelCommand("CancelImportConfirm");
            model.getCommands().add(okCommand);
            model.getCommands().add(cancelCommand);
        } else {
            okCommand.execute();
        }
    }), storagePool, storageDomains, storageServerConnections, host.getId());
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) FrontendActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) Inject(com.google.inject.Inject) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ExtendSANStorageDomainParameters(org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters) DiskProfileListModel(org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel) ActionType(org.ovirt.engine.core.common.action.ActionType) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) NfsVersion(org.ovirt.engine.core.common.businessentities.NfsVersion) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ReduceSANStorageDomainDevicesCommandParameters(org.ovirt.engine.core.common.action.ReduceSANStorageDomainDevicesCommandParameters) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) StringHelper(org.ovirt.engine.core.compat.StringHelper) List(java.util.List) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Task(org.ovirt.engine.ui.uicompat.Task) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) LinkedList(java.util.LinkedList) Model(org.ovirt.engine.ui.uicommonweb.models.Model) RemoveStorageDomainParameters(org.ovirt.engine.core.common.action.RemoveStorageDomainParameters) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VDS(org.ovirt.engine.core.common.businessentities.VDS) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) List(java.util.List) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)257 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)134 ArrayList (java.util.ArrayList)105 List (java.util.List)49 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)49 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)49 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)48 ActionType (org.ovirt.engine.core.common.action.ActionType)47 Frontend (org.ovirt.engine.ui.frontend.Frontend)47 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)44 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)41 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)36 Guid (org.ovirt.engine.core.compat.Guid)36 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)33 QueryType (org.ovirt.engine.core.common.queries.QueryType)33 VDS (org.ovirt.engine.core.common.businessentities.VDS)30 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)29 Linq (org.ovirt.engine.ui.uicommonweb.Linq)28 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)26 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)24