Search in sources :

Example 81 with UICommand

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

the class DataCenterGuideModel method addCluster.

public void addCluster() {
    if (getWindow() != null) {
        return;
    }
    ClusterModel model = ClusterListModel.createNewClusterModel();
    setWindow(model);
    ArrayList<StoragePool> dataCenters = new ArrayList<>();
    dataCenters.add(getEntity());
    model.getDataCenter().setItems(dataCenters, getEntity());
    model.getDataCenter().setIsChangeable(false);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : ClusterModel(org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 82 with UICommand

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

the class DataCenterGuideModel method updateAddClusterAvailability.

private void updateAddClusterAvailability() {
    // Add cluster action.
    // $NON-NLS-1$
    UICommand addClusterAction = new UICommand("AddCluster", this);
    if (clusters.isEmpty()) {
        addClusterAction.setTitle(DataCenterConfigureClustersAction);
        getCompulsoryActions().add(addClusterAction);
    } else {
        addClusterAction.setTitle(DataCenterAddAnotherClusterAction);
        getOptionalActions().add(addClusterAction);
    }
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 83 with UICommand

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

the class DataCenterGuideModel method forceCreationWarning.

private void forceCreationWarning(ArrayList<String> usedLunsMessages) {
    StorageModel storageModel = (StorageModel) getWindow();
    SanStorageModelBase sanStorageModelBase = (SanStorageModelBase) storageModel.getCurrentStorageItem();
    sanStorageModelBase.setForce(true);
    ConfirmationModel model = new ConfirmationModel();
    setConfirmWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().forceStorageDomainCreation());
    model.setMessage(ConstantsManager.getInstance().getConstants().lunsAlreadyInUse());
    model.setHelpTag(HelpTag.force_storage_domain_creation);
    // $NON-NLS-1$
    model.setHashName("force_storage_domain_creation");
    model.setItems(usedLunsMessages);
    // $NON-NLS-1$
    UICommand onSaveSanStorageCommand = UICommand.createDefaultOkUiCommand("OnSaveSanStorage", this);
    model.getCommands().add(onSaveSanStorageCommand);
    // $NON-NLS-1$
    UICommand cancelConfirmCommand = UICommand.createCancelUiCommand("CancelConfirm", this);
    model.getCommands().add(cancelConfirmCommand);
}
Also used : SanStorageModelBase(org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase) PosixStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) StorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel) NfsStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel) LocalStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 84 with UICommand

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

the class DataCenterGuideModel method updateAddAndAttachDataDomainAvailability.

private void updateAddAndAttachDataDomainAvailability(List<VDS> upHosts, List<StorageDomain> unattachedStorage, List<StorageDomain> attachedDataStorages) {
    // $NON-NLS-1$
    UICommand addDataStorageAction = new UICommand("AddDataStorage", this);
    addDataStorageAction.getExecuteProhibitionReasons().add(NoUpHostReason);
    addDataStorageAction.setIsExecutionAllowed(upHosts.size() > 0);
    if (unattachedStorage.isEmpty() && attachedDataStorages.isEmpty()) {
        addDataStorageAction.setTitle(DataCenterConfigureStorageAction);
        getCompulsoryActions().add(addDataStorageAction);
    } else {
        addDataStorageAction.setTitle(DataCenterAddMoreStorageAction);
        getOptionalActions().add(addDataStorageAction);
    }
    // Attach data storage action.
    // $NON-NLS-1$
    UICommand attachDataStorageAction = new UICommand("AttachDataStorage", this);
    if (upHosts.isEmpty()) {
        attachDataStorageAction.getExecuteProhibitionReasons().add(NoUpHostReason);
    }
    attachDataStorageAction.setIsExecutionAllowed(unattachedStorage.size() > 0 && upHosts.size() > 0);
    if (attachedDataStorages.isEmpty()) {
        attachDataStorageAction.setTitle(DataCenterAttachStorageAction);
        getCompulsoryActions().add(attachDataStorageAction);
    } else {
        attachDataStorageAction.setTitle(DataCenterAttachMoreStorageAction);
        getOptionalActions().add(attachDataStorageAction);
    }
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

Example 85 with UICommand

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

the class DataCenterIscsiBondListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    model.setTitle(ConstantsManager.getInstance().getConstants().removeIscsiBondTitle());
    model.setHelpTag(HelpTag.remove_iscsi_bundle);
    // $NON-NLS-1$
    model.setHashName("remove_iscsi_bundle");
    setWindow(model);
    model.getLatch().setEntity(false);
    ArrayList<String> items = new ArrayList<>();
    for (IscsiBond selected : getSelectedItems()) {
        items.add(selected.getName());
    }
    model.setItems(items);
    // $NON-NLS-1$
    UICommand removeCommand = UICommand.createDefaultOkUiCommand("OnRemove", this);
    model.getCommands().add(removeCommand);
    model.getCommands().add(createCancelCommand());
}
Also used : ArrayList(java.util.ArrayList) IscsiBond(org.ovirt.engine.core.common.businessentities.IscsiBond) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) 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