FileDocCategorySizeDatePackage
SubMenuBuilder.javaAPI DocAndroid 5.1 API3624Thu Mar 12 22:22:10 GMT 2015com.android.internal.view.menu

SubMenuBuilder

public class SubMenuBuilder extends MenuBuilder implements android.view.SubMenu
The model for a sub menu, which is an extension of the menu. Most methods are proxied to the parent menu.

Fields Summary
private MenuBuilder
mParentMenu
private MenuItemImpl
mItem
Constructors Summary
public SubMenuBuilder(android.content.Context context, MenuBuilder parentMenu, MenuItemImpl item)

        super(context);

        mParentMenu = parentMenu;
        mItem = item;
    
Methods Summary
public booleancollapseItemActionView(MenuItemImpl item)

        return mParentMenu.collapseItemActionView(item);
    
booleandispatchMenuItemSelected(MenuBuilder menu, android.view.MenuItem item)

        return super.dispatchMenuItemSelected(menu, item) ||
                mParentMenu.dispatchMenuItemSelected(menu, item);
    
public booleanexpandItemActionView(MenuItemImpl item)

        return mParentMenu.expandItemActionView(item);
    
public java.lang.StringgetActionViewStatesKey()

        final int itemId = mItem != null ? mItem.getItemId() : 0;
        if (itemId == 0) {
            return null;
        }
        return super.getActionViewStatesKey() + ":" + itemId;
    
public android.view.MenuItemgetItem()

        return mItem;
    
public android.view.MenugetParentMenu()

        return mParentMenu;
    
public MenuBuildergetRootMenu()

        return mParentMenu;
    
public booleanisQwertyMode()

        return mParentMenu.isQwertyMode();
    
public booleanisShortcutsVisible()

        return mParentMenu.isShortcutsVisible();
    
public voidsetCallback(Callback callback)

        mParentMenu.setCallback(callback);
    
public android.view.SubMenusetHeaderIcon(android.graphics.drawable.Drawable icon)

        return (SubMenu) super.setHeaderIconInt(icon);
    
public android.view.SubMenusetHeaderIcon(int iconRes)

        return (SubMenu) super.setHeaderIconInt(iconRes);
    
public android.view.SubMenusetHeaderTitle(java.lang.CharSequence title)

        return (SubMenu) super.setHeaderTitleInt(title);
    
public android.view.SubMenusetHeaderTitle(int titleRes)

        return (SubMenu) super.setHeaderTitleInt(titleRes);
    
public android.view.SubMenusetHeaderView(android.view.View view)

        return (SubMenu) super.setHeaderViewInt(view);
    
public android.view.SubMenusetIcon(android.graphics.drawable.Drawable icon)

        mItem.setIcon(icon);
        return this;
    
public android.view.SubMenusetIcon(int iconRes)

        mItem.setIcon(iconRes);
        return this;
    
public voidsetQwertyMode(boolean isQwerty)

        mParentMenu.setQwertyMode(isQwerty);
    
public voidsetShortcutsVisible(boolean shortcutsVisible)

        mParentMenu.setShortcutsVisible(shortcutsVisible);