<commit_before>//
// $Id$

package com.threerings.gwt.ui;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * A panel that lines up it's contents horizontally and wraps them around at the end of lines.
 * Child widgets will be assigned the style attribute "float: left" when added and it will be
 * removed when they are. This is a good div and css using alternative to HorizontalPanel.
 */
public class FloatPanel extends FlowPanel
{
    public FloatPanel (String styleName)
    {
        super();
        if (styleName != null) {
            setStyleName(styleName);
        }

        SimplePanel clear = new SimplePanel();
        clear.setStyleName("fpClear");
        super.add(clear);
    }

    @Override public void add (Widget widget)
    {
        // insert it at the end, before the clear box
        insert(widget, this.getWidgetCount() - 1);
    }

    @Override public void insert (Widget widget, int beforeIndex)
    {
        widget.addStyleName("fpFloatLeft");
        super.insert(widget, beforeIndex);
    }

    @Override public boolean remove (Widget widget)
    {
        if (super.remove(widget)) {
            widget.removeStyleName("fpFloatLeft");
            return true;
        }
        return false;
    }
}<commit_msg>Formatting.<commit_after>//
// $Id$

package com.threerings.gwt.ui;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * A panel that lines up it's contents horizontally and wraps them around at the end of lines.
 * Child widgets will be assigned the style attribute "float: left" when added and it will be
 * removed when they are. This is a good div and css using alternative to HorizontalPanel.
 */
public class FloatPanel extends FlowPanel
{
    public FloatPanel (String styleName)
    {
        super();
        if (styleName != null) {
            setStyleName(styleName);
        }

        SimplePanel clear = new SimplePanel();
        clear.setStyleName("fpClear");
        super.add(clear);
    }

    @Override // from FlowPanel
    public void add (Widget widget)
    {
        // insert it at the end, before the clear box
        insert(widget, this.getWidgetCount() - 1);
    }

    @Override // from FlowPanel
    public void insert (Widget widget, int beforeIndex)
    {
        widget.addStyleName("fpFloatLeft");
        super.insert(widget, beforeIndex);
    }

    @Override // from FlowPanel
    public boolean remove (Widget widget)
    {
        if (super.remove(widget)) {
            widget.removeStyleName("fpFloatLeft");
            return true;
        }
        return false;
    }
}
{'fraction_non_alphanumeric': 0.09949348769898697, 'fraction_numerical': 0.000723589001447178, 'mean_word_length': 2.4867591424968474, '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': '1076956', 'n_tokens_mistral': 792, 'n_tokens_neox': 770, 'n_words': 246}