/
MakePointFreeProcessor.java
79 lines (65 loc) · 2.65 KB
/
MakePointFreeProcessor.java
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright (c) 2007 by Leif Frenzel <himself@leiffrenzel.de>
// All rights reserved.
package net.sf.eclipsefp.haskell.core.internal.refactoring;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
/** <p>The processor is where the work is delegated to if participants are
* involved. The processor loads the participants and manages the lifecycle
* of the refactoring. In order to do that, the refactoring entry point
* methods must be implemented.</p>
*
* @author Leif Frenzel
*/
public class MakePointFreeProcessor extends RefactoringProcessor {
private final MakePointFreeDelegate delegate;
public MakePointFreeProcessor( final MakePointFreeInfo info ) {
delegate = new MakePointFreeDelegate( info );
}
// interface methods of RefactoringProcessor
////////////////////////////////////////////
@Override
public Object[] getElements() {
return new Object[] { CoreTexts.mkPointFreeProcessor_elem };
}
@Override
public String getIdentifier() {
return getClass().getName();
}
@Override
public String getProcessorName() {
return CoreTexts.mkPointFreeProcessor_name;
}
@Override
public boolean isApplicable() {
return true;
}
@Override
public RefactoringStatus checkInitialConditions( final IProgressMonitor pm ) {
return delegate.checkInitialConditions();
}
@Override
public RefactoringStatus checkFinalConditions(
final IProgressMonitor pm, final CheckConditionsContext context ) {
return delegate.checkFinalConditions( pm, context );
}
@Override
public Change createChange( final IProgressMonitor pm ) {
CompositeChange result = new CompositeChange( getProcessorName() );
delegate.createChange( pm, result );
return result;
}
@Override
public RefactoringParticipant[] loadParticipants(
final RefactoringStatus status,
final SharableParticipants sharedParticipants ) {
// This would be the place to load the participants via the
// ParticipantManager and decide which of them are allowed to participate.
return new RefactoringParticipant[ 0 ];
}
}