eclipse/dltk.core — pull request #3 by pulse00 (2013-04-19 16:57:58+00:00)
Title: Allow to override the instantiation of ReplaceEdits

We're working on some refactoring features for PDT in https://github.com/pdt-eg/Core-Plugin/issues/48

Unfortunately it looks like there's no way to conditionally change the `ReplaceEdit` depending on the `SearchMatch` during the renaming operation.

This PR allows to override `createReplaceEdit` in a custom `RenameModelElementProcessor`

This is needed otherwise each references get renamed incorrectly, for example:

```diff
diff --git a/src/Stagehand/FSM/Event.php b/src/Stagehand/FSM/Event.php
index 27bcb8d..98983f2 100644
--- a/src/Stagehand/FSM/Event.php
+++ b/src/Stagehand/FSM/Event.php
@@ -79,7 +79,7 @@ class Event
*
* @param string $stateID
*/
- public function setNextState($stateID)
+ public function setNextStateRenamed($stateID)
{
$this->nextState = $stateID;
}
diff --git a/src/Stagehand/FSM/FSMBuilder.php b/src/Stagehand/FSM/FSMBuilder.php
index 87db73a..578ba90 100644
--- a/src/Stagehand/FSM/FSMBuilder.php
+++ b/src/Stagehand/FSM/FSMBuilder.php
@@ -145,7 +145,7 @@ class FSMBuilder
$state->addEvent($event);
}

- $event->setNextState($nextStateID);
+ setNextStateRenamedextState($nextStateID);
$event->setAction($action);
$event->setGuard($guard);
$event->setHistoryMarker($historyMarker);
```

See the above mentioned ticket for details.