<commit_before>/* 
@ITMillApache2LicenseForJavaFiles@
 */

package com.itmill.toolkit.tests;

import com.itmill.toolkit.data.Property.ValueChangeEvent;
import com.itmill.toolkit.data.Property.ValueChangeListener;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.OrderedLayout;
import com.itmill.toolkit.ui.RichTextArea;

/**
 * 
 * @author IT Mill Ltd.
 */
public class TestForRichTextEditor extends CustomComponent implements
        ValueChangeListener {

    private final OrderedLayout main = new OrderedLayout();

    private Label l;

    private RichTextArea rte;

    public TestForRichTextEditor() {

        setCompositionRoot(main);
        createNewView();
    }

    public void createNewView() {
        main.removeAllComponents();
        main.addComponent(new Label(
                "RTE uses google richtextArea and their examples toolbar."));

        rte = new RichTextArea();
        rte.addListener(this);

        main.addComponent(rte);

        main.addComponent(new Button("commit content to label below"));

        l = new Label("", Label.CONTENT_XHTML);
        main.addComponent(l);

    }

    public void valueChange(ValueChangeEvent event) {
        l.setValue(rte.getValue());
    }

}<commit_msg>Test update: added toggle to edit enabled field<commit_after>/* 
@ITMillApache2LicenseForJavaFiles@
 */

package com.itmill.toolkit.tests;

import com.itmill.toolkit.data.Property.ValueChangeEvent;
import com.itmill.toolkit.data.Property.ValueChangeListener;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.OrderedLayout;
import com.itmill.toolkit.ui.RichTextArea;
import com.itmill.toolkit.ui.Button.ClickEvent;

/**
 * 
 * @author IT Mill Ltd.
 */
public class TestForRichTextEditor extends CustomComponent implements
        ValueChangeListener {

    private final OrderedLayout main = new OrderedLayout();

    private Label l;

    private RichTextArea rte;

    public TestForRichTextEditor() {

        setCompositionRoot(main);
        createNewView();
    }

    public void createNewView() {
        main.removeAllComponents();
        main.addComponent(new Label(
                "RTE uses google richtextArea and their examples toolbar."));

        rte = new RichTextArea();
        rte.addListener(this);

        main.addComponent(rte);

        main.addComponent(new Button("commit content to label below"));

        l = new Label("", Label.CONTENT_XHTML);
        main.addComponent(l);

        Button b = new Button("enabled");
        b.setSwitchMode(true);
        b.setImmediate(true);
        b.addListener(new Button.ClickListener() {
            public void buttonClick(ClickEvent event) {
                rte.setEnabled(!rte.isEnabled());
            }
        });
        main.addComponent(b);

    }

    public void valueChange(ValueChangeEvent event) {
        l.setValue(rte.getValue());
    }

}
{'fraction_non_alphanumeric': 0.1046777886817141, 'fraction_numerical': 0.0006542361792607131, 'mean_word_length': 3.044973544973545, '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': '3518360', 'n_tokens_mistral': 916, 'n_tokens_neox': 884, 'n_words': 183}