KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.runtime.OperationCanceledException;
16 import org.eclipse.jdt.core.IPackageFragment;
17 import org.eclipse.jdt.core.IPackageFragmentRoot;
18 import org.eclipse.ltk.core.refactoring.Change;
19 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
20 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
21 import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
22
23
24 /**
25  * Participant for IPackageFragment move.
26  */

27 public class JavaBreakpointIPackageFragmentMoveParticipant extends MoveParticipant {
28
29     private IPackageFragment fPackage;
30     
31     private IPackageFragmentRoot fDestination;
32     
33     /* (non-Javadoc)
34      * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
35      */

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

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

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

63     public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
64         return JavaBreakpointTypeChange.createChangesForPackageMove(fPackage, fDestination);
65     }
66
67 }
68
Popular Tags