Search in sources :

Example 1 with DeleteArguments

use of org.eclipse.ltk.core.refactoring.participants.DeleteArguments in project che by eclipse.

the class ResourceModifications method getParticipants.

public RefactoringParticipant[] getParticipants(RefactoringStatus status, RefactoringProcessor processor, String[] natures, SharableParticipants shared) {
    List<RefactoringParticipant> result = new ArrayList<RefactoringParticipant>(5);
    if (fDelete != null) {
        DeleteArguments arguments = new DeleteArguments();
        for (Iterator<IResource> iter = fDelete.iterator(); iter.hasNext(); ) {
            DeleteParticipant[] deletes = ParticipantManager.loadDeleteParticipants(status, processor, iter.next(), arguments, natures, shared);
            result.addAll(Arrays.asList(deletes));
        }
    }
    if (fCreate != null) {
        CreateArguments arguments = new CreateArguments();
        for (Iterator<IResource> iter = fCreate.iterator(); iter.hasNext(); ) {
            CreateParticipant[] creates = ParticipantManager.loadCreateParticipants(status, processor, iter.next(), arguments, natures, shared);
            result.addAll(Arrays.asList(creates));
        }
    }
    if (fMove != null) {
        for (int i = 0; i < fMove.size(); i++) {
            Object element = fMove.get(i);
            MoveArguments arguments = fMoveArguments.get(i);
            MoveParticipant[] moves = ParticipantManager.loadMoveParticipants(status, processor, element, arguments, natures, shared);
            result.addAll(Arrays.asList(moves));
        }
    }
    if (fCopy != null) {
        for (int i = 0; i < fCopy.size(); i++) {
            Object element = fCopy.get(i);
            CopyArguments arguments = fCopyArguments.get(i);
            CopyParticipant[] copies = ParticipantManager.loadCopyParticipants(status, processor, element, arguments, natures, shared);
            result.addAll(Arrays.asList(copies));
        }
    }
    if (fRename != null) {
        for (int i = 0; i < fRename.size(); i++) {
            Object resource = fRename.get(i);
            RenameArguments arguments = fRenameArguments.get(i);
            RenameParticipant[] renames = ParticipantManager.loadRenameParticipants(status, processor, resource, arguments, natures, shared);
            result.addAll(Arrays.asList(renames));
        }
    }
    return result.toArray(new RefactoringParticipant[result.size()]);
}
Also used : RefactoringParticipant(org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant) RenameArguments(org.eclipse.ltk.core.refactoring.participants.RenameArguments) ArrayList(java.util.ArrayList) MoveParticipant(org.eclipse.ltk.core.refactoring.participants.MoveParticipant) DeleteParticipant(org.eclipse.ltk.core.refactoring.participants.DeleteParticipant) CreateArguments(org.eclipse.ltk.core.refactoring.participants.CreateArguments) DeleteArguments(org.eclipse.ltk.core.refactoring.participants.DeleteArguments) CopyArguments(org.eclipse.ltk.core.refactoring.participants.CopyArguments) CreateParticipant(org.eclipse.ltk.core.refactoring.participants.CreateParticipant) CopyParticipant(org.eclipse.ltk.core.refactoring.participants.CopyParticipant) MoveArguments(org.eclipse.ltk.core.refactoring.participants.MoveArguments) RenameParticipant(org.eclipse.ltk.core.refactoring.participants.RenameParticipant) IResource(org.eclipse.core.resources.IResource)

Example 2 with DeleteArguments

use of org.eclipse.ltk.core.refactoring.participants.DeleteArguments in project che by eclipse.

the class DeleteResourcesProcessor method loadParticipants.

/* (non-Javadoc)
	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
	 */
public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
    final ArrayList result = new ArrayList();
    if (!isApplicable()) {
        return new RefactoringParticipant[0];
    }
    final String[] affectedNatures = ResourceProcessors.computeAffectedNatures(fResources);
    final DeleteArguments deleteArguments = new DeleteArguments(fDeleteContents);
    for (int i = 0; i < fResources.length; i++) {
        result.addAll(Arrays.asList(ParticipantManager.loadDeleteParticipants(status, this, fResources[i], deleteArguments, affectedNatures, sharedParticipants)));
    }
    return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
}
Also used : RefactoringParticipant(org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant) DeleteArguments(org.eclipse.ltk.core.refactoring.participants.DeleteArguments) ArrayList(java.util.ArrayList)

Example 3 with DeleteArguments

