}
if ((text.contains("import ")) || (text.indexOf("from " + selectedText) >= 0)) {
// the selected text is then maybe an existing python lib
// path to python lib
FileSearch fileSearch = new FileSearch();
List<String> pythonLibPath = JythonTestScript.getAdditionalPythonPath(new File(fileName));
// replace the "." characters to "/"
selectedText = selectedText.replace(".", File.separator);
if (mTcPane != null) {
fileSearch.addSearchPath(new File(getFileName()).getParent());
fileSearch.addSearchPath(mTcPane.getCurrentSelectedTestsuite());
FileNode selectedNode = mTcPane.getCurrentSelectedFileNode();
if (selectedNode != null) {
if (selectedNode.isTestcaseDir()) {
fileSearch.addSearchPath(selectedNode.getFile().getParent());
}
}
for (String dir : pythonLibPath) {
fileSearch.addSearchPath(dir);
}
fileSearch.addSearchPath(StaticConfiguration.JYTHON_LIB);
fileSearch.addSearchPath(StaticConfiguration.ADDITIONNAL_JYTHON_LIB);
String importFileName =
fileSearch.getFirstFileFound(selectedText + ".py");
if (importFileName != null) // now open the docfile
{
// load the file
mTcPane.loadTestCaseSource(new File(importFileName), true, false);
}