Package gw.util
Class GosuRefactorUtil
java.lang.Object
gw.util.GosuRefactorUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.private static GosuRefactorUtil.MoveInstruction
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 unitprivate static IParseTree
findStatementAtLine
(List<IParseTree> locations, int position, int line, boolean earliest) getMoveDownInstruction
(IParseTree elementToMoveAfter) getMoveUpInstruction
(IParseTree elementToMoveBefore) static boolean
isClassElement
(IParseTree parseTree) private static boolean
isOneOfTypes
(IParsedElement pe, Class<? extends IParsedElement>[] possibleTypes)
-
Constructor Details
-
GosuRefactorUtil
public GosuRefactorUtil()
-
-
Method Details
-
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. -
isOneOfTypes
private static boolean isOneOfTypes(IParsedElement pe, Class<? extends IParsedElement>[] possibleTypes) -
findSpanningLogicalRange
Given two parse tree positions, find the bounding pair that captures the start and end in one logical unit -
getMoveUpInstruction
-
getMoveDownInstruction
public static GosuRefactorUtil.MoveInstruction getMoveDownInstruction(IParseTree elementToMoveAfter) -
findElementToMoveToBefore
-
isClassElement
-
findElementToMoveToAfter
-
findFirstStatementAtLine
public static IParseTree findFirstStatementAtLine(int line, int position, List<IParseTree> locations) -
findLastStatementAtLine
public static IParseTree findLastStatementAtLine(int line, int position, List<IParseTree> locations) -
findStatementAtLine
private static IParseTree findStatementAtLine(List<IParseTree> locations, int position, int line, boolean earliest)
-