use of org.eclipse.ltk.core.refactoring.participants.DeleteArguments in project che by eclipse.

the class ResourceModifications method getParticipants.

public RefactoringParticipant[] getParticipants(RefactoringStatus status, RefactoringProcessor processor, String[] natures, SharableParticipants shared) {
    List result = new ArrayList(5);
    if (fDelete != null) {
        DeleteArguments arguments = new DeleteArguments();
        for (Iterator iter = fDelete.iterator(); iter.hasNext(); ) {
            DeleteParticipant[] deletes = ParticipantManager.loadDeleteParticipants(status, processor, iter.next(), arguments, natures, shared);
            result.addAll(Arrays.asList(deletes));
        }
    }
    if (fCreate != null) {
        CreateArguments arguments = new CreateArguments();
        for (Iterator iter = fCreate.iterator(); iter.hasNext(); ) {
            CreateParticipant[] creates = ParticipantManager.loadCreateParticipants(status, processor, iter.next(), arguments, natures, shared);
            result.addAll(Arrays.asList(creates));
        }
    }
    if (fMove != null) {
        for (int i = 0; i < fMove.size(); i++) {
            Object element = fMove.get(i);
            MoveArguments arguments = (MoveArguments) fMoveArguments.get(i);
            MoveParticipant[] moves = ParticipantManager.loadMoveParticipants(status, processor, element, arguments, natures, shared);
            result.addAll(Arrays.asList(moves));
        }
    }
    if (fCopy != null) {
        for (int i = 0; i < fCopy.size(); i++) {
            Object element = fCopy.get(i);
            CopyArguments arguments = (CopyArguments) fCopyArguments.get(i);
            CopyParticipant[] copies = ParticipantManager.loadCopyParticipants(status, processor, element, arguments, natures, shared);
            result.addAll(Arrays.asList(copies));
        }
    }
    if (fRename != null) {
        for (int i = 0; i < fRename.size(); i++) {
            Object resource = fRename.get(i);
            RenameArguments arguments = (RenameArguments) fRenameArguments.get(i);
            RenameParticipant[] renames = ParticipantManager.loadRenameParticipants(status, processor, resource, arguments, natures, shared);
            result.addAll(Arrays.asList(renames));
        }
    }
    return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
}
Also used : RenameArguments(org.eclipse.ltk.core.refactoring.participants.RenameArguments) RefactoringParticipant(org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant) ArrayList(java.util.ArrayList) MoveParticipant(org.eclipse.ltk.core.refactoring.participants.MoveParticipant) DeleteParticipant(org.eclipse.ltk.core.refactoring.participants.DeleteParticipant) CreateArguments(org.eclipse.ltk.core.refactoring.participants.CreateArguments) DeleteArguments(org.eclipse.ltk.core.refactoring.participants.DeleteArguments) CopyArguments(org.eclipse.ltk.core.refactoring.participants.CopyArguments) CreateParticipant(org.eclipse.ltk.core.refactoring.participants.CreateParticipant) CopyParticipant(org.eclipse.ltk.core.refactoring.participants.CopyParticipant) MoveArguments(org.eclipse.ltk.core.refactoring.participants.MoveArguments) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) RenameParticipant(org.eclipse.ltk.core.refactoring.participants.RenameParticipant)

Aggregations

ArrayList (java.util.ArrayList)3 DeleteArguments (org.eclipse.ltk.core.refactoring.participants.DeleteArguments)3 RefactoringParticipant (org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant)3 CopyArguments (org.eclipse.ltk.core.refactoring.participants.CopyArguments)2 CopyParticipant (org.eclipse.ltk.core.refactoring.participants.CopyParticipant)2 CreateArguments (org.eclipse.ltk.core.refactoring.participants.CreateArguments)2 CreateParticipant (org.eclipse.ltk.core.refactoring.participants.CreateParticipant)2 DeleteParticipant (org.eclipse.ltk.core.refactoring.participants.DeleteParticipant)2 MoveArguments (org.eclipse.ltk.core.refactoring.participants.MoveArguments)2 MoveParticipant (org.eclipse.ltk.core.refactoring.participants.MoveParticipant)2 RenameArguments (org.eclipse.ltk.core.refactoring.participants.RenameArguments)2 RenameParticipant (org.eclipse.ltk.core.refactoring.participants.RenameParticipant)2 Iterator (java.util.Iterator)1 List (java.util.List)1 IResource (org.eclipse.core.resources.IResource)1