Package gw.util
Class GosuRefactorUtil
- java.lang.Object
-
- gw.util.GosuRefactorUtil
-
public class GosuRefactorUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGosuRefactorUtil.MoveInstruction
-
Constructor Summary
Constructors Constructor Description GosuRefactorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IParsedElementboundingParent(java.util.List<IParseTree> locations, int position, java.lang.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.MoveInstructionfindElementToMoveToAfter(IParseTree child)private static GosuRefactorUtil.MoveInstructionfindElementToMoveToBefore(IParseTree child)static IParseTreefindFirstStatementAtLine(int line, int position, java.util.List<IParseTree> locations)static IParseTreefindLastStatementAtLine(int line, int position, java.util.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 unitprivate static IParseTreefindStatementAtLine(java.util.List<IParseTree> locations, int position, int line, boolean earliest)static GosuRefactorUtil.MoveInstructiongetMoveDownInstruction(IParseTree elementToMoveAfter)static GosuRefactorUtil.MoveInstructiongetMoveUpInstruction(IParseTree elementToMoveBefore)static booleanisClassElement(IParseTree parseTree)private static booleanisOneOfTypes(IParsedElement pe, java.lang.Class<? extends IParsedElement>[] possibleTypes)
-
-
-
Method Detail
-
boundingParent
public static IParsedElement boundingParent(java.util.List<IParseTree> locations, int position, java.lang.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.
-
isOneOfTypes
private static boolean isOneOfTypes(IParsedElement pe, java.lang.Class<? extends IParsedElement>[] possibleTypes)
-
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)
-
findElementToMoveToBefore
private static GosuRefactorUtil.MoveInstruction findElementToMoveToBefore(IParseTree child)
-
isClassElement
public static boolean isClassElement(IParseTree parseTree)
-
findElementToMoveToAfter
public static GosuRefactorUtil.MoveInstruction findElementToMoveToAfter(IParseTree child)
-
findFirstStatementAtLine
public static IParseTree findFirstStatementAtLine(int line, int position, java.util.List<IParseTree> locations)
-
findLastStatementAtLine
public static IParseTree findLastStatementAtLine(int line, int position, java.util.List<IParseTree> locations)
-
findStatementAtLine
private static IParseTree findStatementAtLine(java.util.List<IParseTree> locations, int position, int line, boolean earliest)
-
-