Package gw.util
Class GosuRefactorUtil
- java.lang.Object
-
- gw.util.GosuRefactorUtil
-
public class GosuRefactorUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GosuRefactorUtil.MoveInstruction
-
Constructor Summary
Constructors Constructor Description GosuRefactorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IParsedElement
boundingParent(List<IParseTree> locations, int position, Class<? extends IParsedElement>... possibleTypes)
Finds a bounding parent of any of the possible types passed in from the list of locations, starting at the position given.static GosuRefactorUtil.MoveInstruction
findElementToMoveToAfter(IParseTree child)
static IParseTree
findFirstStatementAtLine(int line, int position, List<IParseTree> locations)
static IParseTree
findLastStatementAtLine(int line, int position, List<IParseTree> locations)
static IParseTree[]
findSpanningLogicalRange(IParseTree start, IParseTree end)
Given two parse tree positions, find the bounding pair that captures the start and end in one logical unitstatic GosuRefactorUtil.MoveInstruction
getMoveDownInstruction(IParseTree elementToMoveAfter)
static GosuRefactorUtil.MoveInstruction
getMoveUpInstruction(IParseTree elementToMoveBefore)
static boolean
isClassElement(IParseTree parseTree)
-
-
-
Method Detail
-
boundingParent
public static IParsedElement boundingParent(List<IParseTree> locations, int position, Class<? extends IParsedElement>... possibleTypes)
Finds a bounding parent of any of the possible types passed in from the list of locations, starting at the position given.
-
findSpanningLogicalRange
public static IParseTree[] findSpanningLogicalRange(IParseTree start, IParseTree end)
Given two parse tree positions, find the bounding pair that captures the start and end in one logical unit
-
getMoveUpInstruction
public static GosuRefactorUtil.MoveInstruction getMoveUpInstruction(IParseTree elementToMoveBefore)
-
getMoveDownInstruction
public static GosuRefactorUtil.MoveInstruction getMoveDownInstruction(IParseTree elementToMoveAfter)
-
isClassElement
public static boolean isClassElement(IParseTree parseTree)
-
findElementToMoveToAfter
public static GosuRefactorUtil.MoveInstruction findElementToMoveToAfter(IParseTree child)
-
findFirstStatementAtLine
public static IParseTree findFirstStatementAtLine(int line, int position, List<IParseTree> locations)
-
findLastStatementAtLine
public static IParseTree findLastStatementAtLine(int line, int position, List<IParseTree> locations)
-
-