<commit_before>package com.cee.news.client.content;

import com.cee.news.client.error.ErrorHandler;
import com.cee.news.client.list.ListChangedEvent;
import com.cee.news.client.list.ListChangedHandler;
import com.cee.news.model.EntityKey;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.view.client.MultiSelectionModel;

public class SourceSelectionPresenter {

    public SourceSelectionPresenter(final SourceSelectionView sourceSelectionView, final SiteListContentModel sitesOfWorkingSetModel, ErrorHandler errorHandler) {
        final MultiSelectionCellListPresenter<EntityKey> siteListPresenter = new MultiSelectionCellListPresenter<EntityKey>(sourceSelectionView.getCellListSites(), sitesOfWorkingSetModel, sitesOfWorkingSetModel);
        siteListPresenter.addErrorHandler(errorHandler);
        final MultiSelectionModel<EntityContent<EntityKey>> selectionModel = siteListPresenter.getSelectionModel();
        sourceSelectionView.getSelectAllButton().addClickHandler(new ClickHandler() {
            
            @Override
            public void onClick(ClickEvent event) {
                for (EntityKey key : sitesOfWorkingSetModel.getKeys()) {
                    selectionModel.setSelected(new EntityContent<EntityKey>(key, null), true);
                }
            }
        });
        sourceSelectionView.getSelectNoneButton().addClickHandler(new ClickHandler() {
            
            @Override
            public void onClick(ClickEvent event) {
                selectionModel.clear();
            }
        });
        sitesOfWorkingSetModel.addListChangedHandler(new ListChangedHandler<EntityKey>() {
            
            @Override
            public void onContentListChanged(ListChangedEvent<EntityKey> event) {
                for (EntityKey key : sitesOfWorkingSetModel.getKeys()) {
                    selectionModel.setSelected(new EntityContent<EntityKey>(key, null), true);
                }
            }
        });
    }
    
}<commit_msg>fixed bug, selection model not being reset<commit_after>package com.cee.news.client.content;

import com.cee.news.client.error.ErrorHandler;
import com.cee.news.client.list.ListChangedEvent;
import com.cee.news.client.list.ListChangedHandler;
import com.cee.news.model.EntityKey;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.view.client.MultiSelectionModel;

public class SourceSelectionPresenter {

    public SourceSelectionPresenter(final SourceSelectionView sourceSelectionView, final SiteListContentModel sitesOfWorkingSetModel, ErrorHandler errorHandler) {
        final MultiSelectionCellListPresenter<EntityKey> siteListPresenter = new MultiSelectionCellListPresenter<EntityKey>(sourceSelectionView.getCellListSites(), sitesOfWorkingSetModel, sitesOfWorkingSetModel);
        siteListPresenter.addErrorHandler(errorHandler);
        final MultiSelectionModel<EntityContent<EntityKey>> selectionModel = siteListPresenter.getSelectionModel();
        sourceSelectionView.getSelectAllButton().addClickHandler(new ClickHandler() {
            
            @Override
            public void onClick(ClickEvent event) {
                for (EntityKey key : sitesOfWorkingSetModel.getKeys()) {
                    selectionModel.setSelected(new EntityContent<EntityKey>(key, null), true);
                }
            }
        });
        sourceSelectionView.getSelectNoneButton().addClickHandler(new ClickHandler() {
            
            @Override
            public void onClick(ClickEvent event) {
                selectionModel.clear();
            }
        });
        sitesOfWorkingSetModel.addListChangedHandler(new ListChangedHandler<EntityKey>() {
            
            @Override
            public void onContentListChanged(ListChangedEvent<EntityKey> event) {
                selectionModel.clear();
                for (EntityKey key : sitesOfWorkingSetModel.getKeys()) {
                    selectionModel.setSelected(new EntityContent<EntityKey>(key, null), true);
                }
            }
        });
    }
    
}
{'fraction_non_alphanumeric': 0.08434886499402629, 'fraction_numerical': 0.0, 'mean_word_length': 3.0134228187919465, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3407687', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1027, 'n_words': 163}