当前位置: 首页>>代码示例>>Java>>正文


Java MenuItemImpl.setExclusiveCheckable方法代码示例

本文整理汇总了Java中com.actionbarsherlock.internal.view.menu.MenuItemImpl.setExclusiveCheckable方法的典型用法代码示例。如果您正苦于以下问题:Java MenuItemImpl.setExclusiveCheckable方法的具体用法?Java MenuItemImpl.setExclusiveCheckable怎么用?Java MenuItemImpl.setExclusiveCheckable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.actionbarsherlock.internal.view.menu.MenuItemImpl的用法示例。


在下文中一共展示了MenuItemImpl.setExclusiveCheckable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setItem

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //导入方法依赖的package包/类
private void setItem(MenuItem item) {
    item.setChecked(itemChecked)
        .setVisible(itemVisible)
        .setEnabled(itemEnabled)
        .setCheckable(itemCheckable >= 1)
        .setTitleCondensed(itemTitleCondensed)
        .setIcon(itemIconResId)
        .setAlphabeticShortcut(itemAlphabeticShortcut)
        .setNumericShortcut(itemNumericShortcut);

    if (itemShowAsAction >= 0) {
        item.setShowAsAction(itemShowAsAction);
    }

    if (itemListenerMethodName != null) {
        if (mContext.isRestricted()) {
            throw new IllegalStateException("The android:onClick attribute cannot "
                    + "be used within a restricted context");
        }
        item.setOnMenuItemClickListener(
                new InflatedOnMenuItemClickListener(mRealOwner, itemListenerMethodName));
    }

    if (itemCheckable >= 2) {
        if (item instanceof MenuItemImpl) {
            MenuItemImpl impl = (MenuItemImpl) item;
            impl.setExclusiveCheckable(true);
        } else {
            menu.setGroupCheckable(groupId, true, true);
        }
    }

    boolean actionViewSpecified = false;
    if (itemActionViewClassName != null) {
        View actionView = (View) newInstance(itemActionViewClassName,
                ACTION_VIEW_CONSTRUCTOR_SIGNATURE, mActionViewConstructorArguments);
        item.setActionView(actionView);
        actionViewSpecified = true;
    }
    if (itemActionViewLayout > 0) {
        if (!actionViewSpecified) {
            item.setActionView(itemActionViewLayout);
            actionViewSpecified = true;
        } else {
            Log.w(LOG_TAG, "Ignoring attribute 'itemActionViewLayout'."
                    + " Action view already specified.");
        }
    }
    if (itemActionProvider != null) {
        item.setActionProvider(itemActionProvider);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:53,代码来源:MenuInflater.java

示例2: setItem

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //导入方法依赖的package包/类
private void setItem(MenuItem item) {
    item.setChecked(itemChecked)
            .setVisible(itemVisible)
            .setEnabled(itemEnabled)
            .setCheckable(itemCheckable >= 1)
            .setTitleCondensed(itemTitleCondensed)
            .setIcon(itemIconResId)
            .setAlphabeticShortcut(itemAlphabeticShortcut)
            .setNumericShortcut(itemNumericShortcut);

    if (itemShowAsAction >= 0) {
        item.setShowAsAction(itemShowAsAction);
    }

    if (itemListenerMethodName != null) {
        if (mContext.isRestricted()) {
            throw new IllegalStateException("The android:onClick attribute cannot "
                    + "be used within a restricted context");
        }
        item.setOnMenuItemClickListener(
                new InflatedOnMenuItemClickListener(mRealOwner, itemListenerMethodName));
    }

    if (itemCheckable >= 2) {
        if (item instanceof MenuItemImpl) {
            MenuItemImpl impl = (MenuItemImpl) item;
            impl.setExclusiveCheckable(true);
        } else {
            menu.setGroupCheckable(groupId, true, true);
        }
    }

    boolean actionViewSpecified = false;
    if (itemActionViewClassName != null) {
        View actionView = (View) newInstance(itemActionViewClassName,
                ACTION_VIEW_CONSTRUCTOR_SIGNATURE, mActionViewConstructorArguments);
        item.setActionView(actionView);
        actionViewSpecified = true;
    }
    if (itemActionViewLayout > 0) {
        if (!actionViewSpecified) {
            item.setActionView(itemActionViewLayout);
            actionViewSpecified = true;
        } else {
            Log.w(LOG_TAG, "Ignoring attribute 'itemActionViewLayout'."
                    + " Action view already specified.");
        }
    }
    if (itemActionProvider != null) {
        item.setActionProvider(itemActionProvider);
    }
}
 
开发者ID:ivanovpv,项目名称:darksms,代码行数:53,代码来源:MenuInflater.java

示例3: setItem

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //导入方法依赖的package包/类
private void setItem(MenuItem item) {
    item.setChecked(itemChecked)
        .setVisible(itemVisible)
        .setEnabled(itemEnabled)
        .setCheckable(itemCheckable >= 1)
        .setTitleCondensed(itemTitleCondensed)
        .setIcon(itemIconResId)
        .setAlphabeticShortcut(itemAlphabeticShortcut)
        .setNumericShortcut(itemNumericShortcut);

    if (itemShowAsAction >= 0) {
        item.setShowAsAction(itemShowAsAction);
    }

    if (itemListenerMethodName != null) {
        if (mContext.isRestricted()) {
            throw new IllegalStateException("The android:onClick attribute cannot "
                    + "be used within a restricted context");
        }
        item.setOnMenuItemClickListener(
                new InflatedOnMenuItemClickListener(mContext, itemListenerMethodName));
    }

    if (itemCheckable >= 2) {
        if (item instanceof MenuItemImpl) {
            MenuItemImpl impl = (MenuItemImpl) item;
            impl.setExclusiveCheckable(true);
        } else {
            menu.setGroupCheckable(groupId, true, true);
        }
    }

    boolean actionViewSpecified = false;
    if (itemActionViewClassName != null) {
        View actionView = (View) newInstance(itemActionViewClassName,
                ACTION_VIEW_CONSTRUCTOR_SIGNATURE, mActionViewConstructorArguments);
        item.setActionView(actionView);
        actionViewSpecified = true;
    }
    if (itemActionViewLayout > 0) {
        if (!actionViewSpecified) {
            item.setActionView(itemActionViewLayout);
            actionViewSpecified = true;
        } else {
            Log.w(LOG_TAG, "Ignoring attribute 'itemActionViewLayout'."
                    + " Action view already specified.");
        }
    }
    if (itemActionProvider != null) {
        item.setActionProvider(itemActionProvider);
    }
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:53,代码来源:MenuInflater.java


注:本文中的com.actionbarsherlock.internal.view.menu.MenuItemImpl.setExclusiveCheckable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。