1 /*******************************************************************************
2  * Copyright (c) 2016, 2017 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.jdt.internal.debug.ui.actions;
15 
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleBreakpointAction;
18 import org.eclipse.jface.viewers.ISelection;
19 import org.eclipse.ui.IWorkbenchPart;
20 
21 /**
22  * Global retargettable toggle tracepoint action.
23  *
24  * @since 3.12
25  *
26  */
27 public class RetargetToggleTracepointAction extends RetargetToggleBreakpointAction {
28 
29 	/*
30 	 * (non-Javadoc)
31 	 *
32 	 * @see org.eclipse.debug.internal.ui.actions.RetargetTracepointAction# performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection,
33 	 * org.eclipse.ui.IWorkbenchPart)
34 	 */
35 	@Override
performAction(Object target, ISelection selection, IWorkbenchPart part)36 	protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
37 		BreakpointToggleUtils.setUnsetTracepoints(true);
38 		super.performAction(target, selection, part);
39 	}
40 
41 	/*
42 	 * (non-Javadoc)
43 	 *
44 	 * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection,
45 	 * org.eclipse.ui.IWorkbenchPart)
46 	 */
47 	@Override
canPerformAction(Object target, ISelection selection, IWorkbenchPart part)48 	protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
49 		return super.canPerformAction(target, selection, part);
50 	}
51 
52 	/*
53 	 * (non-Javadoc)
54 	 *
55 	 * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
56 	 */
57 	@Override
getOperationUnavailableMessage()58 	protected String getOperationUnavailableMessage() {
59 		return ActionMessages.TracepointToggleAction_Unavailable;
60 	}
61 }