Search in sources :

Example 1 with ErrorPopupManager

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

the class BaseImportNetworksModel method onProviderChosen.

private void onProviderChosen() {
    final Provider<?> provider = providers.getSelectedItem();
    if (provider == null) {
        return;
    }
    startProgress();
    AsyncQuery<List<StoragePool>> dataCenterQuery = new AsyncQuery<>(returnValue -> {
        final List<StoragePool> dataCenters = new LinkedList<>(returnValue);
        Collections.sort(dataCenters, new NameableComparator());
        AsyncQuery<QueryReturnValue> externalNetworksQuery = new AsyncQuery<>(queryReturnValue -> {
            if (queryReturnValue.getSucceeded()) {
                Map<Network, Set<Guid>> externalNetworkToDataCenters = queryReturnValue.getReturnValue();
                providerNetworks.setItems(getExternalNetworks(externalNetworkToDataCenters, dataCenters));
                importedNetworks.setItems(new LinkedList<ExternalNetwork>());
            } else {
                final ErrorPopupManager popupManager = (ErrorPopupManager) TypeResolver.getInstance().resolve(ErrorPopupManager.class);
                popupManager.show(ConstantsManager.getInstance().getMessages().failedToListExternalNetworks(queryReturnValue.getExceptionMessage()));
            }
            stopProgress();
        }, true);
        AsyncDataProvider.getInstance().getExternalNetworksByProviderId(externalNetworksQuery, provider.getId());
    });
    AsyncDataProvider.getInstance().getDataCenterList(dataCenterQuery);
}
Also used : StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) Set(java.util.Set) NameableComparator(org.ovirt.engine.core.common.businessentities.comparators.NameableComparator) LinkedList(java.util.LinkedList) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) Network(org.ovirt.engine.core.common.businessentities.network.Network) ExternalNetwork(org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork) ErrorPopupManager(org.ovirt.engine.ui.uicommonweb.ErrorPopupManager) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ExternalNetwork(org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork)

Example 2 with ErrorPopupManager

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

the class ImportVmsModel method showErrorPopup.

private void showErrorPopup(String message) {
    final ErrorPopupManager popupManager = (ErrorPopupManager) TypeResolver.getInstance().resolve(ErrorPopupManager.class);
    popupManager.show(message);
}
Also used : ErrorPopupManager(org.ovirt.engine.ui.uicommonweb.ErrorPopupManager)

Example 3 with ErrorPopupManager

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

the class WebClientConsoleInvoker method openingWindowFailed.

private void openingWindowFailed() {
    final ErrorPopupManager popupManager = (ErrorPopupManager) TypeResolver.getInstance().resolve(ErrorPopupManager.class);
    popupManager.show(constants.openingNewConsoleWindowFailed());
}
Also used : ErrorPopupManager(org.ovirt.engine.ui.uicommonweb.ErrorPopupManager)

Example 4 with ErrorPopupManager

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

the class ConsoleModel method displayUserCantReconnectDialog.

private void displayUserCantReconnectDialog() {
    final ErrorPopupManager popupManager = (ErrorPopupManager) TypeResolver.getInstance().resolve(ErrorPopupManager.class);
    popupManager.show(ConstantsManager.getInstance().getConstants().userCantReconnectToVm());
}
Also used : ErrorPopupManager(org.ovirt.engine.ui.uicommonweb.ErrorPopupManager)

Aggregations

ErrorPopupManager (org.ovirt.engine.ui.uicommonweb.ErrorPopupManager)4 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Set (java.util.Set)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 NameableComparator (org.ovirt.engine.core.common.businessentities.comparators.NameableComparator)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1 ExternalNetwork (org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork)1