Class ModuleProjectRenameParticipant

All Implemented Interfaces:
IAdaptable

public class ModuleProjectRenameParticipant extends RenameParticipant
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:
  1. 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() is SAVE_ALL, applied by JDT's RefactoringSaveHelper, 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.
  2. 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.
  3. 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 Details

    • ModuleProjectRenameParticipant

      public ModuleProjectRenameParticipant()
  • Method Details

    • initialize

      protected boolean initialize(Object element)
      Initializes the participant for an open Module project.
      Specified by:
      initialize in class RefactoringParticipant
      Parameters:
      element - The element the rename applies to.
      Returns:
      true for an open project of the IIZI Module nature, false otherwise.
    • getName

      public String getName()
      Returns the name of the participant.
      Specified by:
      getName in class RefactoringParticipant
      Returns:
      The name.
    • checkConditions

      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:
      checkConditions in class RefactoringParticipant
      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

      public Change createChange(IProgressMonitor pm)
      The participant changes nothing in the rename.
      Specified by:
      createChange in class RefactoringParticipant
      Parameters:
      pm - The progress monitor.
      Returns:
      null: no change.
    • getDirtyEditors

      public static List<String> getDirtyEditors(IProject project)
      Gets the editors of the workbench that hold unsaved changes of a file of a project, in the UI thread.
      Parameters:
      project - The project.
      Returns:
      The titles of the editors with the file's project-relative path, empty for none.