1

I have my own custom editor and now I want to add refactor option to this editor. I know I can add a new menu item for the same, but I want to use the existing refactor option. Like when user selects text and if it is valid variable (in Java) the all other variables are highlighted and later it is replaced. Also, I want to reuse the same refactor option and not provide new menu item.
Any pointers on how to go about this? I followed the link: Eclipse rename/refactoring override
Now I get the notifications during each refactor but for my custom editor refactor -> rename menu is disabled. How do I enable it?

Community
  • 1
  • 1
Destructor
  • 3,154
  • 7
  • 32
  • 51
  • Each editor which supports refactoring has its own refactor menu, you can't really reuse these. – greg-449 Aug 07 '14 at 11:08
  • Well is there a way to enable the default refactor menu for my custom editor? I am able to get events for every refactoring by using extension: org.eclipse.ltk.core.refactoring.renameParticipants. But the problem is for my editor refactor option is not enabled. Source: http://www.ancitconsulting.com/tiki-index.php?page=Tutorials – Destructor Aug 07 '14 at 11:33
  • @greg-449 How do I add a new refactor menu to my editor? I am really struck here! – Destructor Aug 10 '14 at 13:19
  • Using the refactoring wizard is not something I have really looked at. [This article](http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html) looks like it covers everything (and yes it is complicated) – greg-449 Aug 10 '14 at 15:17
  • I presume that you are talking about a (C) code editor here? You don't make this clear in your question. You would need some kind of Abstract Syntax Tree (or other model) to perform refactoring I presume. – Maarten Bodewes Sep 25 '14 at 08:55

0 Answers0