List<String> testCases = new ArrayList<String>();
try {
String projectName = "";
List<IFile> files = new ArrayList<IFile>();
if (editor instanceof AbstractTextEditor) {
AbstractTextEditor textEditor = (AbstractTextEditor) editor;
// org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor
// If we can find some particular tests selected in the file
if (textEditor.getSelectionProvider().getSelection() instanceof ITextSelection) {
int startLine = updateTestCasesFromSelection(testCases, textEditor);
if (testCases.isEmpty()) {
updateTestCasesFromCurrentLine(testCases, textEditor, startLine);
}
}