Class CustomRenameSupport

  • All Implemented Interfaces:
    org.eclipse.xtext.ui.refactoring.ui.IRenameSupport

    public class CustomRenameSupport
    extends org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport
    Uses shell from current display instead of editor's shell from refactoring context. Waits for auto-build and reconciler jobs before refactoring is started.

    Note: You should override DefaultRenameSupport in your language guice module to enable usage of this controller.

    • Constructor Detail

      • CustomRenameSupport

        public CustomRenameSupport()
    • Method Detail

      • startRefactoringWithDialog

        public void startRefactoringWithDialog​(boolean previewOnly)
                                        throws InterruptedException
        Specified by:
        startRefactoringWithDialog in interface org.eclipse.xtext.ui.refactoring.ui.IRenameSupport
        Overrides:
        startRefactoringWithDialog in class org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport
        Throws:
        InterruptedException
      • startDirectRefactoring

        public void startDirectRefactoring()
                                    throws InterruptedException
        Specified by:
        startDirectRefactoring in interface org.eclipse.xtext.ui.refactoring.ui.IRenameSupport
        Overrides:
        startDirectRefactoring in class org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport
        Throws:
        InterruptedException
      • initialize

        protected boolean initialize​(org.eclipse.xtext.ui.refactoring.ui.IRenameElementContext renameElementContext,
                                     String newName)
        Overrides:
        initialize in class org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport
      • getRefactoringWizard

        protected org.eclipse.ltk.ui.refactoring.RefactoringWizard getRefactoringWizard​(org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring refactoring,
                                                                                        boolean previewOnly)
        Returns a new refactoring wizard that is ready to open.
        Parameters:
        refactoring - rename refactoring (not null)
        previewOnly - whether only preview page is to be shown (without user input pages)
        Returns:
        a new refactoring wizard (not null)
      • beforeRefactoringStart

        protected void beforeRefactoringStart()
                                       throws InterruptedException
        Called before refactoring is started. Default implementation waits for auto-build and reconciler jobs.
        Throws:
        InterruptedException - by SyncUtil.totalSync(boolean)