use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.
the class ReplaceBrickPopupView method initEditors.
private void initEditors() {
showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {
@Override
public String renderNullSafe(VDS vds) {
return vds.getHostName();
}
});
}
use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.
the class AddBrickPopupView method initEditors.
private void initEditors() {
volumeTypeEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterVolumeType>());
forceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
showBricksListEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
serverEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VDS>() {
@Override
public String renderNullSafe(VDS vds) {
return vds.getHostName();
}
});
}
use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.
the class GlusterStorageView method initEditors.
void initEditors() {
linkGlusterVolumeEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
glusterVolumesEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<GlusterVolumeEntity>() {
@Override
protected String renderNullSafe(GlusterVolumeEntity glusterVolume) {
if (glusterVolume == null) {
// $NON-NLS-1$
return "";
} else {
if (glusterVolume.getBricks().isEmpty()) {
return glusterVolume.getName();
}
GlusterBrickEntity brick = glusterVolume.getBricks().get(0);
if (brick == null) {
return glusterVolume.getName();
}
String server = brick.getNetworkId() != null && StringHelper.isNotNullOrEmpty(brick.getNetworkAddress()) ? brick.getNetworkAddress() : brick.getServerName();
// $NON-NLS-1$
return server + ":/" + glusterVolume.getName();
}
}
});
}
use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.
the class HostConfigureLocalStoragePopupView method initialize.
private void initialize() {
dataCenterVersionEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Version>() {
@Override
public String renderNullSafe(Version object) {
return object.getValue();
}
});
clusterCpuTypeEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<ServerCpu>() {
@Override
public String renderNullSafe(ServerCpu object) {
return object.getCpuName();
}
});
// Optimization options.
// $NON-NLS-1$
optimizationNoneEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationForServerEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationForDesktopEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
optimizationCustomEditor = new EntityModelRadioButtonEditor("1");
optimizationCustomEditor.setVisible(false);
countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
memoryOptimizationInfo = new InfoIcon(templates.italicText(constants.clusterPopupMemoryOptimizationInfo()));
memoryOptimizationInfo.setTooltipMaxWidth(TooltipWidth.W520);
cpuThreadsInfo = new InfoIcon(templates.italicText(constants.clusterPopupCpuThreadsInfo()));
cpuThreadsInfo.setTooltipMaxWidth(TooltipWidth.W620);
}
use of org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer in project ovirt-engine by oVirt.
the class HostInstallPopupView method initEditors.
void initEditors() {
isoEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<RpmVersion>() {
@Override
public String renderNullSafe(RpmVersion version) {
// Format string to contain major.minor version only.
return version.getRpmName();
}
});
// $NON-NLS-1$
rbPassword = new RadioButton("1");
// $NON-NLS-1$
rbPublicKey = new RadioButton("1");
publicKeyEditor = new StringEntityModelTextAreaLabelEditor();
activateHostAfterInstallEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
overrideIpTablesEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
Aggregations