Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Composite Refactoring using participants / TextChangeManager
Composite Refactoring using participants / TextChangeManager [message #312157] Thu, 01 February 2007 18:04
Dan Haywood is currently offline Dan HaywoodFriend
Messages: 5
Registered: July 2009
Junior Member
[Sorry for the cross-post with jdt, but refactoring participants is
under platform LTK, so I figured the answer might be here in platforms?]
---

I'm (trying to) write a refactoring participant that allows me to modify
additional methods when a field changes. This is to fit in with the
conventions of a framework.

So, if I change String firstName -> String givenName, then the getter
and setter modify, but also an associateFirstName -> associateGivenName,
and dissociateFirstName -> dissociateGivenName.

I've written a participant to the
"org.eclipse.ltk.core.refactoring.renameParticipants" extension point,
and this (rather naughtily) uses the internal JDT
RenameVirtualMethodProcessor to create the Change (and TextChange)
objects. However, my method processors aren't aware of the text changes
made by the original RenameFieldProcessor, and so it ends up trashing
the text file.

Looking at RenameFieldProcessor, it overrides
computeRenameModifications() to identify the changes that need to be
made. One solution might be to somehow override this, however the field
processor is created through a bunch of static methods - there is no
factory hook.

Alternatively, I might be able to grab the mutable state in the field
processor (the TextChangeManager and other gumph?) and somehow give it
to my method processors so that they are "aware" of the text changes
already made.

Any insights, anyone?
Previous Topic:Programmatically closing an editor causing Grahics is disposed exceptions
Next Topic:Hiding some physical resources in Project Explorer
Goto Forum:
  


Current Time: Sat Jul 27 12:01:25 GMT 2024

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

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

Back to the top