<commit_before>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */
package ti.modules.titanium.ui;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollModule;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.view.TiUIView;

import ti.modules.titanium.ui.widget.TiUIText;
import android.app.Activity;
import android.os.Message;
// clang-format off
@Kroll.proxy(creatableInModule = UIModule.class,
	propertyAccessors = {
		TiC.PROPERTY_ATTRIBUTED_STRING,
		TiC.PROPERTY_AUTOCAPITALIZATION,
		TiC.PROPERTY_AUTOCORRECT,
		TiC.PROPERTY_AUTOFILL_TYPE,
		TiC.PROPERTY_AUTO_LINK,
		TiC.PROPERTY_CLEAR_ON_EDIT,
		TiC.PROPERTY_COLOR,
		TiC.PROPERTY_EDITABLE,
		TiC.PROPERTY_ELLIPSIZE,
		TiC.PROPERTY_ENABLE_RETURN_KEY,
		TiC.PROPERTY_FONT,
		TiC.PROPERTY_FULLSCREEN,
		TiC.PROPERTY_HINT_TEXT,
		TiC.PROPERTY_HINT_TEXT_COLOR,
		TiC.PROPERTY_HINT_TYPE,
		TiC.PROPERTY_KEYBOARD_TYPE,
		TiC.PROPERTY_MAX_LENGTH,
		TiC.PROPERTY_PASSWORD_MASK,
		TiC.PROPERTY_TEXT_ALIGN,
		TiC.PROPERTY_VALUE,
		TiC.PROPERTY_VERTICAL_ALIGN,
		TiC.PROPERTY_PADDING,
		TiC.PROPERTY_RETURN_KEY_TYPE
})
// clang-format on
public class TextAreaProxy extends TiViewProxy
{
	private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
	private static final int MSG_SET_SELECTION = MSG_FIRST_ID + 201;
	private static final int MSG_GET_SELECTION = MSG_FIRST_ID + 202;

	public TextAreaProxy()
	{
		super();
		defaultValues.put(TiC.PROPERTY_VALUE, "");
		defaultValues.put(TiC.PROPERTY_MAX_LENGTH, -1);
		defaultValues.put(TiC.PROPERTY_FULLSCREEN, true);
		defaultValues.put(TiC.PROPERTY_HINT_TYPE, UIModule.HINT_TYPE_STATIC);
	}

	@Override
	public void handleCreationArgs(KrollModule createdInModule, Object[] args)
	{
		super.handleCreationArgs(createdInModule, args);
	}

	@Override
	public TiUIView createView(Activity activity)
	{
		return new TiUIText(this, false);
	}

	@Kroll.method
	public Boolean hasText()
	{
		Object text = getProperty(TiC.PROPERTY_VALUE);
		return (TiConvert.toString(text, "").length() > 0);
	}<commit_msg>Fix so Ti.UI.TextArea.editable defaults to true (matching our docs).<commit_after>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */
package ti.modules.titanium.ui;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollModule;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.view.TiUIView;

import ti.modules.titanium.ui.widget.TiUIText;
import android.app.Activity;
import android.os.Message;
// clang-format off
@Kroll.proxy(creatableInModule = UIModule.class,
	propertyAccessors = {
		TiC.PROPERTY_ATTRIBUTED_STRING,
		TiC.PROPERTY_AUTOCAPITALIZATION,
		TiC.PROPERTY_AUTOCORRECT,
		TiC.PROPERTY_AUTOFILL_TYPE,
		TiC.PROPERTY_AUTO_LINK,
		TiC.PROPERTY_CLEAR_ON_EDIT,
		TiC.PROPERTY_COLOR,
		TiC.PROPERTY_EDITABLE,
		TiC.PROPERTY_ELLIPSIZE,
		TiC.PROPERTY_ENABLE_RETURN_KEY,
		TiC.PROPERTY_FONT,
		TiC.PROPERTY_FULLSCREEN,
		TiC.PROPERTY_HINT_TEXT,
		TiC.PROPERTY_HINT_TEXT_COLOR,
		TiC.PROPERTY_HINT_TYPE,
		TiC.PROPERTY_KEYBOARD_TYPE,
		TiC.PROPERTY_MAX_LENGTH,
		TiC.PROPERTY_PASSWORD_MASK,
		TiC.PROPERTY_TEXT_ALIGN,
		TiC.PROPERTY_VALUE,
		TiC.PROPERTY_VERTICAL_ALIGN,
		TiC.PROPERTY_PADDING,
		TiC.PROPERTY_RETURN_KEY_TYPE
})
// clang-format on
public class TextAreaProxy extends TiViewProxy
{
	private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1;
	private static final int MSG_SET_SELECTION = MSG_FIRST_ID + 201;
	private static final int MSG_GET_SELECTION = MSG_FIRST_ID + 202;

	public TextAreaProxy()
	{
		super();
		defaultValues.put(TiC.PROPERTY_VALUE, "");
		defaultValues.put(TiC.PROPERTY_MAX_LENGTH, -1);
		defaultValues.put(TiC.PROPERTY_FULLSCREEN, true);
		defaultValues.put(TiC.PROPERTY_EDITABLE, true);
		defaultValues.put(TiC.PROPERTY_HINT_TYPE, UIModule.HINT_TYPE_STATIC);
	}

	@Override
	public void handleCreationArgs(KrollModule createdInModule, Object[] args)
	{
		super.handleCreationArgs(createdInModule, args);
	}

	@Override
	public TiUIView createView(Activity activity)
	{
		return new TiUIText(this, false);
	}

	@Kroll.method
	public Boolean hasText()
	{
		Object text = getProperty(TiC.PROPERTY_VALUE);
		return (TiConvert.toString(text, "").length() > 0);
	}
{'fraction_non_alphanumeric': 0.09271779022599962, 'fraction_numerical': 0.006567510141008306, 'mean_word_length': 5.6812903225806455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6721357', 'n_tokens_mistral': 2042, 'n_tokens_neox': 1925, 'n_words': 320}