.withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_count_desc())
.withReadOnlySetTo("Keep All".equals(settings.getRegularSnapshots().getRetention()))
.withValidators(validator).build(new IntegerItem());
items.addAll(snapshotsCountFormItems);
final FormItem snapshotsCountNumber = snapshotsCountFormItems.get(1);
snapshotsRetentionSelect.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
snapshotsCountNumber.setDisabled("Keep All".equals(event.getValue()));
}
});
List<FormItem> snapshotsDeletionFormItems = new FormItemBuilder().withName(FIELD_SNAPSHOTS_DELETION)
.withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_deletion_title())
.withValue(settings.getRegularSnapshots().getDeletion())
.withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_deletion_desc())
.build(new SelectItem());
SelectItem snapshotsDeletionSelect = (SelectItem) snapshotsDeletionFormItems.get(1);
snapshotsDeletionSelect.setValueMap("Delete", "Move");
items.addAll(snapshotsDeletionFormItems);
List<FormItem> snapshotsLocationFormItems = new FormItemBuilder().withName(FIELD_SNAPSHOTS_LOCATION)
.withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_location_title())
.withValue(settings.getRegularSnapshots().getLocation())
.withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_location_desc())
.withRequiredSetTo(false)
.withReadOnlySetTo("Delete".equals(settings.getRegularSnapshots().getDeletion()))
.build();
items.addAll(snapshotsLocationFormItems);
final FormItem snapshotsLocationText = snapshotsLocationFormItems.get(1);
snapshotsDeletionSelect.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
snapshotsLocationText.setDisabled("Delete".equals(event.getValue()));
}
});
regularSnapshotsForm.setFields(items.toArray(new FormItem[items.size()]));