KickJava   Java API By Example, From Geeks To Geeks.

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


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.jface.viewers.ISelection;
15 import org.eclipse.ui.IWorkbenchPart;
16
17 /**
18  * An adapter to support breakpoint creation/deletion for an active part
19  * or selection within an active part. The debug platform provides
20  * retargettable actions for toggling line breakpoints, method breakpoints,
21  * and watchpoints. A debug implementation can plug into the global actions
22  * by providing an adapter of this type on relevant parts and objects.
23  * The debug platform provides one command and key binding for each breakpoint
24  * operation.
25  * <p>
26  * When a part is activated, a retargettable action asks the part
27  * for its <code>IToggleBreakpointTarget</code> adapter. If one exists,
28  * that adapter is delegated to to perform breakpoint operations when
29  * the user invokes an associated action. If an adapter does not exist
30  * for the part, the retargettable actions asks selected objects in the
31  * active part for an adapter. Generally, a debug implementation will
32  * provide breakpoint adapters for relevant editors and model objects.
33  * </p>
34  * <p>
35  * Clients are intended to implement this interface and provide instances as
36  * an adapter on applicable parts (for example, editors) and objects (for
37  * example, methods and fields) that support breakpoint toggling.
38  * </p>
39  * @since 3.0
40  */

41 public interface IToggleBreakpointsTarget {
42     
43     /**
44      * Creates new line breakpoints or removes existing breakpoints.
45      * The selection varies depending on the given part. For example,
46      * a text selection is provided for text editors, and a structured
47      * selection is provided for tree views, and may be a multi-selection.
48      *
49      * @param part the part on which the action has been invoked
50      * @param selection selection on which line breakpoints should be toggled
51      * @throws CoreException if unable to perform the action
52      */

53     public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
54     
55     /**
56      * Returns whether line breakpoints can be toggled on the given selection.
57      * The selection varies depending on the given part. For example,
58      * a text selection is provided for text editors, and a structured
59      * selection is provided for tree views, and may be a multi-selection.
60      *
61      * @param part the part on which the action has been invoked
62      * @param selection selection on which line breakpoints may be toggled
63      * @return whether line breakpoints can be toggled on the given selection
64      */

65     public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection);
66
67     /**
68      * Creates new method breakpoints or removes existing breakpoints.
69      * The selection varies depending on the given part. For example,
70      * a text selection is provided for text editors, and a structured
71      * selection is provided for tree views, and may be a multi-selection.
72      *
73      * @param part the part on which the action has been invoked
74      * @param selection selection on which method breakpoints should be toggled
75      * @throws CoreException if unable to perform the action
76      */

77     public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
78     
79     /**
80      * Returns whether method breakpoints can be toggled on the given selection.
81      * The selection varies depending on the given part. For example,
82      * a text selection is provided for text editors, and a structured
83      * selection is provided for tree views, and may be a multi-selection.
84      *
85      * @param part the part on which the action has been invoked
86      * @param selection selection on which method breakpoints may be toggled
87      * @return whether method breakpoints can be toggled on the given selection
88      */

89     public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection);
90     
91     /**
92      * Creates new watchpoints or removes existing breakpoints.
93      * The selection varies depending on the given part. For example,
94      * a text selection is provided for text editors, and a structured
95      * selection is provided for tree views, and may be a multi-selection.
96      *
97      * @param part the part on which the action has been invoked
98      * @param selection selection on which watchpoints should be toggled
99      * @throws CoreException if unable to perform the action
100      */

101     public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
102     
103     /**
104      * Returns whether watchpoints can be toggled on the given selection.
105      * The selection varies depending on the given part. For example,
106      * a text selection is provided for text editors, and a structured
107      * selection is provided for tree views, and may be a multi-selection.
108      *
109      * @param part the part on which the action has been invoked
110      * @param selection selection on which watchpoints may be toggled
111      * @return whether watchpoints can be toggled on the given selection
112      */

113     public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection);
114 }
115
Popular Tags