KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.core.runtime.IProgressMonitor;
15 import org.eclipse.jdt.core.IPackageFragment;
16 import org.eclipse.jdt.core.IType;
17 import org.eclipse.ltk.core.refactoring.Change;
18 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
19 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
20 import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
21
22
23 /**
24  * Participant for IType move.
25  */

26 public class JavaBreakpointITypeMoveParticipant extends MoveParticipant {
27     
28     private IType fType;
29     private Object JavaDoc fDestination;
30
31     /* (non-Javadoc)
32      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
33      */

34     protected boolean initialize(Object JavaDoc element) {
35         fType= (IType) element;
36         fDestination= getArguments().getDestination();
37         if (fDestination instanceof IPackageFragment || fDestination instanceof IType) {
38             return true;
39         }
40         return false;
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
45      */

46     public String JavaDoc getName() {
47         return RefactoringMessages.JavaBreakpointITypeMoveParticipant_0; //$NON-NLS-1$
48
}
49
50     /* (non-Javadoc)
51      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
52      */

53     public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
54         return new RefactoringStatus();
55     }
56
57     /* (non-Javadoc)
58      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
59      */

60     public Change createChange(IProgressMonitor pm) throws CoreException {
61         return JavaBreakpointTypeChange.createChangesForTypeMove(fType, fDestination);
62     }
63
64 }
65
Popular Tags