<commit_before>package org.jaulp.wicket.components.labeled.textarea;

import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.jaulp.wicket.components.labeled.LabeledFormComponentPanel;

/**
 * Convenience class for labeled TextArea.
 *
 * @param <T> the generic type
 */
public class LabeledTextAreaPanel<T> extends LabeledFormComponentPanel<T> {
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;
		
	/** The text area. */
	private final TextArea<T> textArea;

	/**
	 * Instantiates a new labeled text area panel.
	 *
	 * @param id the id
	 */
	public LabeledTextAreaPanel(String id) {
		this(id, null, null);
	}

	/**
	 * Instantiates a new labeled text area panel.
	 *
	 * @param id the id
	 * @param model the model
	 */
	public LabeledTextAreaPanel(String id, IModel<T> model, IModel<String> labelModel) {
		super(id, model, labelModel);
		PropertyModel<T> textAreaModel = new PropertyModel<T>(model.getObject(), id);
		add(textArea = newTextArea("textArea", textAreaModel));

		add(feedback = newComponentFeedbackPanel("feedback", textArea));

		String markupId = textArea.getMarkupId();
		add(label = newLabel("label", markupId, getLabel()));
	}

	/**
	 * Factory method for creating the TextArea. This method is invoked in the
	 * constructor from this class and can be overridden so users can
	 * provide their own version of a TextArea.
	 *
	 * @param id the id
	 * @param model the model
	 * @return the text area
	 */
	protected TextArea<T> newTextArea(String id, PropertyModel<T> model) {
		TextArea<T> textArea = new TextArea<T>(id, model);
		textArea.setOutputMarkupId(true);
		return textArea;
	}

	/**
	 * {@inheritDoc}
	 */
	public String getInput() {
		return textArea.getInput();
	}

	/**
	 * {@inheritDoc}
	 */
	protected void convertInput() {
		setConvertedInput(textArea.getConvertedInput());
	}

	/**
	 * {@inheritDoc}
	 */
	protected void onBeforeRender() {
		textArea.setRequired(isRequired());
		super.onBeforeRender();
	}
}<commit_msg>Added getter for textarea component.<commit_after>package org.jaulp.wicket.components.labeled.textarea;

import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.jaulp.wicket.components.labeled.LabeledFormComponentPanel;

/**
 * Convenience class for labeled TextArea.
 *
 * @param <T> the generic type
 */
public class LabeledTextAreaPanel<T> extends LabeledFormComponentPanel<T> {
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;
		
	/** The text area. */
	private final TextArea<T> textArea;

	/**
	 * Instantiates a new labeled text area panel.
	 *
	 * @param id the id
	 */
	public LabeledTextAreaPanel(String id) {
		this(id, null, null);
	}

	/**
	 * Instantiates a new labeled text area panel.
	 *
	 * @param id the id
	 * @param model the model
	 * @param labelModel the label model
	 */
	public LabeledTextAreaPanel(String id, IModel<T> model, IModel<String> labelModel) {
		super(id, model, labelModel);
		PropertyModel<T> textAreaModel = new PropertyModel<T>(model.getObject(), id);
		add(textArea = newTextArea("textArea", textAreaModel));

		add(feedback = newComponentFeedbackPanel("feedback", textArea));

		String markupId = textArea.getMarkupId();
		add(label = newLabel("label", markupId, getLabel()));
	}

	/**
	 * {@inheritDoc}
	 */
	protected void convertInput() {
		setConvertedInput(textArea.getConvertedInput());
	}

	/**
	 * {@inheritDoc}
	 */
	public String getInput() {
		return textArea.getInput();
	}

	/**
	 * Gets the text area.
	 *
	 * @return the text area
	 */
	public TextArea<T> getTextArea() {
		return textArea;
	}

	/**
	 * Factory method for creating the TextArea. This method is invoked in the
	 * constructor from this class and can be overridden so users can
	 * provide their own version of a TextArea.
	 *
	 * @param id the id
	 * @param model the model
	 * @return the text area
	 */
	protected TextArea<T> newTextArea(String id, PropertyModel<T> model) {
		TextArea<T> textArea = new TextArea<T>(id, model);
		textArea.setOutputMarkupId(true);
		return textArea;
	}

	/**
	 * {@inheritDoc}
	 */
	protected void onBeforeRender() {
		textArea.setRequired(isRequired());
		super.onBeforeRender();
	}
}
{'fraction_non_alphanumeric': 0.12299954275262917, 'fraction_numerical': 0.0004572473708276177, 'mean_word_length': 4.1050175029171525, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, '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': '6005303', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1347, 'n_words': 370}