org.eclipse.xtext.common.types.ui.refactoring.participant
Class TextChangeCombiner

java.lang.Object
  extended by org.eclipse.xtext.common.types.ui.refactoring.participant.TextChangeCombiner

public class TextChangeCombiner
extends java.lang.Object

Restructures a given source change such that all changes to the same resource are united. This is necessary in order to resolve conflicts between changes to the same resource from multiple refactoring processors / participants within the same refactoring.

Author:
Jan Koehnlein - Initial contribution and API

Constructor Summary
TextChangeCombiner()
           
 
Method Summary
protected  void addIfNotDuplicate(org.eclipse.text.edits.MultiTextEdit multiTextEdit, org.eclipse.text.edits.TextEdit editToBeAdded)
           
 org.eclipse.ltk.core.refactoring.Change combineChanges(org.eclipse.ltk.core.refactoring.Change masterChange)
           
protected  org.eclipse.ltk.core.refactoring.TextChange createChange(java.lang.Object key)
           
protected  java.lang.Object getKey(org.eclipse.ltk.core.refactoring.TextChange change)
           
protected  void visitChange(org.eclipse.ltk.core.refactoring.Change sourceChange, java.util.Map<java.lang.Object,org.eclipse.text.edits.MultiTextEdit> resource2edits, java.util.List<org.eclipse.ltk.core.refactoring.Change> otherChanges)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextChangeCombiner

public TextChangeCombiner()
Method Detail

combineChanges

public org.eclipse.ltk.core.refactoring.Change combineChanges(org.eclipse.ltk.core.refactoring.Change masterChange)

visitChange

protected void visitChange(org.eclipse.ltk.core.refactoring.Change sourceChange,
                           java.util.Map<java.lang.Object,org.eclipse.text.edits.MultiTextEdit> resource2edits,
                           java.util.List<org.eclipse.ltk.core.refactoring.Change> otherChanges)

addIfNotDuplicate

protected void addIfNotDuplicate(org.eclipse.text.edits.MultiTextEdit multiTextEdit,
                                 org.eclipse.text.edits.TextEdit editToBeAdded)

getKey

protected java.lang.Object getKey(org.eclipse.ltk.core.refactoring.TextChange change)

createChange

protected org.eclipse.ltk.core.refactoring.TextChange createChange(java.lang.Object key)