Java Code Examples for org.eclipse.jface.action.IContributionManager#add()

The following examples show how to use org.eclipse.jface.action.IContributionManager#add() . 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: SetupActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 2
Source File: MemoryActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 3
Source File: ConfigurationActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 4
Source File: ItemActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 5
Source File: OsgiActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 6
Source File: OsgiActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 7
Source File: RecipeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 8
Source File: SetupActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 9
Source File: RecipeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 10
Source File: VisualInterfaceActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 11
Source File: GlobalizeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 12
Source File: AbstractChartView.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void fillToolbar ( final IContributionManager contributionManager )
{
    contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.MINUTES, "<1m>", "Scale to one minute" ) );
    contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.HOURS, "<1h>", "Scale to one hour" ) );
    contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.DAYS, "<1d>", "Scale to one day" ) );

    contributionManager.add ( new CenterNowAction () );

    contributionManager.add ( new Separator () );

    contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.DAYS, "<1d", "Move back 1 day" ) );
    contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.HOURS, "<1h", "Move back 1 hour" ) );
    contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.MINUTES, "<1m", "Move back 1 minute" ) );

    contributionManager.add ( new Separator () );

    contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.MINUTES, "1m>", "Move forward 1 minute" ) );
    contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.HOURS, "1h>", "Move forward 1 hour" ) );
    contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.DAYS, "1d>", "Move forward 1 day" ) );

    contributionManager.add ( new Separator () );

    contributionManager.add ( new HelpAction () );
}
 
Example 13
Source File: ComponentActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
Example 14
Source File: InfrastructureActionBarContributor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
 * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
 * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
 * item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions, String contributionID )
{
    if ( submenuActions != null )
    {
        for ( Map.Entry<String, Collection<IAction>> entry : submenuActions.entrySet () )
        {
            MenuManager submenuManager = new MenuManager ( entry.getKey () );
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, submenuManager );
            }
            else
            {
                manager.add ( submenuManager );
            }
            populateManager ( submenuManager, entry.getValue (), null );
        }
    }
}
 
Example 15
Source File: CoreActionBarContributor.java    From ifml-editor with MIT License 5 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			}
			else {
				manager.add(action);
			}
		}
	}
}
 
Example 16
Source File: ExtensionsActionBarContributor.java    From ifml-editor with MIT License 5 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			}
			else {
				manager.add(action);
			}
		}
	}
}
 
Example 17
Source File: GenconfActionBarContributor.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions,
        String contributionID) {
    if (actions != null) {
        for (IAction action : actions) {
            if (contributionID != null) {
                manager.insertBefore(contributionID, action);
            } else {
                manager.add(action);
            }
        }
    }
}
 
Example 18
Source File: CrossflowActionBarContributor.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			}
			else {
				manager.add(action);
			}
		}
	}
}
 
Example 19
Source File: ChartActionBarContributor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager,
		Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			} else {
				manager.add(action);
			}
		}
	}
}
 
Example 20
Source File: AbstractSliceSystem.java    From dawnsci with Eclipse Public License 1.0 4 votes vote down vote up
protected void createCustomActions(IContributionManager man) {
	if (customActions!=null) {
		man.add(new Separator("group5"));
		for (IAction action : customActions) man.add(action);
	}
}