Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Override default resouce rename refactor
Override default resouce rename refactor [message #1062732] Mon, 10 June 2013 14:35 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 7
Registered: July 2010
Junior Member
I have built a new plugin to handle files with .message extension inside Java project, my editor works well. One issue is once the user call the default resouce rename refactor to rename ,I need to amend the file content as well, it is something like once the .java file is rename, the class name is also changed.
I have searched serveral days and have some idea on how to write refactor code, but I have no idea how to link the code(some action) to the existing menu refacot/rename...? On the other word, once user select .message file in project explorer and then call rename from main menu refactor/rename, how to popup my own refactor wizard?

Any tips is appreciated!
Re: Override default resouce rename refactor [message #1063053 is a reply to message #1062732] Tue, 11 June 2013 22:42 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1051
Registered: July 2009
Senior Member
Have you seen this extension point?
http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ltk_core_refactoring_renameParticipants.html
Re: Override default resouce rename refactor [message #1063466 is a reply to message #1063053] Thu, 13 June 2013 09:08 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 7
Registered: July 2010
Junior Member
Thank you for your reply.
I have read the related code of JDT and found a positive answer.
JDT can only support two kinds of refactoring once the cursor is at package explorer view: the first one is for java related objects,such as java project,interface, class, etc.The second type is resouce refactor which is the one once you try to refactor some non-java realted objects,such as text file.
There is no way to change/overrise/insert a new refactor UI into JDT project,I think.
Rename paticipants is another approach but I suppose it is is called after the refactor UI is popup up.
Previous Topic:Own Launch implementation doesn't see classes from other bundles
Next Topic:Turn of error message for wrong Java version (execution environment)
Goto Forum:
  


Current Time: Mon Dec 22 04:59:26 GMT 2014

Powered by FUDForum. Page generated in 0.02310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software