KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > refactoring > MethodBreakpointChange


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 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.jdt.internal.debug.core.refactoring;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.jdt.debug.core.IJavaMethodBreakpoint;
15
16 /**
17  * Specialization of breakpoint change for method breakpoints
18  * @since 3.2
19  */

20 public abstract class MethodBreakpointChange extends LineBreakpointChange {
21     
22     private String JavaDoc fMethodName, fSignature;
23     private boolean fEntry, fExit, fNativeOnly;
24
25     /**
26      * Constructor
27      * @param breakpoint
28      * @throws CoreException
29      */

30     public MethodBreakpointChange(IJavaMethodBreakpoint breakpoint) throws CoreException {
31         super(breakpoint);
32         fMethodName = breakpoint.getMethodName();
33         fSignature = breakpoint.getMethodSignature();
34         fEntry = breakpoint.isEntry();
35         fExit = breakpoint.isExit();
36         fNativeOnly = breakpoint.isNativeOnly();
37     }
38     
39     /**
40      * Returns the name of the method
41      * @return the name of the method
42      */

43     protected String JavaDoc getMethodName() {
44         return fMethodName;
45     }
46     
47     /**
48      * Returns the signature of the method
49      * @return the signature of the method
50      */

51     protected String JavaDoc getSignature() {
52         return fSignature;
53     }
54     
55     /**
56      * Returns if it is an entry breakpoint
57      * @return if it is an entry breakpoint
58      */

59     protected boolean isEntry() {
60         return fEntry;
61     }
62     
63     /**
64      * Returns if it is an exit breakpoint
65      * @return if it is an exit breakpoint
66      */

67     protected boolean isExit() {
68         return fExit;
69     }
70     
71     /**
72      * Returns if it is native only
73      * @return if it is native only
74      */

75     protected boolean isNativeOnly() {
76         return fNativeOnly;
77     }
78
79     /**
80      * Applies the old settings to the new breakpoint
81      * @param breakpoint
82      * @throws CoreException
83      */

84     protected void apply(IJavaMethodBreakpoint breakpoint) throws CoreException {
85         super.apply(breakpoint);
86         breakpoint.setEntry(fEntry);
87         breakpoint.setExit(fExit);
88         breakpoint.setNativeOnly(fNativeOnly);
89     }
90     
91 }
92
Popular Tags