Search in sources :

Example 71 with UICommand

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

the class TagListModel method newEntity.

public void newEntity() {
    if (getWindow() != null) {
        return;
    }
    TagModel model = new TagModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newTagTitle());
    model.setHelpTag(HelpTag.new_tag);
    // $NON-NLS-1$
    model.setHashName("new_tag");
    model.setIsNew(true);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSave", 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)

Example 72 with UICommand

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

the class AbstractDiskModel method forceCreationWarning.

protected void forceCreationWarning(ArrayList<String> usedLunsMessages) {
    ConfirmationModel confirmationModel = new ConfirmationModel();
    setConfirmWindow(confirmationModel);
    confirmationModel.setTitle(constants.forceStorageDomainCreation());
    confirmationModel.setMessage(constants.lunsAlreadyPartOfSD());
    confirmationModel.setHelpTag(HelpTag.force_lun_disk_creation);
    // $NON-NLS-1$
    confirmationModel.setHashName("force_lun_disk_creation");
    confirmationModel.setItems(usedLunsMessages);
    // $NON-NLS-1$
    UICommand forceSaveCommand = new UICommand("OnForceSave", this);
    forceSaveCommand.setTitle(constants.ok());
    forceSaveCommand.setIsDefault(true);
    confirmationModel.getCommands().add(forceSaveCommand);
    // $NON-NLS-1$
    UICommand cancelconfirmCommand = new UICommand("CancelConfirm", this);
    cancelconfirmCommand.setTitle(constants.cancel());
    cancelconfirmCommand.setIsCancel(true);
    confirmationModel.getCommands().add(cancelconfirmCommand);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 73 with UICommand

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

the class AbstractDiskModel method commonInitialize.

protected void commonInitialize() {
    super.initialize();
    // Create and set commands
    // $NON-NLS-1$
    UICommand onSaveCommand = new UICommand("OnSave", this);
    onSaveCommand.setTitle(constants.ok());
    onSaveCommand.setIsDefault(true);
    getCommands().add(onSaveCommand);
    // Add command only if defined (as cleanup is invoked on each command)
    if (getCancelCommand() != null) {
        getCommands().add(getCancelCommand());
    }
    // Update data
    if (getVm() != null) {
        updateBootableDiskAvailable();
        getIsUsingScsiReservation().setIsAvailable(true);
    }
    updateDatacenters();
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 74 with UICommand

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

the class UserListModel method add.

public void add() {
    if (getWindow() != null) {
        return;
    }
    AdElementListModel model = new AdElementListModel();
    if (getUserOrGroup() == UserOrGroup.Group) {
        model.setSearchType(AdSearchType.GROUP);
    } else {
        model.setSearchType(AdSearchType.USER);
    }
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().addUsersAndGroupsTitle());
    model.setHelpTag(HelpTag.add_users_and_groups);
    // $NON-NLS-1$
    model.setHashName("add_users_and_groups");
    model.setIsRoleListHidden(true);
    model.getIsEveryoneSelectionHidden().setEntity(true);
    // $NON-NLS-1$
    UICommand addCommand = new UICommand("OnAdd", this);
    addCommand.setTitle(ConstantsManager.getInstance().getConstants().add());
    model.getCommands().add(addCommand);
    // $NON-NLS-1$
    UICommand addAndCloseCommand = new UICommand("OnAddAndClose", this);
    addAndCloseCommand.setTitle(ConstantsManager.getInstance().getConstants().addAndClose());
    addAndCloseCommand.setIsDefault(true);
    model.getCommands().add(addAndCloseCommand);
    // $NON-NLS-1$
    UICommand closeCommand = new UICommand("Cancel", this);
    closeCommand.setTitle(ConstantsManager.getInstance().getConstants().close());
    closeCommand.setIsCancel(true);
    model.getCommands().add(closeCommand);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 75 with UICommand

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

the class UserListModel method remove.

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

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