Class RefactoringUIHelper


  • public final class RefactoringUIHelper
    extends Object
    The utility class for refactoring operations.
    • Constructor Detail

      • RefactoringUIHelper

        public RefactoringUIHelper()
    • Method Detail

      • performExclusiveOperation

        public static <T extends org.eclipse.emf.ecore.EObject> void performExclusiveOperation​(String operationName,
                                                                                               Collection<T> objects,
                                                                                               Runnable operation)
        Performs the exclusive refactoring operation.
        Parameters:
        operationName - the oepration name, cannot be null.
        objects - the objects is affected by the operation, cannot be null or empty.
        operation - the refactoring operation, cannot be null.
      • initiateRefactoringWithProgress

        public static IRefactoring initiateRefactoringWithProgress​(Supplier<IRefactoring> refactoringSupplier)
        Performs refactoring initiating with progress displaying.
        Parameters:
        refactoringSupplier - the refactoring supplier, cannot be null.
        Returns:
        IRefactoring instance produced by given refactoring supplier.
      • initiateRefactoringsWithProgress

        public static Collection<IRefactoring> initiateRefactoringsWithProgress​(Supplier<Collection<IRefactoring>> refactoringSupplier)
        Performs refactoring initiating with progress displaying.
        Parameters:
        refactoringSupplier - the refactoring supplier, cannot be null.
        Returns:
        IRefactoring instance produced by given refactoring supplier.
      • openRenameWizardFor

        public static void openRenameWizardFor​(IRefactoring refactoring)
        Opens the rename refactoring wizard for the specified refactoring instance.
        Parameters:
        refactoring - the refactoring, cannot be null.
      • openRenameWizardFor

        public static void openRenameWizardFor​(Collection<IRefactoring> refactorings)
        Opens the rename refactoring wizard for the specified refactoring instances.
        Parameters:
        refactorings - the refactorings, cannot be null.
      • openDeleteWizardFor

        public static void openDeleteWizardFor​(IRefactoring refactoring,
                                               Collection<? extends org.eclipse.emf.ecore.EObject> objects)
        Opens the delete refactoring wizard for the specified refactoring instance.
        Parameters:
        refactoring - the refactoring, cannot be null.
        objects - the objects being deleted, cannot be null.
      • askForResourceSaving

        public static boolean askForResourceSaving​(Collection<? extends org.eclipse.emf.ecore.EObject> objects)
        Asks the user for resource saving.
        Parameters:
        objects - the objects being refactored, cannot be null.