Search in sources :

Example 1 with ImportIscsiStorageView

use of org.ovirt.engine.ui.common.widget.uicommon.storage.ImportIscsiStorageView in project ovirt-engine by oVirt.

the class StoragePopupView method revealStorageView.

@SuppressWarnings("unchecked")
private void revealStorageView(StorageModel object) {
    StorageType storageType = storageTypeListEditor.asEditor().getActualEditor().getValue();
    StorageDomainType storageDomainType = domainFunctionListEditor.asEditor().getActualEditor().getValue();
    if (storageType == null || storageDomainType == null) {
        return;
    }
    switch(storageType) {
        case NFS:
            storageView = new NfsStorageView();
            break;
        case LOCALFS:
            storageView = new LocalStorageView();
            break;
        case POSIXFS:
            storageView = new PosixStorageView();
            break;
        case GLUSTERFS:
            storageView = new GlusterStorageView();
            break;
        case FCP:
            if (!object.getBehavior().isImport()) {
                storageView = new FcpStorageView(true);
            } else {
                storageView = new ImportFcpStorageView();
            }
            break;
        case ISCSI:
            if (!object.getBehavior().isImport()) {
                storageView = new IscsiStorageView(true);
            } else {
                storageView = new ImportIscsiStorageView();
            }
            break;
        default:
            break;
    }
    updateStorageItem(object);
    IStorageModel model = object.getCurrentStorageItem();
    // Re-apply element IDs on 'storageView' change
    ViewIdHandler.idHandler.generateAndSetIds(this);
    // Clear the current storage view
    specificStorageTypePanel.clear();
    // Add the new storage view and call focus on it if needed
    if (storageView != null && model != null) {
        storageView.edit(model);
        specificStorageTypePanel.add(storageView);
        if (!nameEditor.isVisible()) {
            storageView.focus();
        }
    }
}
Also used : StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) IStorageModel(org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel) FcpStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.FcpStorageView) ImportFcpStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.ImportFcpStorageView) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) ImportIscsiStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.ImportIscsiStorageView) IscsiStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.IscsiStorageView) ImportIscsiStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.ImportIscsiStorageView) ImportFcpStorageView(org.ovirt.engine.ui.common.widget.uicommon.storage.ImportFcpStorageView)

Aggregations

StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)1 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)1 FcpStorageView (org.ovirt.engine.ui.common.widget.uicommon.storage.FcpStorageView)1 ImportFcpStorageView (org.ovirt.engine.ui.common.widget.uicommon.storage.ImportFcpStorageView)1 ImportIscsiStorageView (org.ovirt.engine.ui.common.widget.uicommon.storage.ImportIscsiStorageView)1 IscsiStorageView (org.ovirt.engine.ui.common.widget.uicommon.storage.IscsiStorageView)1 IStorageModel (org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel)1