<commit_before>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2011 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.annotations.Kroll;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.Log;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.view.TiUIView;

import ti.modules.titanium.ui.widget.picker.TiUISpinnerRow;

import android.app.Activity;

@Kroll.proxy(creatableInModule=UIModule.class)
public class PickerRowProxy extends TiViewProxy
{
	private static final String LCAT = "PickerRowProxy";
	private String title = "[PickerRow]";
	private PickerRowListener rowListener = null;

	public PickerRowProxy(TiContext tiContext)
	{
		super(tiContext);
	}
	
	@Kroll.getProperty @Kroll.method
	public String getTitle() {
		return toString();
	}
	@Kroll.setProperty @Kroll.method
	public void setTitle(String value)
	{
		title = value;
		if (rowListener != null) {
			rowListener.rowChanged(this);
		}
	}

	@Override
	public String toString()
	{
		return title;
	}
	
	public void setRowListener(PickerRowListener listener)
	{
		rowListener = listener;
	}
	
	@Override
	public void add(TiViewProxy child)
	{
		Log.w(LCAT, "PickerRow does not support child controls");
	}
	@Override
	public void remove(TiViewProxy child)
	{
		Log.w(LCAT, "PickerRow does not support child controls");
	}

	@Override
	public TiUIView createView(Activity activity)
	{
		return new TiUISpinnerRow(this);
	}

	@Override
	public void handleCreationDict(KrollDict options)
	{
		if (options.containsKey("title")) {
			title = TiConvert.toString(options, "title");
		}
	}
	
	public interface PickerRowListener
	{
		void rowChanged(PickerRowProxy row);
	}<commit_msg>Oops, failed to call super's handleCreationDict() [#3225]<commit_after>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2011 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.annotations.Kroll;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.Log;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.view.TiUIView;

import ti.modules.titanium.ui.widget.picker.TiUISpinnerRow;

import android.app.Activity;

@Kroll.proxy(creatableInModule=UIModule.class)
public class PickerRowProxy extends TiViewProxy
{
	private static final String LCAT = "PickerRowProxy";
	private String title = "[PickerRow]";
	private PickerRowListener rowListener = null;

	public PickerRowProxy(TiContext tiContext)
	{
		super(tiContext);
	}
	
	@Kroll.getProperty @Kroll.method
	public String getTitle() {
		return toString();
	}
	@Kroll.setProperty @Kroll.method
	public void setTitle(String value)
	{
		title = value;
		if (rowListener != null) {
			rowListener.rowChanged(this);
		}
	}

	@Override
	public String toString()
	{
		return title;
	}
	
	public void setRowListener(PickerRowListener listener)
	{
		rowListener = listener;
	}
	
	@Override
	public void add(TiViewProxy child)
	{
		Log.w(LCAT, "PickerRow does not support child controls");
	}
	@Override
	public void remove(TiViewProxy child)
	{
		Log.w(LCAT, "PickerRow does not support child controls");
	}

	@Override
	public TiUIView createView(Activity activity)
	{
		return new TiUISpinnerRow(this);
	}

	@Override
	public void handleCreationDict(KrollDict options)
	{
		super.handleCreationDict(options);
		if (options.containsKey("title")) {
			title = TiConvert.toString(options, "title");
		}
	}
	
	public interface PickerRowListener
	{
		void rowChanged(PickerRowProxy row);
	}
{'fraction_non_alphanumeric': 0.09801031687546058, 'fraction_numerical': 0.0049127978383689515, 'mean_word_length': 4.92721979621543, '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': '828474', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1335, 'n_words': 317}