Examples of PythonFile


Examples of org.python.pydev.navigator.elements.PythonFile

                if (viewerFilter instanceof PythonNodeFilter) {
                    return false;
                }
            }

            PythonFile f = (PythonFile) element;
            if (PythonPathHelper.isValidSourceFile(f.getActualObject())) {
                try {
                    InputStream contents = f.getContents();
                    try {
                        if (contents.read() == -1) {
                            return false; //if there is no content in the file, it has no children
                        } else {
                            return true; //if it has any content, it has children (performance reasons)
View Full Code Here

Examples of org.python.pydev.navigator.elements.PythonFile

            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) {
                            IProjectModulesManager projectModulesManager = (IProjectModulesManager) modulesManager;
                            String moduleName = projectModulesManager.resolveModuleInDirectManager(file
                                    .getActualObject());
                            if (moduleName != null) {
                                IModule module = projectModulesManager.getModuleInDirectManager(moduleName, nature,
                                        true);
                                if (module == null) {
                                    //ok, something strange happened... it shouldn't be null... maybe empty, but not null at this point
                                    //so, if it exists, let's try to create it...
                                    //TODO: This should be moved to somewhere else.
                                    String resourceOSString = PydevPlugin.getIResourceOSString(file.getActualObject());
                                    if (resourceOSString != null) {
                                        File f = new File(resourceOSString);
                                        if (f.exists()) {
                                            projectModulesManager.addModule(new ModulesKey(moduleName, f));
                                            module = projectModulesManager.getModuleInDirectManager(moduleName, nature,
View Full Code Here

Examples of org.python.pydev.navigator.elements.PythonFile

                    if (object instanceof IFolder) {
                        object = new PythonFolder(parent, ((IFolder) object), pythonSourceFolder);

                    } else if (object instanceof IFile) {
                        object = new PythonFile(parent, ((IFile) object), pythonSourceFolder);

                    } else if (object instanceof IResource) {
                        object = new PythonResource(parent, (IResource) object, pythonSourceFolder);
                    }
                } else { //existing != null
View Full Code Here

Examples of org.python.pydev.navigator.elements.PythonFile

                                    continue;
                                }
                            }
                            //creating is enough to add it to the model
                            if (f instanceof IFile) {
                                wrappedResource = new PythonFile(wrappedResource, (IFile) f, sourceFolderInWrap);
                            } else if (f instanceof IFolder) {
                                wrappedResource = new PythonFolder(wrappedResource, (IFolder) f, sourceFolderInWrap);
                            }
                        }
                        parentInWrap = wrappedResource;
View Full Code Here

Examples of org.python.pydev.navigator.elements.PythonFile

            }

        } else if (child instanceof IFile) {
            if (pythonSourceFolder != null) {
                //if the python source folder is null, that means that this is a file that is not actually below a source folder -- so, don't wrap it
                return new PythonFile((IWrappedResource) parent, (IFile) child, pythonSourceFolder);
            }

        } else if (child instanceof IResource) {
            if (pythonSourceFolder != null) {
                return new PythonResource((IWrappedResource) parent, (IResource) child, pythonSourceFolder);
View Full Code Here

Examples of org.python.pydev.navigator.elements.PythonFile

                            childrenItr.remove();
                            convertedChildren.add(new PythonFolder(parent, (IFolder) res, parent.getSourceFolder()));

                        } else if (res instanceof IFile) {
                            childrenItr.remove();
                            convertedChildren.add(new PythonFile(parent, (IFile) res, parent.getSourceFolder()));

                        } else if (child instanceof IResource) {
                            childrenItr.remove();
                            convertedChildren.add(new PythonResource(parent, (IResource) child, parent
                                    .getSourceFolder()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.