KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > actions > IRunToLineTarget


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.ui.actions;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.debug.core.model.ISuspendResume;
15 import org.eclipse.jface.viewers.ISelection;
16 import org.eclipse.ui.IWorkbenchPart;
17
18 /**
19  * An adapter for a "run to line" operation. The debug platform provides
20  * a retargettable "run to line" action that debuggers may plug into
21  * by providing an adapter (see <code>IAdaptable</code>) of this type.
22  * This allows the platform to provide one command and key binding for
23  * the "run to line" function to be shared by many debuggers.
24  * <p>
25  * When a part is activated, a retargettable action asks the part
26  * for its <code>IRunToLineTarget</code> adapter. If one exists,
27  * that adapter is delegated to to perform "run to line" operations when
28  * the user invokes an associated action. If an adapter does not exist
29  * for the part, the retargettable actions asks selected objects in the
30  * active part for an adapter. Generally, a debug implementation will
31  * provide breakpoint adapters for relevant editors and model objects.
32  * </p>
33  * <p>
34  * Clients are intended to implement this interface and provide instances as
35  * an adapter on applicable parts (for example, editors) that support the
36  * operation.
37  * </p>
38  * @since 3.0
39  */

40 public interface IRunToLineTarget {
41     
42     /**
43      * Perform a run to line operation on the given element that is
44      * currently selected and suspended in the Debug view. Implementations
45      * must honor the user preference of whether to skip breakpoints
46      * during the operation -
47      * see <code>IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE</code>.
48      *
49      * @param part the part on which the action has been invoked
50      * @param selection the selection on which the action has been invoked
51      * @param target suspended element to perform the "run to line" action on
52      * @throws CoreException if unable to perform the action
53      */

54     public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException;
55
56     /**
57      * Returns whether a run to line operation can be performed on the given
58      * element that is currently selected and suspended in the Debug view.
59      *
60      * @param part the part on which the action has been invoked
61      * @param selection the selection on which the action has been invoked
62      * @param target suspended element to perform the "run to line" action on
63      * @throws CoreException if unable to perform the action
64      */

65     public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target);
66 }
67
Popular Tags