Search in sources :

Example 1 with ConfirmationModel

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

the class ClusterGlusterHookListModel method disableHook.

private void disableHook() {
    if (getWindow() != null) {
        return;
    }
    if (getSelectedItems() == null || getSelectedItems().size() == 0) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setConfirmWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks());
    model.setHelpTag(HelpTag.disable_hooks);
    // $NON-NLS-1$
    model.setHashName("disable_hooks");
    model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage());
    ArrayList<String> list = new ArrayList<>();
    for (GlusterHookEntity hook : getSelectedItems()) {
        list.add(hook.getName());
    }
    model.setItems(list);
    // $NON-NLS-1$
    UICommand okCommand = UICommand.createDefaultOkUiCommand("OnDisableHook", this);
    model.getCommands().add(okCommand);
    // $NON-NLS-1$
    UICommand cancelCommand = UICommand.createCancelUiCommand("OnCancelConfirmation", this);
    model.getCommands().add(cancelCommand);
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 2 with ConfirmationModel

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

the class ClusterGuideModel method onConfirmPMHost.

public void onConfirmPMHost() {
    HostModel model = (HostModel) getWindow();
    if (!model.validate()) {
        return;
    }
    if (!model.getIsPm().getEntity() && ApplicationModeHelper.getUiMode() != ApplicationMode.GlusterOnly) {
        ConfirmationModel confirmModel = new ConfirmationModel();
        setConfirmWindow(confirmModel);
        confirmModel.setTitle(ConstantsManager.getInstance().getConstants().powerManagementConfigurationTitle());
        confirmModel.setHelpTag(HelpTag.power_management_configuration);
        // $NON-NLS-1$
        confirmModel.setHashName("power_management_configuration");
        confirmModel.setMessage(ConstantsManager.getInstance().getConstants().youHavntConfigPmMsg());
        // $NON-NLS-1$
        UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddHost", this);
        confirmModel.getCommands().add(tempVar);
        // $NON-NLS-1$
        UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmWithFocus", this);
        confirmModel.getCommands().add(tempVar2);
    } else {
        onAddHost();
    }
}
Also used : HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 3 with ConfirmationModel

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

the class ClusterListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeClusterTitle());
    model.setHelpTag(HelpTag.remove_cluster);
    // $NON-NLS-1$
    model.setHashName("remove_cluster");
    ArrayList<String> list = new ArrayList<>();
    for (Cluster a : getSelectedItems()) {
        list.add(a.getName());
    }
    model.setItems(list);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : ArrayList(java.util.ArrayList) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 4 with ConfirmationModel

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

the class ClusterListModel method onResetClusterEmulatedMachine.

public void onResetClusterEmulatedMachine() {
    final ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> prms = new ArrayList<>();
    for (Cluster cluster : getSelectedItems()) {
        ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster);
        currentParam.setForceResetEmulatedMachine(true);
        prms.add(currentParam);
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.UpdateCluster, prms, result -> {
        model.stopProgress();
        cancel();
    });
}
Also used : ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) ArrayList(java.util.ArrayList) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 5 with ConfirmationModel

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

the class ClusterListModel method onSaveConfirmCV.

private void onSaveConfirmCV(ClusterModel model) {
    if (!model.getVersion().getSelectedItem().equals(getSelectedItem().getCompatibilityVersion())) {
        final ConfirmationModel confirmModel = new ConfirmationModel();
        setConfirmWindow(confirmModel);
        confirmModel.setTitle(constants.changeClusterCompatibilityVersionTitle());
        confirmModel.setHelpTag(HelpTag.change_cluster_compatibility_version);
        // $NON-NLS-1$
        confirmModel.setHashName("change_cluster_compatibility_version");
        // $NON-NLS-1$
        UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveConfirmCpuThreads", this);
        getConfirmWindow().getCommands().add(tempVar);
        // $NON-NLS-1$
        UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmation", this);
        getConfirmWindow().getCommands().add(tempVar2);
        checkForActiveVms(model, confirmModel);
    } else {
        onSaveConfirmCpuThreads();
    }
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)184 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)112 ArrayList (java.util.ArrayList)105 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)54 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)23 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)22 List (java.util.List)21 ActionType (org.ovirt.engine.core.common.action.ActionType)20 Frontend (org.ovirt.engine.ui.frontend.Frontend)20 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)20 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)20 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)20 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)18 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)17 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)17 VDS (org.ovirt.engine.core.common.businessentities.VDS)17 QueryType (org.ovirt.engine.core.common.queries.QueryType)17 Guid (org.ovirt.engine.core.compat.Guid)17 Model (org.ovirt.engine.ui.uicommonweb.models.Model)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)14