<commit_before>package org.carrot2.workbench.core.ui.views;

import org.carrot2.core.Cluster;
import org.carrot2.workbench.core.ui.DocumentListBrowser;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class DocumentListView extends ViewPart
{
    public static final String ID = "org.carrot2.workbench.core.documents";

    private DocumentListBrowser browserPart;

    @Override
    public void createPartControl(Composite parent)
    {
        browserPart = new DocumentListBrowser();
        browserPart.init(this.getSite(), parent);
        browserPart.populateToolbar(getViewSite().getActionBars().getToolBarManager());
    }

    @Override
    public void setFocus()
    {
        ISelection selection = getSite().getPage().getSelection();
        if (selection != null && !selection.isEmpty()
            && selection instanceof IStructuredSelection)
        {
            IStructuredSelection selected = (IStructuredSelection) selection;
            if (selected.size() == 1 && selected.getFirstElement() instanceof Cluster)
            {
                browserPart.updateBrowserText((Cluster) selected.getFirstElement());
            }
        }
    }

    @Override
    public void dispose()
    {
        browserPart.dispose();
        super.dispose();
    }

}<commit_msg>little bug with documents view fixed<commit_after>package org.carrot2.workbench.core.ui.views;

import org.carrot2.core.Cluster;
import org.carrot2.workbench.core.ui.DocumentListBrowser;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class DocumentListView extends ViewPart
{
    public static final String ID = "org.carrot2.workbench.core.documents";

    private DocumentListBrowser browserPart;

    @Override
    public void createPartControl(Composite parent)
    {
        browserPart = new DocumentListBrowser();
        browserPart.init(this.getSite(), parent);
        browserPart.populateToolbar(getViewSite().getActionBars().getToolBarManager());
        ISelection selection = getSite().getPage().getSelection();
        if (selection != null && !selection.isEmpty()
            && selection instanceof IStructuredSelection)
        {
            IStructuredSelection selected = (IStructuredSelection) selection;
            if (selected.size() == 1 && selected.getFirstElement() instanceof Cluster)
            {
                browserPart.updateBrowserText((Cluster) selected.getFirstElement());
            }
        }
    }

    @Override
    public void setFocus()
    {
    }

    @Override
    public void dispose()
    {
        browserPart.dispose();
        super.dispose();
    }

}
{'fraction_non_alphanumeric': 0.10317183687696062, 'fraction_numerical': 0.003485535029627048, 'mean_word_length': 3.0767045454545454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6821711', 'n_tokens_mistral': 797, 'n_tokens_neox': 766, 'n_words': 147}