<commit_before>package com.sksamuel.jqm4gwt.form.elements;

import com.google.gwt.dom.client.Document;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.TextArea;
import com.sksamuel.jqm4gwt.HasGridDimensions;
import com.sksamuel.jqm4gwt.HasMini;
import com.sksamuel.jqm4gwt.form.JQMFieldContainer;
import com.sksamuel.jqm4gwt.html.FormLabel;

/**
 * @author <NAME> <EMAIL> 11 May 2011 13:49:09
 * 
 *         An implementation of a standard HTML Textarea
 * 
 */
public class JQMTextArea extends JQMFieldContainer implements HasGridDimensions, HasText, HasValue<String>, HasMini, Focusable {

	private final FormLabel	label	= new FormLabel();

	private final TextArea	input	= new TextArea();

	/**
	 * Create a new {@link JQMTextArea} with no label text
	 */
	public JQMTextArea() {
		this(null);
	}

	/**
	 * Create a new {@link JQMTextArea} with the given label text and with the
	 * default size
	 * 
	 * @param text
	 *              the display text for the label
	 */
	public JQMTextArea(String text) {
		String id = Document.get().createUniqueId();

		setText(text);
		label.setFor(id);

		input.getElement().setId(id);
		input.setName(id);

		add(label);
		add(input);
	}

	/**
	 * Create a new {@link JQMTextArea} with the given label text and with the
	 * specified number of columns and rows.
	 * 
	 * @param text
	 *              the display text for the label
	 * 
	 * @param cols
	 *              the number of cols to display
	 * @param rows
	 *              the number of rows to display.
	 */
	public JQMTextArea(String text, int cols, int rows) {
		this(text);
		setColumns(cols);
		setRows(rows);
	}

	@Override
	public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
		return input.addValueChangeHandler(handler);
	}

	@Override
	public int getColumns() {
		return Integer.parseInt(input.getElement().getAttribute("cols"));
	}

	@Override
	public int getRows() {
		return Integer.parseInt(input.getElement().getAttribute("rows"));
	}

	@Override
	public int getTabIndex() {
		return input.getTabIndex();
	}

	@Override
	public String getText() {
		return label.getText();
	}

	@Override
	public String getValue() {
		return input.getValue();
	}

	@Override
	public boolean isMini() {
		return "true".equals(getAttribute("data-mini"));
	}

	@Override
	public void setAccessKey(char key) {
		input.setAccessKey(key);
	}

	@Override
	public void setColumns(int cols) {
		input.getElement().setAttribute("cols", String.valueOf(cols));
	}

	@Override
	public void setFocus(boolean focused) {
		input.setFocus(focused);
	}

	/**
	 * If set to true then renders a smaller version of the standard-sized element.
	 */
	@Override
	public void setMini(boolean mini) {
		setAttribute("data-mini", String.valueOf(mini));
	}

	@Override
	public void setRows(int rows) {
		input.getElement().setAttribute("rows", String.valueOf(rows));
	}

	@Override
	public void setTabIndex(int index) {
		input.setTabIndex(index);
	}

	@Override
	public void setText(String text) {
		label.setText(text);
	}

	@Override
	public void setValue(String value) {
		setValue(value, false);
	}

	@Override
	public void setValue(String value, boolean fireEvents) {
		input.setValue(value, fireEvents);
	}
}
<commit_msg>added focus and key handlers to text area fields<commit_after>package com.sksamuel.jqm4gwt.form.elements;

import com.google.gwt.dom.client.Document;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasAllFocusHandlers;
import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.event.dom.client.HasFocusHandlers;
import com.google.gwt.event.dom.client.HasKeyDownHandlers;
import com.google.gwt.event.dom.client.HasKeyUpHandlers;
import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.TextArea;
import com.sksamuel.jqm4gwt.HasGridDimensions;
import com.sksamuel.jqm4gwt.HasMini;
import com.sksamuel.jqm4gwt.form.JQMFieldContainer;
import com.sksamuel.jqm4gwt.html.FormLabel;

/**
 * @author <NAME> <EMAIL> 11 May 2011 13:49:09
 * 
 *         An implementation of a standard HTML Textarea
 * 
 */
public class JQMTextArea extends JQMFieldContainer implements HasGridDimensions, HasText, HasValue<String>, HasMini, HasKeyDownHandlers, HasKeyUpHandlers, HasAllFocusHandlers, Focusable {

	private final FormLabel	label	= new FormLabel();

	private final TextArea	input	= new TextArea();

	/**
	 * Create a new {@link JQMTextArea} with no label text
	 */
	public JQMTextArea() {
		this(null);
	}

	/**
	 * Create a new {@link JQMTextArea} with the given label text and with the
	 * default size
	 * 
	 * @param text
	 *              the display text for the label
	 */
	public JQMTextArea(String text) {
		String id = Document.get().createUniqueId();

		setText(text);
		label.setFor(id);

		input.getElement().setId(id);
		input.setName(id);

		add(label);
		add(input);
	}

	/**
	 * Create a new {@link JQMTextArea} with the given label text and with the
	 * specified number of columns and rows.
	 * 
	 * @param text
	 *              the display text for the label
	 * 
	 * @param cols
	 *              the number of cols to display
	 * @param rows
	 *              the number of rows to display.
	 */
	public JQMTextArea(String text, int cols, int rows) {
		this(text);
		setColumns(cols);
		setRows(rows);
	}

	@Override
	public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
		return input.addValueChangeHandler(handler);
	}

	@Override
	public int getColumns() {
		return Integer.parseInt(input.getElement().getAttribute("cols"));
	}

	@Override
	public int getRows() {
		return Integer.parseInt(input.getElement().getAttribute("rows"));
	}

	@Override
	public int getTabIndex() {
		return input.getTabIndex();
	}

	@Override
	public String getText() {
		return label.getText();
	}

	@Override
	public String getValue() {
		return input.getValue();
	}

	@Override
	public boolean isMini() {
		return "true".equals(getAttribute("data-mini"));
	}

	@Override
	public void setAccessKey(char key) {
		input.setAccessKey(key);
	}

	@Override
	public void setColumns(int cols) {
		input.getElement().setAttribute("cols", String.valueOf(cols));
	}

	@Override
	public void setFocus(boolean focused) {
		input.setFocus(focused);
	}

	/**
	 * If set to true then renders a smaller version of the standard-sized element.
	 */
	@Override
	public void setMini(boolean mini) {
		setAttribute("data-mini", String.valueOf(mini));
	}

	@Override
	public void setRows(int rows) {
		input.getElement().setAttribute("rows", String.valueOf(rows));
	}

	@Override
	public void setTabIndex(int index) {
		input.setTabIndex(index);
	}

	@Override
	public void setText(String text) {
		label.setText(text);
	}

	@Override
	public void setValue(String value) {
		setValue(value, false);
	}

	@Override
	public void setValue(String value, boolean fireEvents) {
		input.setValue(value, fireEvents);
	}

	@Override
	public HandlerRegistration addBlurHandler(BlurHandler handler) {
		return input.addBlurHandler(handler);
	}

	@Override
	public HandlerRegistration addFocusHandler(FocusHandler handler) {
		return input.addFocusHandler(handler);
	}

	@Override
	public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
		return input.addKeyUpHandler(handler);
	}

	@Override
	public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
		return input.addKeyDownHandler(handler);
	}
}

{'fraction_non_alphanumeric': 0.11031689301882297, 'fraction_numerical': 0.004050512270669526, 'mean_word_length': 3.4207477619799893, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4669898', 'n_tokens_mistral': 2896, 'n_tokens_neox': 2644, 'n_words': 613}