<commit_before>package ch.elexis.core.ui.views.provider;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.ui.views.FaelleView;
import ch.elexis.data.Patient;

/**
 * @since 3.0.0 extracted from {@link FaelleView}
 */
public class FaelleContentProvider implements IStructuredContentProvider {
	
	public Object[] getElements(final Object inputElement){
		Patient act = (Patient) ElexisEventDispatcher.getSelected(Patient.class);
		if (act == null) {
			return new Object[0];
		} else {
			return act.getFaelle();
		}
		
	}
	
	public void dispose(){
		// TODO Auto-generated method stub	
	}
	
	public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput){
		
	}
	
}<commit_msg>[1655] changed case sorting (open cases before, closed)<commit_after>package ch.elexis.core.ui.views.provider;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.ui.views.FaelleView;
import ch.elexis.data.Fall;
import ch.elexis.data.Patient;

/**
 * @since 3.0.0 extracted from {@link FaelleView}
 */
public class FaelleContentProvider implements IStructuredContentProvider {
	
	public Object[] getElements(final Object inputElement){
		Patient act = (Patient) ElexisEventDispatcher.getSelected(Patient.class);
		if (act == null) {
			return new Object[0];
		} else {
			Fall[] cases = act.getFaelle();
			List<Fall> caseList = new ArrayList<Fall>();
			
			for (Fall fall : cases) {
				if (fall.isOpen()) {
					caseList.add(0, fall);
				} else {
					caseList.add(fall);
				}
			}
			return caseList.toArray();
		}
		
	}
	
	public void dispose(){
		// TODO Auto-generated method stub
	}
	
	public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput){
		
	}
	
}
{'fraction_non_alphanumeric': 0.11633663366336634, 'fraction_numerical': 0.006435643564356435, 'mean_word_length': 4.168797953964194, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5904979', 'n_tokens_mistral': 736, 'n_tokens_neox': 644, 'n_words': 148}