Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 470e5cea23bca9d591f3772c0aeba353b9179fe9 (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
/*******************************************************************************
 * Copyright (c) 2005, 2007 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.jdt.internal.debug.core.refactoring;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.NullChange;

import com.ibm.icu.text.MessageFormat;

/**
 * A change to delete a breakpoint. Currently used for undo.
 * When undoing a refactoring, the "target/original" resource does
 * not exist in time to create a marker on it, and thus the operation
 * cannot be undone. Instead, we delete breakpoints on undo.
 * 
 * @since 3.2
 *
 */
public class DeleteBreakpointChange extends BreakpointChange {
	
	public DeleteBreakpointChange(IJavaBreakpoint breakpoint) throws CoreException {
		super(breakpoint);
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ltk.core.refactoring.Change#getName()
	 */
	public String getName() {
		return MessageFormat.format(RefactoringMessages.DeleteBreakpointChange_0,
				new String[] {getBreakpointLabel(getOriginalBreakpoint())});
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
	 */
	public Change perform(IProgressMonitor pm) throws CoreException {
		getOriginalBreakpoint().delete();
		return new NullChange();
	}

}

Back to the top