KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > refactoring > DeleteTypeParticipant


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso.refactoring;
5
6 import org.eclipse.core.runtime.IProgressMonitor;
7 import org.eclipse.core.runtime.OperationCanceledException;
8 import org.eclipse.jdt.core.IType;
9 import org.eclipse.ltk.core.refactoring.Change;
10 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
11 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
12 import org.eclipse.ltk.core.refactoring.participants.DeleteParticipant;
13
14 public class DeleteTypeParticipant extends DeleteParticipant {
15   private IType fType;
16
17   public RefactoringStatus checkConditions(IProgressMonitor pm,
18                                            CheckConditionsContext context)
19     throws OperationCanceledException
20   {
21     return new RefactoringStatus();
22   }
23
24   public Change createChange(IProgressMonitor pm)
25     throws OperationCanceledException
26   {
27     return createChangesForTypeDelete(fType);
28   }
29
30   public String JavaDoc getName() {
31     return "TCDeleteTypeChange";
32   }
33
34   protected boolean initialize(Object JavaDoc element) {
35     fType = (IType)element;
36     return true;
37   }
38
39   public static Change createChangesForTypeDelete(IType type) {
40     return new DeleteTypeChange(type);
41   }
42 }
43
Popular Tags