use of org.ovirt.engine.ui.common.widget.table.column.AbstractSafeHtmlColumn in project ovirt-engine by oVirt.
the class SubTabClusterNetworkView method createNetRoleColumn.
private AbstractSafeHtmlColumn<Network> createNetRoleColumn() {
return new AbstractSafeHtmlColumn<Network>() {
@Override
public SafeHtml getValue(Network network) {
List<SafeHtml> images = new LinkedList<>();
final NetworkCluster networkCluster = network.getCluster();
if (networkCluster != null) {
images.add(thisOrEmptyImage(networkCluster.isManagement(), managementImage));
images.add(thisOrEmptyImage(networkCluster.isDisplay(), displayImage));
images.add(thisOrEmptyImage(networkCluster.isMigration(), migrationImage));
images.add(thisOrEmptyImage(network.getCluster().isGluster(), glusterNwImage));
images.add(thisOrEmptyImage(networkCluster.isDefaultRoute(), defaultRouteImage));
}
return MultiImageColumnHelper.getValue(images);
}
@Override
public SafeHtml getTooltip(Network network) {
Map<SafeHtml, String> imagesToText = new LinkedHashMap<>();
final NetworkCluster networkCluster = network.getCluster();
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 (network.getCluster().isGluster()) {
imagesToText.put(glusterNwImage, constants.glusterNwItemInfo());
}
if (networkCluster.isDefaultRoute()) {
imagesToText.put(defaultRouteImage, constants.defaultRouteItemInfo());
}
}
return MultiImageColumnHelper.getTooltip(imagesToText);
}
};
}
use of org.ovirt.engine.ui.common.widget.table.column.AbstractSafeHtmlColumn 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