*
* @return the children (an array of IWrappedResources)
*/
private Object[] getChildrenForIWrappedResource(IWrappedResource wrappedResourceParent) {
//------------------------------------------------------------------- get python nature
PythonNature nature = null;
Object[] childrenToReturn = null;
Object obj = wrappedResourceParent.getActualObject();
IProject project = null;
if (obj instanceof IResource) {
IResource resource = (IResource) obj;
project = resource.getProject();
if (project != null && project.isOpen()) {
nature = PythonNature.getPythonNature(project);
}
}
//------------------------------------------------------------------- treat python nodes
if (wrappedResourceParent instanceof PythonNode) {
PythonNode node = (PythonNode) wrappedResourceParent;
childrenToReturn = getChildrenFromParsedItem(wrappedResourceParent, node.entry, node.pythonFile);
//------------------------------------- treat python files (add the classes/methods,etc)
} else if (wrappedResourceParent instanceof PythonFile) {
// if it's a file, we want to show the classes and methods
PythonFile file = (PythonFile) wrappedResourceParent;
if (PythonPathHelper.isValidSourceFile(file.getActualObject())) {
if (nature != null) {
ICodeCompletionASTManager astManager = nature.getAstManager();
//the nature may still not be completely restored...
if (astManager != null) {
IModulesManager modulesManager = astManager.getModulesManager();
if (modulesManager instanceof IProjectModulesManager) {