KickJava   Java API By Example, From Geeks To Geeks.

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


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.IJavaLineBreakpoint;
15
16 /**
17  * Specialization of a {@link BreakpointChange}
18  * @since 3.2
19  */

20 public abstract class LineBreakpointChange extends BreakpointChange {
21     
22     private int fCharEnd, fCharStart, fLineNumber;
23     private boolean fConditionEnabled, fConditionSuspendOnTrue;
24     private String JavaDoc fCondition;
25
26     /**
27      * Constructor
28      * @param breakpoint
29      * @throws CoreException
30      */

31     public LineBreakpointChange(IJavaLineBreakpoint breakpoint) throws CoreException {
32         super(breakpoint);
33         fCharEnd = breakpoint.getCharEnd();
34         fCharStart = breakpoint.getCharStart();
35         fLineNumber = breakpoint.getLineNumber();
36         if (breakpoint.supportsCondition()) {
37             fCondition = breakpoint.getCondition();
38             fConditionEnabled = breakpoint.isConditionEnabled();
39             fConditionSuspendOnTrue = breakpoint.isConditionSuspendOnTrue();
40         }
41     }
42
43     /**
44      * Applies the original attributes to the new breakpoint
45      * @param breakpoint
46      * @throws CoreException
47      */

48     protected void apply(IJavaLineBreakpoint breakpoint) throws CoreException {
49         super.apply(breakpoint);
50         if (breakpoint.supportsCondition()) {
51             breakpoint.setCondition(fCondition);
52             breakpoint.setConditionEnabled(fConditionEnabled);
53             breakpoint.setConditionSuspendOnTrue(fConditionSuspendOnTrue);
54         }
55     }
56
57     /**
58      * @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointChange#getLineNumber()
59      */

60     protected int getLineNumber() {
61         return fLineNumber;
62     }
63     
64     /**
65      * Returns the char end attribute of the underlying line breakpoint
66      * @return the char end attribute of the underlying line breakpoint
67      */

68     protected int getCharEnd() {
69         return fCharEnd;
70     }
71     
72     /**
73      * Returns the char start attribute of the underlying line breakpoint
74      * @return the char start attribute of the underlying line breakpoint
75      */

76     protected int getCharStart() {
77         return fCharStart;
78     }
79
80 }
81
Popular Tags