Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5d10c8d68c0aa9b3684ed5e44a4b8686a8566518 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2000, 2011 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.ui.actions;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;

/**
 * An adapter for a "run to line" operation. The debug platform provides
 * a retargettable "run to line" action that debuggers may plug into
 * by providing an adapter (see <code>IAdaptable</code>) of this type.
 * This allows the platform to provide one command and key binding for
 * the "run to line" function to be shared by many debuggers.
 * <p>
 * When a part is activated, a retargettable action asks the part
 * for its <code>IRunToLineTarget</code> adapter. If one exists,
 * that adapter is delegated to to perform "run to line" operations when
 * the user invokes an associated action. If an adapter does not exist
 * for the part, the retargettable actions asks selected objects in the
 * active part for an adapter. Generally, a debug implementation will
 * provide breakpoint adapters for relevant editors and model objects.
 * </p>
 * <p>
 * Clients are intended to implement this interface and provide instances as
 * an adapter on applicable parts (for example, editors) that support the
 * operation.
 * </p>
 * @since 3.0
 */
public interface IRunToLineTarget {

	/**
	 * Perform a run to line operation on the given element that is
	 * currently selected and suspended in the Debug view. Implementations
	 * must honor the user preference of whether to skip breakpoints
	 * during the operation -
	 * see <code>IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE</code>.
	 *
	 * @param part the part on which the action has been invoked
	 * @param selection the selection on which the action has been invoked
	 * @param target suspended element to perform the "run to line" action on
	 * @throws CoreException if unable to perform the action
	 */
	void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException;

	/**
	 * Returns whether a run to line operation can be performed on the given
	 * element that is currently selected and suspended in the Debug view.
	 *
	 * @param part the part on which the action has been invoked
	 * @param selection the selection on which the action has been invoked
	 * @param target suspended element to perform the "run to line" action on
	 * @return if a run to line operation can be performed on the given
	 * element that is currently selected and suspended in the Debug view
	 */
	boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target);
}

Back to the top