/*******************************************************************************
* Copyright (c) 2012, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.ui.actions;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
import org.eclipse.debug.internal.ui.actions.breakpoints.Messages;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.menus.IWorkbenchContribution;
import org.eclipse.ui.services.IServiceLocator;
/**
* Breakpoint ruler pop-up action that creates a sub-menu to select the currently
* active breakpoint type. This menu contribution can be added to an editor
* with the org.eclipse.ui.menus
extension point. The breakpoint
* types are calculated based on the toggle breakpoint target factories
* contributed through the toggleBreakpointsTargetFactories
extension point.
*
* Following is example plug-in XML used to contribute this action to an editor's * vertical ruler context menu. *
* <extension point="org.eclipse.ui.menus"> * <menuContribution * locationURI="popup:#CEditorRulerContext?after=additions" * id="example.RulerPopupActions"> * <menu\ * id="breakpointTypes" * label="Toggle Breakpoint"> * <dynamic\ * id="example.rulerContextMenu.breakpointTypesAction"> * class="org.eclipse.debug.ui.actions.BreakpointTypesContribution" * menubarPath="additions">/ * </menu> * </menuContribution> ** *
* Clients may refer to this class in plug-in XML. This class * is not intended to be sub-classed. *
* @since 3.8 * @noextend This class is not intended to be sub-classed by clients. */ public class BreakpointTypesContribution extends CompoundContributionItem implements IWorkbenchContribution { private class SelectTargetAction extends Action { private final Set