<commit_before>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2012 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 org.appcelerator.titanium.proxy;

import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiFileHelper;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.util.TiUrl;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.MenuItem;
import android.view.MenuItem.OnActionExpandListener;
import android.view.View;

@Kroll.proxy
public class MenuItemProxy extends KrollProxy
	implements OnActionExpandListener
{
	private MenuItem item;

	protected MenuItemProxy(MenuItem item)
	{
		this.item = item;

		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			item.setOnActionExpandListener(this);
		}
	}

	public boolean onMenuItemActionCollapse(MenuItem item) {
		fireEvent(TiC.EVENT_COLLAPSE, null);
		return true;
	}

	public boolean onMenuItemActionExpand(MenuItem item) {
		fireEvent(TiC.EVENT_EXPAND, null);
		return true;
	}

	@Kroll.method @Kroll.getProperty
	public int getGroupId() {<commit_msg>Move OnActionExpandListener impl into a nested class.<commit_after>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2012 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 org.appcelerator.titanium.proxy;

import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiFileHelper;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.util.TiUrl;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.MenuItem;
import android.view.MenuItem.OnActionExpandListener;
import android.view.View;

@Kroll.proxy
public class MenuItemProxy extends KrollProxy
{
	private MenuItem item;

	private final class ActionExpandListener implements OnActionExpandListener {
		public boolean onMenuItemActionCollapse(MenuItem item) {
			fireEvent(TiC.EVENT_COLLAPSE, null);
			return true;
		}

		public boolean onMenuItemActionExpand(MenuItem item) {
			fireEvent(TiC.EVENT_EXPAND, null);
			return true;
		}
	}

	protected MenuItemProxy(MenuItem item)
	{
		this.item = item;

		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			item.setOnActionExpandListener(new ActionExpandListener());
		}
	}

	@Kroll.method @Kroll.getProperty
	public int getGroupId() {
{'fraction_non_alphanumeric': 0.08738796414852752, 'fraction_numerical': 0.005121638924455826, 'mean_word_length': 5.5928270042194095, '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': '5938627', 'n_tokens_mistral': 1081, 'n_tokens_neox': 997, 'n_words': 217}