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

import static org.eclipse.swt.SWT.NONE;

import java.util.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import org.apache.commons.lang.StringUtils;
import org.carrot2.core.attribute.Internal;
import org.carrot2.util.attribute.AttributeDescriptor;
import org.carrot2.util.attribute.BindableDescriptor;
import org.carrot2.util.attribute.BindableDescriptor.GroupingMethod;
import org.carrot2.workbench.core.helpers.GUIFactory;
import org.carrot2.workbench.core.helpers.Utils;
import org.carrot2.workbench.editors.*;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.*;

import com.google.common.base.Predicate;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

/**
 * An SWT composite capable of displaying groups of {@link IAttributeEditor}s, sorted by
 * {@link GroupingMethod} and filtered using {@link #setFilter(Predicate)}.
 */
public final class AttributeGroups extends Composite implements
    IAttributeChangeProvider
{
    /**
     * Padding between a given group (when it is expanded) and the following group.
     */
    public static final int SPACE_TO_NEXT_GROUP = 15;
    
    /**
     * Method of grouping attribute editors.
     */
    private GroupingMethod grouping;

    /**
     * Main control in which editors are embedded.
     */
    private Composite mainControl;

    /**
     * External attribute change listeners.
     */
    private final List<IAttributeListener> listeners = new CopyOnWriteArrayList<IAttributeListener>();

    /**
     * Forward events from editors to external listeners.
     */
    private final IAttributeListener forwardListener = new IAttributeListener()
    {
        public void attributeChange(AttributeChangedEvent event)
        {
            for (IAttributeListener listener : listeners)
            {
                listener.attributeChange(event);
            }
        }

        public void contentChanging(IAttributeEditor editor, Object value)
        {<commit_msg>CARROT-217: Added some more padding between unfolded groups to make them clearly visually separate<commit_after>package org.carrot2.workbench.core.ui;

import static org.eclipse.swt.SWT.NONE;

import java.util.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import org.apache.commons.lang.StringUtils;
import org.carrot2.core.attribute.Internal;
import org.carrot2.util.attribute.AttributeDescriptor;
import org.carrot2.util.attribute.BindableDescriptor;
import org.carrot2.util.attribute.BindableDescriptor.GroupingMethod;
import org.carrot2.workbench.core.helpers.GUIFactory;
import org.carrot2.workbench.core.helpers.Utils;
import org.carrot2.workbench.editors.*;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.*;

import com.google.common.base.Predicate;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

/**
 * An SWT composite capable of displaying groups of {@link IAttributeEditor}s, sorted by
 * {@link GroupingMethod} and filtered using {@link #setFilter(Predicate)}.
 */
public final class AttributeGroups extends Composite implements
    IAttributeChangeProvider
{
    /**
     * Padding between a given group (when it is expanded) and the following group.
     */
    public static final int SPACE_TO_NEXT_GROUP = 30;
    
    /**
     * Method of grouping attribute editors.
     */
    private GroupingMethod grouping;

    /**
     * Main control in which editors are embedded.
     */
    private Composite mainControl;

    /**
     * External attribute change listeners.
     */
    private final List<IAttributeListener> listeners = new CopyOnWriteArrayList<IAttributeListener>();

    /**
     * Forward events from editors to external listeners.
     */
    private final IAttributeListener forwardListener = new IAttributeListener()
    {
        public void attributeChange(AttributeChangedEvent event)
        {
            for (IAttributeListener listener : listeners)
            {
                listener.attributeChange(event);
            }
        }

        public void contentChanging(IAttributeEditor editor, Object value)
        {
{'fraction_non_alphanumeric': 0.09288579269579902, 'fraction_numerical': 0.004855393709098586, 'mean_word_length': 3.649656526005888, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3441417', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1300, 'n_words': 315}