本文整理汇总了Java中org.eclipse.jface.action.IAction.getText方法的典型用法代码示例。如果您正苦于以下问题:Java IAction.getText方法的具体用法?Java IAction.getText怎么用?Java IAction.getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.action.IAction
的用法示例。
在下文中一共展示了IAction.getText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractSubmenuActions
import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
/**
* This extracts those actions in the <code>submenuActions</code> collection whose text is qualified and returns
* a map of these actions, keyed by submenu text.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Map<String, Collection<IAction>> extractSubmenuActions ( Collection<IAction> createActions )
{
Map<String, Collection<IAction>> createSubmenuActions = new LinkedHashMap<String, Collection<IAction>> ();
if ( createActions != null )
{
for ( Iterator<IAction> actions = createActions.iterator (); actions.hasNext (); )
{
IAction action = actions.next ();
StringTokenizer st = new StringTokenizer ( action.getText (), "|" ); //$NON-NLS-1$
if ( st.countTokens () == 2 )
{
String text = st.nextToken ().trim ();
Collection<IAction> submenuActions = createSubmenuActions.get ( text );
if ( submenuActions == null )
{
createSubmenuActions.put ( text, submenuActions = new ArrayList<IAction> () );
}
action.setText ( st.nextToken ().trim () );
submenuActions.add ( action );
actions.remove ();
}
}
}
return createSubmenuActions;
}
示例2: extractSubmenuActions
import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
/**
* This extracts those actions in the <code>submenuActions</code> collection whose text is qualified and returns
* a map of these actions, keyed by submenu text.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Map<String, Collection<IAction>> extractSubmenuActions ( Collection<IAction> createActions )
{
Map<String, Collection<IAction>> createSubmenuActions = new LinkedHashMap<String, Collection<IAction>> ();
if ( createActions != null )
{
for ( Iterator<IAction> actions = createActions.iterator (); actions.hasNext (); )
{
IAction action = actions.next ();
StringTokenizer st = new StringTokenizer ( action.getText (), "|" );
if ( st.countTokens () == 2 )
{
String text = st.nextToken ().trim ();
Collection<IAction> submenuActions = createSubmenuActions.get ( text );
if ( submenuActions == null )
{
createSubmenuActions.put ( text, submenuActions = new ArrayList<IAction> () );
}
action.setText ( st.nextToken ().trim () );
submenuActions.add ( action );
actions.remove ();
}
}
}
return createSubmenuActions;
}