use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class RemoveBrickPopupView method initEditors.
private void initEditors() {
migrateEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
migrateInfoIcon = new InfoIcon(templates.italicText(constants.removeBricksMigrateDataInfo()));
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor 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.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class ManageGlusterSwiftPopupView method initEditors.
private void initEditors() {
swiftStatusEditor = new EntityModelLabelEditor<>(new EnumRenderer<GlusterServiceStatus>());
// $NON-NLS-1$
startSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
// $NON-NLS-1$
stopSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
// $NON-NLS-1$
restartSwift = new EntityModelRadioButtonEditor("swift_action", Align.RIGHT);
manageSwiftServerLevel = new EntityModelCheckBoxEditor(Align.RIGHT);
hostServicesTable = new EntityModelCellTable<>(false, true);
hostServicesTable.addColumn(new AbstractEntityModelTextColumn<GlusterServerService>() {
@Override
public String getText(GlusterServerService entity) {
return entity.getHostName();
}
}, constants.hostGlusterSwift());
hostServicesTable.addColumn(new AbstractEnumColumn<EntityModel, ServiceType>() {
@Override
protected ServiceType getRawValue(EntityModel object) {
return ((GlusterSwiftServiceModel) object).getEntity().getServiceType();
}
}, constants.serviceNameGlusterSwift());
hostServicesTable.addColumn(new AbstractEnumColumn<EntityModel, GlusterServiceStatus>() {
@Override
protected GlusterServiceStatus getRawValue(EntityModel object) {
return ((GlusterSwiftServiceModel) object).getEntity().getStatus();
}
}, constants.serviceStatusGlusterSwift());
Column<EntityModel, Boolean> startSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {
@Override
public Boolean getValue(EntityModel object) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
return swiftServiceModel.getStartSwift().getEntity();
}
@Override
public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
if (swiftServiceModel.getStartSwift().getIsChangable()) {
super.render(context, object, sb);
}
}
};
startSwiftColumn.setFieldUpdater((index, object, value) -> {
GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
swiftModel.getStartSwift().setEntity(value);
if (value) {
swiftModel.getStopSwift().setEntity(false);
swiftModel.getRestartSwift().setEntity(false);
hostServicesTable.redraw();
}
});
hostServicesTable.addColumn(startSwiftColumn, constants.startGlusterSwift());
Column<EntityModel, Boolean> stopSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {
@Override
public Boolean getValue(EntityModel object) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
return swiftServiceModel.getStopSwift().getEntity();
}
@Override
public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
if (swiftServiceModel.getStopSwift().getIsChangable()) {
super.render(context, object, sb);
}
}
};
stopSwiftColumn.setFieldUpdater((index, object, value) -> {
GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
if (swiftModel.getStopSwift().getIsChangable()) {
swiftModel.getStopSwift().setEntity(value);
if (value) {
swiftModel.getStartSwift().setEntity(false);
swiftModel.getRestartSwift().setEntity(false);
hostServicesTable.redraw();
}
}
});
hostServicesTable.addColumn(stopSwiftColumn, constants.stopGlusterSwift());
Column<EntityModel, Boolean> restartSwiftColumn = new Column<EntityModel, Boolean>(new RadioboxCell(false, true)) {
@Override
public Boolean getValue(EntityModel object) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
return swiftServiceModel.getRestartSwift().getEntity();
}
@Override
public void render(Context context, EntityModel object, SafeHtmlBuilder sb) {
GlusterSwiftServiceModel swiftServiceModel = (GlusterSwiftServiceModel) object;
if (swiftServiceModel.getRestartSwift().getIsChangable()) {
super.render(context, object, sb);
}
}
};
restartSwiftColumn.setFieldUpdater((index, object, value) -> {
GlusterSwiftServiceModel swiftModel = (GlusterSwiftServiceModel) object;
swiftModel.getRestartSwift().setEntity(value);
if (value) {
swiftModel.getStartSwift().setEntity(false);
swiftModel.getStopSwift().setEntity(false);
hostServicesTable.redraw();
}
});
hostServicesTable.addColumn(restartSwiftColumn, constants.restartGlusterSwift());
}
use of org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor 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.editor.generic.EntityModelCheckBoxEditor in project ovirt-engine by oVirt.
the class GeoRepActionConfirmPopUpView method initEditors.
private void initEditors() {
forceEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
geoRepForceHelpIcon = new InfoIcon(templates.italicText(constants.notAvailableLabel()));
}
Aggregations