1 11 package org.eclipse.ltk.internal.ui.refactoring; 12 13 import java.util.List ; 14 15 import org.eclipse.ltk.core.refactoring.Change; 16 import org.eclipse.ltk.core.refactoring.TextEditBasedChange; 17 18 import org.eclipse.ltk.ui.refactoring.TextEditChangeNode; 19 import org.eclipse.ltk.ui.refactoring.TextEditChangeNode.ChildNode; 20 21 public abstract class InternalTextEditChangeNode extends AbstractChangeNode { 22 23 protected InternalTextEditChangeNode(PreviewNode parent, Change change) { 24 super(parent, change); 25 } 26 27 int getActive() { 28 return getCompositeChangeActive(); 29 } 30 31 boolean hasOneGroupCategory(List categories) { 32 return ((TextEditBasedChange)getChange()).hasOneGroupCategory(categories); 33 } 34 35 protected TextEditBasedChange getTextEditBasedChange() { 36 return (TextEditBasedChange)getChange(); 37 } 38 39 final PreviewNode[] doCreateChildren() { 40 return createChildNodes(); 41 } 42 43 protected static TextEditChangeNode internalGetTextEditChangeNode(PreviewNode node) { 44 PreviewNode element= node.getParent(); 45 while(!(element instanceof TextEditChangeNode) && element != null) { 46 element= element.getParent(); 47 } 48 return (TextEditChangeNode)element; 49 } 50 51 protected abstract ChildNode[] createChildNodes(); 52 } 53 | Popular Tags |