Class ModuleProjectRenameParticipant
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
org.eclipse.ltk.core.refactoring.participants.RenameParticipant
com.iizigo.project.refactor.ModuleProjectRenameParticipant
- All Implemented Interfaces:
IAdaptable
The rename participant of an IIZI Module project: a project is renamed on a quiet, saved workspace (the owner's ruling of 2026-10-14 00:35, CC-FIX-IIZIGO-G4-PROJECT-LIFECYCLE). It changes nothing in the rename itself; its conditions make sure that nothing of the project waits to be written after the rename's operation:
- No editor of a file of the project holds unsaved changes, or the rename is refused with a message naming them. The Refactor > Rename of a Java project saves every modified editor before its wizard opens (JDT's
RenameJavaProjectProcessor.getSaveMode()isSAVE_ALL, applied by JDT'sRefactoringSaveHelper, which asks unless "always save" is set), so the refusal is what the other paths meet: LTK's resource rename, and a rename run by code. - The project's preferences and its IIZI Module settings are written now when they hold unsaved changes: a pending "Save Module project settings" job would write the settings into the project of the old name after the rename.
- IIZI's jobs of the project (the jobs whose family is the project) are waited for, never on the UI thread, under the refactoring's progress monitor, which can cancel the wait. The refactoring wizard checks the conditions under the workspace root rule, which it acquires under its progress dialog, so builds, refreshes and every other job holding a rule have ended before this check runs. A job of the project that cannot run while the rename holds its rule, or one still running when the wait ends, refuses the rename with a message naming it.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptioncheckConditions(IProgressMonitor pm, CheckConditionsContext context) Checks that the project can be renamed now: no unsaved editor of the project, its settings written, and IIZI's jobs of the project ended.The participant changes nothing in the rename.getDirtyEditors(IProject project) Gets the editors of the workbench that hold unsaved changes of a file of a project, in the UI thread.getName()Returns the name of the participant.protected booleaninitialize(Object element) Initializes the participant for an open Module project.Methods inherited from class RenameParticipant
getArguments, initializeMethods inherited from class RefactoringParticipant
createPreChange, getProcessor, getTextChange, initializeMethods inherited from class PlatformObject
getAdapter
Constructor Details
ModuleProjectRenameParticipant
public ModuleProjectRenameParticipant()
Method Details
initialize
Initializes the participant for an open Module project.- Specified by:
initializein classRefactoringParticipant- Parameters:
element- The element the rename applies to.- Returns:
- true for an open project of the IIZI Module nature, false otherwise.
getName
Returns the name of the participant.- Specified by:
getNamein classRefactoringParticipant- Returns:
- The name.
checkConditions
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException Checks that the project can be renamed now: no unsaved editor of the project, its settings written, and IIZI's jobs of the project ended.- Specified by:
checkConditionsin classRefactoringParticipant- Parameters:
pm- The progress monitor, which cancels the wait for IIZI's jobs.context- The condition checking context.- Returns:
- The status: OK, or a FATAL error that refuses the rename with its message.
- Throws:
OperationCanceledException- If the monitor is cancelled while IIZI's jobs are waited for.
createChange
The participant changes nothing in the rename.- Specified by:
createChangein classRefactoringParticipant- Parameters:
pm- The progress monitor.- Returns:
- null: no change.
getDirtyEditors