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);
}
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();
}
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);
}
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;
}
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);
}
});
}
Aggregations