List of usage examples for org.eclipse.jdt.core.dom BodyDeclaration getLocationInParent
public final StructuralPropertyDescriptor getLocationInParent()
null if this is a root node. From source file:edu.illinois.jflow.core.transformations.code.ExtractClosureRefactoring.java
License:Open Source License
private void createMethodBundle(final CompilationUnitChange result) { BodyDeclaration methodDecl = locateSelectedMethod(); TextEditGroup insertClassDesc = new TextEditGroup( JFlowRefactoringCoreMessages.ExtractClosureRefactoring_bundle_textedit_description); result.addTextEditGroup(insertClassDesc); BundleCreator bc = new BundleCreator(stages.values()); AbstractTypeDeclaration newClass = bc.createNewNestedClass(); ChildListPropertyDescriptor methodDeclDescriptor = (ChildListPropertyDescriptor) methodDecl .getLocationInParent();/* www. j a v a2s . c o m*/ ListRewrite methodDeclContainer = fRewriter.getListRewrite(methodDecl.getParent(), methodDeclDescriptor); methodDeclContainer.insertBefore(newClass, methodDecl, insertClassDesc); }