Search in sources :

Example 16 with UICommand

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

the class InstanceTypeListModel method createWindow.

private void createWindow(VmModelBehaviorBase<UnitVmModel> behavior, String hashName, String onOkAction, boolean isNew, String title, HelpTag helpTag) {
    if (getWindow() != null) {
        return;
    }
    UnitVmModel model = new UnitVmModel(behavior, this);
    // $NON-NLS-1$
    model.setIsAdvancedModeLocalStorageKey("instance_type_dialog");
    setWindow(model);
    model.setTitle(title);
    model.setHelpTag(helpTag);
    // $NON-NLS-1$
    model.setHashName(hashName);
    model.setIsNew(isNew);
    model.initialize();
    VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand();
    switchModeCommand.init(model);
    model.getCommands().add(switchModeCommand);
    UICommand newTemplate = UICommand.createDefaultOkUiCommand(onOkAction, this);
    model.getCommands().add(newTemplate);
    // $NON-NLS-1$
    UICommand cancel = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(cancel);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) VmBasedWidgetSwitchModeCommand(org.ovirt.engine.ui.uicommonweb.models.vms.VmBasedWidgetSwitchModeCommand) UnitVmModel(org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel)

Example 17 with UICommand

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

the class RoleListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeRolesTitle());
    model.setHelpTag(HelpTag.remove_role);
    // $NON-NLS-1$
    model.setHashName("remove_role");
    ArrayList<String> list = new ArrayList<>();
    for (Role role : getSelectedItems()) {
        list.add(role.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 : Role(org.ovirt.engine.core.common.businessentities.Role) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 18 with UICommand

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

the class RolePermissionListModel method remove.

private void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removePermissionTitle());
    model.setHelpTag(HelpTag.remove_permission);
    // $NON-NLS-1$
    model.setHashName("remove_permission");
    model.setItems(getSelectedItems());
    // $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 : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 19 with UICommand

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

the class ClusterPolicyListModel method managePolicyUnits.

private void managePolicyUnits() {
    if (getWindow() != null) {
        return;
    }
    policyUnitModel = new ManagePolicyUnitModel();
    policyUnitModel.setTitle(ConstantsManager.getInstance().getConstants().managePolicyUnits());
    policyUnitModel.setHelpTag(HelpTag.manage_policy_units);
    // $NON-NLS-1$
    policyUnitModel.setHashName("manage_policy_units");
    policyUnitModel.setPolicyUnits(new ListModel());
    policyUnitModel.getPolicyUnits().setItems(sort(policyUnits));
    policyUnitModel.getRefreshPolicyUnitsEvent().addListener((ev, sender, args) -> {
        setIsQueryFirstTime(true);
        syncSearch();
    });
    // $NON-NLS-1$
    UICommand command = new UICommand("Cancel", this);
    command.setTitle(ConstantsManager.getInstance().getConstants().close());
    command.setIsCancel(true);
    policyUnitModel.getCommands().add(command);
    setWindow(policyUnitModel);
}
Also used : ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 20 with UICommand

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

the class NewClusterPolicyModel method initCommands.

private void initCommands() {
    if (!clusterPolicy.isLocked() || commandType == CommandType.Clone) {
        // $NON-NLS-1$
        UICommand onSaveCommand = UICommand.createDefaultOkUiCommand("OnSave", this);
        getCommands().add(onSaveCommand);
        // $NON-NLS-1$
        UICommand onResetCommand = new UICommand("OnReset", this);
        onResetCommand.setTitle(ConstantsManager.getInstance().getConstants().resetTitle());
        getCommands().add(onResetCommand);
    }
    // $NON-NLS-1$
    UICommand cancelCommand = new UICommand("Cancel", this);
    cancelCommand.setTitle(!clusterPolicy.isLocked() ? ConstantsManager.getInstance().getConstants().cancel() : ConstantsManager.getInstance().getConstants().close());
    cancelCommand.setIsCancel(true);
    getCommands().add(cancelCommand);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

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