Search in sources :

Example 1 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VnicProfileListModel method edit.

public void edit() {
    final VnicProfileView profile = getSelectedItem();
    if (getWindow() != null) {
        return;
    }
    VnicProfileView profileView = getSelectedItem();
    final VnicProfileModel profileModel = new EditVnicProfileModel(this, profile, profileView.getDataCenterId());
    setWindow(profileModel);
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView) RemoveVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.vms.RemoveVnicProfileModel)

Example 2 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VmInterfaceModel method selectedNetworkExternal.

protected boolean selectedNetworkExternal() {
    VnicProfileView profile = getProfile().getSelectedItem();
    Network network = null;
    if (profile != null && profile.getId() != null) {
        network = getProfileBehavior().findNetworkById(profile.getId());
    }
    return network != null && network.isExternal();
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Example 3 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class ProfileInstanceTypeEditor method syncSelectedItemWithNetworkInterface.

private void syncSelectedItemWithNetworkInterface(final VnicInstanceType model) {
    final VmNetworkInterface vnic = model.getNetworkInterface();
    VnicProfileView profile = model.getSelectedItem();
    vnic.setVnicProfileId(profile != null ? profile.getId() : null);
    vnic.setNetworkName(profile != null ? profile.getNetworkName() : null);
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Example 4 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class ProfilesInstanceTypeEditor method createWidget.

@Ignore
@Override
protected ProfileInstanceTypeEditor createWidget(VnicInstanceType value) {
    VnicProfileView profile = value.getSelectedItem();
    ProfileInstanceTypeEditor item = new ProfileInstanceTypeEditor();
    item.edit(value);
    item.setElementId(elementId);
    // small workaround due to UiCommonEditorVisitor changing null selected value
    value.setSelectedItem(profile);
    return item;
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Example 5 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class RemoveNetworkQoSModel method setMessage.

private void setMessage() {
    ArrayList<QueryParametersBase> parameters = new ArrayList<>();
    ArrayList<QueryType> queryTypes = new ArrayList<>();
    for (Object networkQoS : sourceListModel.getSelectedItems()) {
        QueryParametersBase parameter = new IdQueryParameters(((NetworkQoS) networkQoS).getId());
        parameters.add(parameter);
        queryTypes.add(QueryType.GetVnicProfilesByNetworkQosId);
    }
    Frontend.getInstance().runMultipleQueries(queryTypes, parameters, result -> {
        ArrayList<VnicProfileView> vnicProfiles = new ArrayList<>();
        setHelpTag(HelpTag.remove_network_qos);
        // $NON-NLS-1$
        setHashName("remove_network_qos");
        for (QueryReturnValue returnValue : result.getReturnValues()) {
            vnicProfiles.addAll((ArrayList<VnicProfileView>) returnValue.getReturnValue());
        }
        if (vnicProfiles.isEmpty()) {
            ArrayList<String> list = new ArrayList<>();
            for (Object item : sourceListModel.getSelectedItems()) {
                NetworkQoS i = (NetworkQoS) item;
                list.add(i.getName());
            }
            setItems(list);
        } else {
            setMessage(ConstantsManager.getInstance().getMessages().removeNetworkQoSMessage(vnicProfiles.size()));
            ArrayList<String> list = new ArrayList<>();
            for (VnicProfileView item : vnicProfiles) {
                list.add(item.getName());
            }
            setItems(list);
        }
    });
}
Also used : ArrayList(java.util.ArrayList) VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) NetworkQoS(org.ovirt.engine.core.common.businessentities.network.NetworkQoS) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) QueryType(org.ovirt.engine.core.common.queries.QueryType)

Aggregations

VnicProfileView (org.ovirt.engine.core.common.businessentities.network.VnicProfileView)22 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)5 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)4 Network (org.ovirt.engine.core.common.businessentities.network.Network)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 Column (com.google.gwt.user.cellview.client.Column)1 List (java.util.List)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 NetworkQoS (org.ovirt.engine.core.common.businessentities.network.NetworkQoS)1 QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 Guid (org.ovirt.engine.core.compat.Guid)1 AbstractCheckboxColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn)1 AbstractDiskSizeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn)1 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)1 AbstractImageResourceColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn)1 AbstractSafeHtmlColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractSafeHtmlColumn)1