Class ModuleProjectDeleteParticipant
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
org.eclipse.ltk.core.refactoring.participants.DeleteParticipant
com.iizigo.project.refactor.ModuleProjectDeleteParticipant
- All Implemented Interfaces:
IAdaptable, ISharableParticipant
public class ModuleProjectDeleteParticipant extends DeleteParticipant implements ISharableParticipant
The delete participant of an IIZI Module project: no change of a project that stays on disk is lost at its Delete (the owner's ruling of 2026-11-18, CC-FIX-UNSAVED-EVERY-CLOSE). It changes nothing in the delete itself.
Eclipse's Delete of a project asks "Delete project contents on disk" and hands the answer to its participants before anything is deleted:
- The contents are KEPT (the project is only removed from the workspace): every changed file of the project, with or without an editor, is offered in the workbench's "Save Resources" prompt, all checked (
UnsavedFiles.askBeforeRefactoring). The chosen files are saved, then the delete goes on. Cancel stops the delete: the dialog of the Delete stays open, nothing is deleted. - The contents are DELETED: nothing is asked. What is not saved goes with the files.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidaddElement(Object element, RefactoringArguments arguments) Adds another element of the same Delete.checkConditions(IProgressMonitor pm, CheckConditionsContext context) Asks for the changed files of the projects that stay on disk and saves the chosen ones; tells the projects that are deleted with their contents, for which nothing is asked, kept or logged.The participant changes nothing in the delete.getName()Returns the name of the participant.protected booleaninitialize(Object element) Initializes the participant for an open Module project.Methods inherited from class DeleteParticipant
getArguments, initializeMethods inherited from class RefactoringParticipant
createPreChange, getProcessor, getTextChange, initializeMethods inherited from class PlatformObject
getAdapter
Constructor Details
ModuleProjectDeleteParticipant
public ModuleProjectDeleteParticipant()
Method Details
initialize
Initializes the participant for an open Module project.- Specified by:
initializein classRefactoringParticipant- Parameters:
element- The element the delete applies to.- Returns:
- true for an open project of the IIZI Module nature, false otherwise.
addElement
Adds another element of the same Delete.- Specified by:
addElementin interfaceISharableParticipant- Parameters:
element- The element.arguments- The arguments of its delete.
getName
Returns the name of the participant.- Specified by:
getNamein classRefactoringParticipant- Returns:
- The name.
checkConditions
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException Asks for the changed files of the projects that stay on disk and saves the chosen ones; tells the projects that are deleted with their contents, for which nothing is asked, kept or logged.- Specified by:
checkConditionsin classRefactoringParticipant- Parameters:
pm- The progress monitor.context- The condition checking context.- Returns:
- The status: OK.
- Throws:
OperationCanceledException- If the user canceled the question: nothing is deleted.
createChange
The participant changes nothing in the delete.- Specified by:
createChangein classRefactoringParticipant- Parameters:
pm- The progress monitor.- Returns:
- null: no change.