KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > reorg > IReorgPolicy


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.corext.refactoring.reorg;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 import org.eclipse.core.resources.IResource;
17
18 import org.eclipse.ltk.core.refactoring.Change;
19 import org.eclipse.ltk.core.refactoring.ChangeDescriptor;
20 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
21 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
22 import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
23 import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
24 import org.eclipse.ltk.core.refactoring.participants.ReorgExecutionLog;
25 import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
26
27 import org.eclipse.jdt.core.IJavaElement;
28 import org.eclipse.jdt.core.JavaModelException;
29
30 import org.eclipse.jdt.internal.corext.refactoring.tagging.IQualifiedNameUpdating;
31 import org.eclipse.jdt.internal.corext.refactoring.tagging.IReferenceUpdating;
32 import org.eclipse.jdt.internal.corext.refactoring.tagging.IScriptableRefactoring;
33
34 public interface IReorgPolicy extends IReferenceUpdating, IQualifiedNameUpdating, IScriptableRefactoring {
35
36     public ChangeDescriptor getDescriptor();
37
38     public RefactoringStatus checkFinalConditions(IProgressMonitor monitor, CheckConditionsContext context, IReorgQueries queries) throws CoreException;
39     public RefactoringStatus setDestination(IResource resource) throws JavaModelException;
40     public RefactoringStatus setDestination(IJavaElement javaElement) throws JavaModelException;
41     
42     public boolean canEnable() throws JavaModelException;
43     public boolean canChildrenBeDestinations(IResource resource);
44     public boolean canChildrenBeDestinations(IJavaElement javaElement);
45     public boolean canElementBeDestination(IResource resource);
46     public boolean canElementBeDestination(IJavaElement javaElement);
47     
48     public IResource[] getResources();
49     public IJavaElement[] getJavaElements();
50     
51     public IResource getResourceDestination();
52     public IJavaElement getJavaElementDestination();
53     
54     public boolean hasAllInputSet();
55
56     public boolean canUpdateReferences();
57     public boolean canUpdateQualifiedNames();
58     
59     public RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor processor, String JavaDoc[] natures, SharableParticipants shared) throws CoreException;
60     
61     public String JavaDoc getPolicyId();
62
63     public static interface ICopyPolicy extends IReorgPolicy{
64         public Change createChange(IProgressMonitor monitor, INewNameQueries queries) throws JavaModelException;
65         public ReorgExecutionLog getReorgExecutionLog();
66     }
67     public static interface IMovePolicy extends IReorgPolicy{
68         public Change createChange(IProgressMonitor monitor) throws JavaModelException;
69         public Change postCreateChange(Change[] participantChanges, IProgressMonitor monitor) throws CoreException;
70         public ICreateTargetQuery getCreateTargetQuery(ICreateTargetQueries createQueries);
71         public boolean isTextualMove();
72         public CreateTargetExecutionLog getCreateTargetExecutionLog();
73         public void setDestinationCheck(boolean check);
74     }
75 }
76
Popular Tags