Search in sources :

Example 1 with LaunchAction

use of org.eclipse.debug.ui.actions.LaunchAction in project tdi-studio-se by Talend.

the class TalendLaunchToolbarAction method addToMenu.

private int addToMenu(Menu menu, ILaunchConfiguration[] launchList, int accelerator, IRepositoryObject... allVersion) {
    for (ILaunchConfiguration launch : launchList) {
        try {
            if (launch.getType().getIdentifier().equals(TalendDebugUIConstants.JOB_DEBUG_LAUNCH_CONFIGURATION_TYPE) && isCurrentProject(launch)) {
                if (checkItemExisted(launch, allVersion)) {
                    LaunchAction action = new LaunchAction(launch, getMode());
                    addToMenu(menu, action, accelerator);
                    accelerator++;
                }
            }
        } catch (Exception e) {
            ExceptionHandler.process(e);
            continue;
        }
    }
    return accelerator;
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) LaunchAction(org.eclipse.debug.ui.actions.LaunchAction) CoreException(org.eclipse.core.runtime.CoreException) PersistenceException(org.talend.commons.exception.PersistenceException)

Example 2 with LaunchAction

use of org.eclipse.debug.ui.actions.LaunchAction in project dbeaver by dbeaver.

the class DebugConfigurationMenuContributor method fillContributionItems.

@Override
protected void fillContributionItems(final List<IContributionItem> menuItems) {
    // Fill recent debugs
    LaunchConfigurationManager launchConfigurationManager = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
    LaunchHistory launchHistory = launchConfigurationManager.getLaunchHistory(DebugUI.DEBUG_LAUNCH_GROUP_ID);
    ILaunchConfiguration[] filteredConfigs = LaunchConfigurationManager.filterConfigs(launchHistory.getHistory());
    for (ILaunchConfiguration launch : filteredConfigs) {
        LaunchAction action = new LaunchAction(launch, "debug");
        menuItems.add(new ActionContributionItem(action));
    }
    // Fill configuration actions
    if (filteredConfigs.length > 0) {
        menuItems.add(new Separator());
    }
    menuItems.add(new ActionContributionItem(new LaunchShortcutsAction(DebugUI.DEBUG_LAUNCH_GROUP_ID)));
    menuItems.add(new ActionContributionItem(new DebugLaunchDialogAction()));
}
Also used : LaunchHistory(org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) LaunchConfigurationManager(org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager) LaunchAction(org.eclipse.debug.ui.actions.LaunchAction) LaunchShortcutsAction(org.eclipse.debug.ui.actions.LaunchShortcutsAction) Separator(org.eclipse.jface.action.Separator)

Example 3 with LaunchAction

use of org.eclipse.debug.ui.actions.LaunchAction in project dbeaver by serge-rider.

the class DebugConfigurationMenuContributor method fillContributionItems.

@Override
protected void fillContributionItems(final List<IContributionItem> menuItems) {
    // Fill recent debugs
    LaunchConfigurationManager launchConfigurationManager = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
    LaunchHistory launchHistory = launchConfigurationManager.getLaunchHistory(DebugUI.DEBUG_LAUNCH_GROUP_ID);
    ILaunchConfiguration[] filteredConfigs = LaunchConfigurationManager.filterConfigs(launchHistory.getHistory());
    for (ILaunchConfiguration launch : filteredConfigs) {
        LaunchAction action = new LaunchAction(launch, "debug");
        menuItems.add(new ActionContributionItem(action));
    }
    // Fill configuration actions
    if (filteredConfigs.length > 0) {
        menuItems.add(new Separator());
    }
    menuItems.add(new ActionContributionItem(new LaunchShortcutsAction(DebugUI.DEBUG_LAUNCH_GROUP_ID)));
    menuItems.add(new ActionContributionItem(new DebugLaunchDialogAction()));
}
Also used : LaunchHistory(org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) LaunchConfigurationManager(org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager) LaunchAction(org.eclipse.debug.ui.actions.LaunchAction) LaunchShortcutsAction(org.eclipse.debug.ui.actions.LaunchShortcutsAction) Separator(org.eclipse.jface.action.Separator)

Aggregations

ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)3 LaunchAction (org.eclipse.debug.ui.actions.LaunchAction)3 LaunchConfigurationManager (org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager)2 LaunchHistory (org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory)2 LaunchShortcutsAction (org.eclipse.debug.ui.actions.LaunchShortcutsAction)2 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)2 Separator (org.eclipse.jface.action.Separator)2 CoreException (org.eclipse.core.runtime.CoreException)1 PersistenceException (org.talend.commons.exception.PersistenceException)1