use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.
the class NetworkProfileListModel method newProfile.
public void newProfile() {
if (getWindow() != null) {
return;
}
NewVnicProfileModel model = new NewVnicProfileModel(this, getEntity().getDataCenterId());
setWindow(model);
VnicProfile profile = new VnicProfile();
profile.setNetworkId(getEntity().getId());
model.setProfile(profile);
}
use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.
the class NetworkModel method createDefaultProfile.
private VnicProfileModel createDefaultProfile() {
final VnicProfileModel defaultProfile = new NewVnicProfileModel();
// make sure default profile's name is in sync with network's name
defaultProfile.getName().setEntity(getName().getEntity());
final IEventListener<EventArgs> networkNameListener = (ev, sender, args) -> defaultProfile.getName().setEntity(getName().getEntity());
getName().getEntityChangedEvent().addListener(networkNameListener);
// if user overrides default name, stop tracking network's name
defaultProfile.getName().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() {
@Override
public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) {
String defaultProfileName = defaultProfile.getName().getEntity();
if ((defaultProfileName != null) && (!defaultProfileName.equals(getName().getEntity()))) {
getName().getEntityChangedEvent().removeListener(networkNameListener);
defaultProfile.getName().getEntityChangedEvent().removeListener(this);
}
}
});
return defaultProfile;
}
use of org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel in project ovirt-engine by oVirt.
the class VnicProfilesEditor method createGhostValue.
@Override
protected VnicProfileModel createGhostValue() {
VnicProfileModel profile = new NewVnicProfileModel();
profile.initNetworkQoSList(dcId);
return profile;
}
Aggregations