public void setShortcut(boolean showShortcut, char shortcutKey) {
    final int newVisibility = (showShortcut && mItemData.shouldShowShortcut()) ? VISIBLE : GONE;

    if (newVisibility == VISIBLE) {
      mShortcutView.setText(mItemData.getShortcutLabel());
    }

    if (mShortcutView.getVisibility() != newVisibility) {
      mShortcutView.setVisibility(newVisibility);
    }
  }
  public void initialize(MenuItemImpl itemData, int menuType) {
    mItemData = itemData;
    mMenuType = menuType;

    setVisibility(itemData.isVisible() ? View.VISIBLE : View.GONE);

    setTitle(itemData.getTitleForItemView(this));
    setCheckable(itemData.isCheckable());
    setShortcut(itemData.shouldShowShortcut(), itemData.getShortcut());
    setIcon(itemData.getIcon());
    setEnabled(itemData.isEnabled());
  }