use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class AbstractBackendNetworksResourceTest method setUpEntityExpectations.
static org.ovirt.engine.core.common.businessentities.network.Network setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.Network entity, boolean isDisplay, boolean isMigration, boolean isRequired, boolean isDefaultRoute, int index) {
NetworkCluster networkCluster = new NetworkCluster();
networkCluster.setDisplay(isDisplay);
networkCluster.setMigration(isMigration);
networkCluster.setRequired(isRequired);
networkCluster.setDefaultRoute(isDefaultRoute);
when(entity.getCluster()).thenReturn(networkCluster);
return setUpEntityExpectations(entity, index);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class SubTabNetworkClusterView method createNetRoleColumn.
private AbstractSafeHtmlColumn<PairQueryable<Cluster, NetworkCluster>> createNetRoleColumn() {
return new AbstractSafeHtmlColumn<PairQueryable<Cluster, NetworkCluster>>() {
@Override
public SafeHtml getValue(PairQueryable<Cluster, NetworkCluster> object) {
List<SafeHtml> images = new LinkedList<>();
NetworkCluster networkCluster = object.getSecond();
if (networkCluster != null) {
images.add(thisOrEmptyImage(networkCluster.isManagement(), managementImage));
images.add(thisOrEmptyImage(networkCluster.isDisplay(), displayImage));
images.add(thisOrEmptyImage(networkCluster.isMigration(), migrationImage));
images.add(thisOrEmptyImage(networkCluster.isGluster(), glusterNwImage));
images.add(thisOrEmptyImage(networkCluster.isDefaultRoute(), defaultRouteImage));
}
return MultiImageColumnHelper.getValue(images);
}
@Override
public SafeHtml getTooltip(PairQueryable<Cluster, NetworkCluster> object) {
Map<SafeHtml, String> imagesToText = new LinkedHashMap<>();
NetworkCluster networkCluster = object.getSecond();
if (networkCluster != null) {
if (networkCluster.isManagement()) {
imagesToText.put(managementImage, constants.managementItemInfo());
}
if (networkCluster.isDisplay()) {
imagesToText.put(displayImage, constants.displayItemInfo());
}
if (networkCluster.isMigration()) {
imagesToText.put(migrationImage, constants.migrationItemInfo());
}
if (networkCluster.isGluster()) {
imagesToText.put(glusterNwImage, constants.glusterNwItemInfo());
}
if (networkCluster.isDefaultRoute()) {
imagesToText.put(defaultRouteImage, constants.defaultRouteItemInfo());
}
}
return MultiImageColumnHelper.getTooltip(imagesToText);
}
};
}
Aggregations