use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class GlusterVolumeGeoRepCreateSessionPopupView method initEditors.
private void initEditors() {
showEligibleVolumes = new EntityModelCheckBoxEditor(Align.RIGHT);
startSessionEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
slaveClusterEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<String>() {
@Override
public String getReplacementStringNullSafe(String data) {
return data;
}
@Override
public String getDisplayStringNullSafe(String data) {
return templates.typeAheadNameDescription(data == null ? constants.empty() : data, constants.empty()).asString();
}
});
slaveHostIpEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<Pair<String, Guid>>() {
@Override
public String getReplacementStringNullSafe(Pair<String, Guid> data) {
return data.getFirst();
}
@Override
public String getDisplayStringNullSafe(Pair<String, Guid> data) {
return templates.typeAheadNameDescription(data == null ? constants.empty() : data.getFirst(), constants.empty()).asString();
}
});
slaveVolumeEditor = new ListModelTypeAheadListBoxEditor<>(new ListModelTypeAheadListBoxEditor.NullSafeSuggestBoxRenderer<GlusterVolumeEntity>() {
@Override
public String getReplacementStringNullSafe(GlusterVolumeEntity data) {
return data.getName();
}
@Override
public String getDisplayStringNullSafe(GlusterVolumeEntity data) {
return templates.typeAheadNameDescription(data.getName() == null ? constants.empty() : data.getName(), data.getClusterName() == null ? constants.empty() : data.getClusterName()).asString();
}
});
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class StoragePopupView method initListBoxEditors.
@SuppressWarnings({ "unchecked", "rawtypes" })
void initListBoxEditors() {
datacenterListEditor = new ListModelListBoxEditor<>(new AbstractRenderer<StoragePool>() {
@Override
public String render(StoragePool storage) {
// $NON-NLS-1$
String formattedString = "";
if (storage != null) {
// Get formatted storage type and format using Enum renders
// $NON-NLS-1$
String storageType = storage.isLocal() ? constants.storageTypeLocal() : "";
String storageFormatType = // $NON-NLS-1$
storage.getStoragePoolFormatType() == null ? // $NON-NLS-1$
"" : new EnumRenderer<StorageFormatType>().render(storage.getStoragePoolFormatType());
// Add storage type and format if available
if (!storageType.isEmpty() || !storageFormatType.isEmpty()) {
// $NON-NLS-1$
formattedString = " (";
if (storage.isLocal()) {
formattedString += storageType;
} else {
formattedString += storageFormatType;
}
// $NON-NLS-1$
formattedString += ")";
}
formattedString = storage.getName() + formattedString;
}
return formattedString;
}
});
formatListEditor = new ListModelListBoxEditor<>(new EnumRenderer());
hostListEditor = new ListModelListBoxEditor<>(new NameRenderer<VDS>());
domainFunctionListEditor = new ListModelListBoxEditor<>(new EnumRenderer<StorageDomainType>());
storageTypeListEditor = new ListModelListBoxEditor<>(new EnumRenderer<StorageType>());
activateDomainEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
wipeAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
backup = new EntityModelCheckBoxEditor(Align.RIGHT);
discardAfterDeleteEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class ImportCloneDialogPopupView method initSelectWidgets.
private void initSelectWidgets() {
applyToAllEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
// $NON-NLS-1$
cloneEditor = new EntityModelRadioButtonEditor("1");
// $NON-NLS-1$
noCloneEditor = new EntityModelRadioButtonEditor("1");
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class MultipleHostsPopupView method initEditors.
private void initEditors() {
hostsTable = new EntityModelCellTable<>(SelectionMode.SINGLE, true);
useCommonPasswordEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
configureFirewallEditor = new EntityModelCheckBoxEditor(Align.LEFT);
configureFirewallEditor.setAccessible(true);
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor 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();
}
}
});
}
Aggregations