1 // Copyright (c) 2005 by Leif Frenzel. All rights reserved.
2 // See http://leiffrenzel.de
3 // modified for phpeclipse.de project by axelcl
4 package net.sourceforge.phpdt.ltk.core;
6 import org.eclipse.core.runtime.*;
7 import org.eclipse.ltk.core.refactoring.*;
8 import org.eclipse.ltk.core.refactoring.participants.*;
10 /** <p>The processor is where the work is delegated to if participants are
11 * involved. The processor loads the participants and manages the lifecycle
12 * of the refactoring. In order to do that, the refactoring entry point
13 * methods must be implemented.</p>
15 * @author Leif Frenzel
17 public class RenamePropertyProcessor extends RefactoringProcessor {
19 private final RenamePropertyInfo info;
20 private final RenamePropertyDelegate delegate;
22 public RenamePropertyProcessor( final RenamePropertyInfo info ) {
24 delegate = new RenamePropertyDelegate( info );
28 // interface methods of RefactoringProcessor
29 ////////////////////////////////////////////
31 public Object[] getElements() {
32 // usually, this would be some element object in the object model on which
33 // we work (e.g. a Java element if we were in the Java Model); in this case
34 // we have only the property name
35 return new Object[] { info.getOldName() };
38 public String getIdentifier() {
39 return getClass().getName();
42 public String getProcessorName() {
43 return CoreTexts.renamePropertyProcessor_name;
46 public boolean isApplicable() throws CoreException {
50 public RefactoringStatus checkInitialConditions( final IProgressMonitor pm ) {
51 return delegate.checkInitialConditions();
54 public RefactoringStatus checkFinalConditions(
55 final IProgressMonitor pm, final CheckConditionsContext context ) {
56 return delegate.checkFinalConditions( pm, context );
59 public Change createChange( final IProgressMonitor pm ) {
60 CompositeChange result = new CompositeChange( getProcessorName() );
61 delegate.createChange( pm, result );
65 public RefactoringParticipant[] loadParticipants(
66 final RefactoringStatus status,
67 final SharableParticipants sharedParticipants ) {
68 // This would be the place to load the participants via the
69 // ParticipantManager and decide which of them are allowed to participate.
70 return new RefactoringParticipant[ 0 ];