<commit_before>package ch.elexis.core.ui.databinding;

import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.IStatus;

import ch.elexis.core.model.Identifiable;
import ch.elexis.core.services.IModelService;

public class SavingUpdateValueStrategy<S, D> extends UpdateValueStrategy<S, D> {
	private boolean autoSave;
	private IModelService modelService;
	private IObservableValue<?> observable;
	
	public SavingUpdateValueStrategy(IModelService modelService, IObservableValue<?> observable){
		this.modelService = modelService;
		this.observable = observable;
		this.autoSave = true;
	}
	
	public void setAutoSave(boolean value){
		autoSave = value;
	}
	
	@SuppressWarnings("rawtypes")<commit_msg>[17449] updated SavingUpdateValueStrategy enable method chaining<commit_after>package ch.elexis.core.ui.databinding;

import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.IStatus;

import ch.elexis.core.model.Identifiable;
import ch.elexis.core.services.IModelService;

public class SavingUpdateValueStrategy<S, D> extends UpdateValueStrategy<S, D> {
	private boolean autoSave;
	private IModelService modelService;
	private IObservableValue<?> observable;
	
	public SavingUpdateValueStrategy(IModelService modelService, IObservableValue<?> observable){
		this.modelService = modelService;
		this.observable = observable;
		this.autoSave = true;
	}
	
	public SavingUpdateValueStrategy setAutoSave(boolean value){
		autoSave = value;
		return this;
	}
	
	@SuppressWarnings("rawtypes")
{'fraction_non_alphanumeric': 0.09166173861620343, 'fraction_numerical': 0.0029568302779420462, 'mean_word_length': 6.621621621621622, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2020451', 'n_tokens_mistral': 527, 'n_tokens_neox': 505, 'n_words': 98}