1 11 package org.eclipse.ltk.core.refactoring.participants; 12 13 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 14 15 24 public class ParticipantManager { 25 26 private ParticipantManager() { 27 } 29 30 32 private static final String RENAME_PARTICIPANT_EXT_POINT= "renameParticipants"; private static ParticipantExtensionPoint fgRenameInstance= 34 new ParticipantExtensionPoint("Rename", RENAME_PARTICIPANT_EXT_POINT, RenameParticipant.class); 36 49 public static RenameParticipant[] loadRenameParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, RenameArguments arguments, String [] affectedNatures, SharableParticipants shared) { 50 return loadRenameParticipants(status, processor, element, arguments, null, affectedNatures, shared); 51 } 52 53 70 public static RenameParticipant[] loadRenameParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, RenameArguments arguments, IParticipantDescriptorFilter filter, String [] affectedNatures, SharableParticipants shared) { 71 RefactoringParticipant[] participants= fgRenameInstance.getParticipants(status, processor, element, arguments, filter, affectedNatures, shared); 72 RenameParticipant[] result= new RenameParticipant[participants.length]; 73 System.arraycopy(participants, 0, result, 0, participants.length); 74 return result; 75 } 76 77 79 private static final String MOVE_PARTICIPANT_EXT_POINT= "moveParticipants"; private static ParticipantExtensionPoint fgMoveExtensions= 81 new ParticipantExtensionPoint("Move", MOVE_PARTICIPANT_EXT_POINT, MoveParticipant.class); 83 96 public static MoveParticipant[] loadMoveParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, MoveArguments arguments, String [] affectedNatures, SharableParticipants shared) { 97 return loadMoveParticipants(status, processor, element, arguments, null, affectedNatures, shared); 98 } 99 100 117 public static MoveParticipant[] loadMoveParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, MoveArguments arguments, IParticipantDescriptorFilter filter, String [] affectedNatures, SharableParticipants shared) { 118 RefactoringParticipant[] participants= fgMoveExtensions.getParticipants(status, processor, element, arguments, filter, affectedNatures, shared); 119 MoveParticipant[] result= new MoveParticipant[participants.length]; 120 System.arraycopy(participants, 0, result, 0, participants.length); 121 return result; 122 } 123 124 126 private static final String DELETE_PARTICIPANT_EXT_POINT= "deleteParticipants"; private static ParticipantExtensionPoint fgDeleteInstance= 128 new ParticipantExtensionPoint("Delete", DELETE_PARTICIPANT_EXT_POINT, DeleteParticipant.class); 130 142 public static DeleteParticipant[] loadDeleteParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, DeleteArguments arguments, String [] affectedNatures, SharableParticipants shared) { 143 return loadDeleteParticipants(status, processor, element, arguments, null, affectedNatures, shared); 144 } 145 146 162 public static DeleteParticipant[] loadDeleteParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, DeleteArguments arguments, IParticipantDescriptorFilter filter, String [] affectedNatures, SharableParticipants shared) { 163 RefactoringParticipant[] participants= fgDeleteInstance.getParticipants(status, processor, element, arguments, filter, affectedNatures, shared); 164 DeleteParticipant[] result= new DeleteParticipant[participants.length]; 165 System.arraycopy(participants, 0, result, 0, participants.length); 166 return result; 167 } 168 169 171 private static final String CREATE_PARTICIPANT_EXT_POINT= "createParticipants"; private static ParticipantExtensionPoint fgCreateInstance= 173 new ParticipantExtensionPoint("Create", CREATE_PARTICIPANT_EXT_POINT, CreateParticipant.class); 175 188 public static CreateParticipant[] loadCreateParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, CreateArguments arguments, String affectedNatures[], SharableParticipants shared) { 189 return loadCreateParticipants(status, processor, element, arguments, null, affectedNatures, shared); 190 } 191 192 209 public static CreateParticipant[] loadCreateParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, CreateArguments arguments, IParticipantDescriptorFilter filter, String affectedNatures[], SharableParticipants shared) { 210 RefactoringParticipant[] participants= fgCreateInstance.getParticipants(status, processor, element, arguments, filter, affectedNatures, shared); 211 CreateParticipant[] result= new CreateParticipant[participants.length]; 212 System.arraycopy(participants, 0, result, 0, participants.length); 213 return result; 214 } 215 216 218 private static final String COPY_PARTICIPANT_EXT_POINT= "copyParticipants"; private static ParticipantExtensionPoint fgCopyInstance= 220 new ParticipantExtensionPoint("Copy", COPY_PARTICIPANT_EXT_POINT, CopyParticipant.class); 222 237 public static CopyParticipant[] loadCopyParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, CopyArguments arguments, String affectedNatures[], SharableParticipants shared) { 238 return loadCopyParticipants(status, processor, element, arguments, null, affectedNatures, shared); 239 } 240 241 258 public static CopyParticipant[] loadCopyParticipants(RefactoringStatus status, RefactoringProcessor processor, Object element, CopyArguments arguments, IParticipantDescriptorFilter filter, String affectedNatures[], SharableParticipants shared) { 259 RefactoringParticipant[] participants= fgCopyInstance.getParticipants(status, processor, element, arguments, filter, affectedNatures, shared); 260 CopyParticipant[] result= new CopyParticipant[participants.length]; 261 System.arraycopy(participants, 0, result, 0, participants.length); 262 return result; 263 } 264 } | Popular Tags |