Java Code Examples for org.eclipse.jface.action.IAction#getText()

The following examples show how to use org.eclipse.jface.action.IAction#getText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DetailViewActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: DeploymentActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: SetupActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 4
Source File: ProfileActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 5
Source File: OsgiActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 6
Source File: WorldActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 7
Source File: MemoryActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source File: RecipeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 9
Source File: InfrastructureActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 10
Source File: GlobalizeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source File: ComponentActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: ItemActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 13
Source File: ActionTree.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * ActionTree constructor for <b>child</b> tree nodes that will not have a
 * menu.
 * 
 * @param action
 *            A developer-defined JFace Action.
 */
public ActionTree(IAction action) {
	// Set the text.
	text = action.getText();

	// Set the developer-defined action.
	this.action = action;

	// We have no children and do not need the IMenuCreator.
	children = null;
	menuCreator = null;

	// Default to being enabled as soon as possible.
	enabled = true;

	return;
}