FileDocCategorySizeDatePackage
MenuItemWrapperICS.javaAPI DocAndroid 5.1 API11557Thu Mar 12 22:22:56 GMT 2015android.support.v7.internal.view.menu

MenuItemWrapperICS

public class MenuItemWrapperICS extends BaseMenuWrapper implements android.view.MenuItem
Wraps a support {@link SupportMenuItem} as a framework {@link android.view.MenuItem}
hide

Fields Summary
static final String
LOG_TAG
private Method
mSetExclusiveCheckableMethod
Constructors Summary
MenuItemWrapperICS(android.content.Context context, android.support.v4.internal.view.SupportMenuItem object)


        
        super(context, object);
    
Methods Summary
public booleancollapseActionView()

        return mWrappedObject.collapseActionView();
    
android.support.v7.internal.view.menu.MenuItemWrapperICS$ActionProviderWrappercreateActionProviderWrapper(android.view.ActionProvider provider)

        return new ActionProviderWrapper(mContext, provider);
    
public booleanexpandActionView()

        return mWrappedObject.expandActionView();
    
public android.view.ActionProvidergetActionProvider()

        ActionProvider provider = mWrappedObject.getSupportActionProvider();
        if (provider instanceof ActionProviderWrapper) {
            return ((ActionProviderWrapper) provider).mInner;
        }
        return null;
    
public android.view.ViewgetActionView()

        View actionView = mWrappedObject.getActionView();
        if (actionView instanceof CollapsibleActionViewWrapper) {
            return ((CollapsibleActionViewWrapper) actionView).getWrappedView();
        }
        return actionView;
    
public chargetAlphabeticShortcut()

        return mWrappedObject.getAlphabeticShortcut();
    
public intgetGroupId()

        return mWrappedObject.getGroupId();
    
public android.graphics.drawable.DrawablegetIcon()

        return mWrappedObject.getIcon();
    
public android.content.IntentgetIntent()

        return mWrappedObject.getIntent();
    
public intgetItemId()

        return mWrappedObject.getItemId();
    
public ContextMenu.ContextMenuInfogetMenuInfo()

        return mWrappedObject.getMenuInfo();
    
public chargetNumericShortcut()

        return mWrappedObject.getNumericShortcut();
    
public intgetOrder()

        return mWrappedObject.getOrder();
    
public android.view.SubMenugetSubMenu()

        return getSubMenuWrapper(mWrappedObject.getSubMenu());
    
public java.lang.CharSequencegetTitle()

        return mWrappedObject.getTitle();
    
public java.lang.CharSequencegetTitleCondensed()

        return mWrappedObject.getTitleCondensed();
    
public booleanhasSubMenu()

        return mWrappedObject.hasSubMenu();
    
public booleanisActionViewExpanded()

        return mWrappedObject.isActionViewExpanded();
    
public booleanisCheckable()

        return mWrappedObject.isCheckable();
    
public booleanisChecked()

        return mWrappedObject.isChecked();
    
public booleanisEnabled()

        return mWrappedObject.isEnabled();
    
public booleanisVisible()

        return mWrappedObject.isVisible();
    
public android.view.MenuItemsetActionProvider(android.view.ActionProvider provider)

        mWrappedObject.setSupportActionProvider(
                provider != null ? createActionProviderWrapper(provider) : null);
        return this;
    
public android.view.MenuItemsetActionView(android.view.View view)

        if (view instanceof android.view.CollapsibleActionView) {
            view = new CollapsibleActionViewWrapper(view);
        }
        mWrappedObject.setActionView(view);
        return this;
    
public android.view.MenuItemsetActionView(int resId)

        // Make framework menu item inflate the view
        mWrappedObject.setActionView(resId);

        View actionView = mWrappedObject.getActionView();
        if (actionView instanceof android.view.CollapsibleActionView) {
            // If the inflated Action View is support-collapsible, wrap it
            mWrappedObject.setActionView(new CollapsibleActionViewWrapper(actionView));
        }
        return this;
    
public android.view.MenuItemsetAlphabeticShortcut(char alphaChar)

        mWrappedObject.setAlphabeticShortcut(alphaChar);
        return this;
    
public android.view.MenuItemsetCheckable(boolean checkable)

        mWrappedObject.setCheckable(checkable);
        return this;
    
public android.view.MenuItemsetChecked(boolean checked)

        mWrappedObject.setChecked(checked);
        return this;
    
public android.view.MenuItemsetEnabled(boolean enabled)

        mWrappedObject.setEnabled(enabled);
        return this;
    
public voidsetExclusiveCheckable(boolean checkable)

        try {
            if (mSetExclusiveCheckableMethod == null) {
                mSetExclusiveCheckableMethod = mWrappedObject.getClass()
                        .getDeclaredMethod("setExclusiveCheckable", Boolean.TYPE);
            }
            mSetExclusiveCheckableMethod.invoke(mWrappedObject, checkable);
        } catch (Exception e) {
            Log.w(LOG_TAG, "Error while calling setExclusiveCheckable", e);
        }
    
public android.view.MenuItemsetIcon(android.graphics.drawable.Drawable icon)

        mWrappedObject.setIcon(icon);
        return this;
    
public android.view.MenuItemsetIcon(int iconRes)

        mWrappedObject.setIcon(iconRes);
        return this;
    
public android.view.MenuItemsetIntent(android.content.Intent intent)

        mWrappedObject.setIntent(intent);
        return this;
    
public android.view.MenuItemsetNumericShortcut(char numericChar)

        mWrappedObject.setNumericShortcut(numericChar);
        return this;
    
public android.view.MenuItemsetOnActionExpandListener(MenuItem.OnActionExpandListener listener)

        mWrappedObject.setSupportOnActionExpandListener(listener != null ?
                new OnActionExpandListenerWrapper(listener) : null);
        return this;
    
public android.view.MenuItemsetOnMenuItemClickListener(OnMenuItemClickListener menuItemClickListener)

        mWrappedObject.setOnMenuItemClickListener(menuItemClickListener != null ?
                new OnMenuItemClickListenerWrapper(menuItemClickListener) : null);
        return this;
    
public android.view.MenuItemsetShortcut(char numericChar, char alphaChar)

        mWrappedObject.setShortcut(numericChar, alphaChar);
        return this;
    
public voidsetShowAsAction(int actionEnum)

        mWrappedObject.setShowAsAction(actionEnum);
    
public android.view.MenuItemsetShowAsActionFlags(int actionEnum)

        mWrappedObject.setShowAsActionFlags(actionEnum);
        return this;
    
public android.view.MenuItemsetTitle(java.lang.CharSequence title)

        mWrappedObject.setTitle(title);
        return this;
    
public android.view.MenuItemsetTitle(int title)

        mWrappedObject.setTitle(title);
        return this;
    
public android.view.MenuItemsetTitleCondensed(java.lang.CharSequence title)

        mWrappedObject.setTitleCondensed(title);
        return this;
    
public android.view.MenuItemsetVisible(boolean visible)

        return mWrappedObject.setVisible(visible);