Package org.python.pydev.navigator.elements

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


            }
        }

        //------------------------------------------------------------------- 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
View Full Code Here


     * @return the children elements (PythonNode) for the passed parsed item
     */
    private Object[] getChildrenFromParsedItem(Object parentElement, ParsedItem root, PythonFile pythonFile) {
        ParsedItem[] children = root.getChildren();

        PythonNode p[] = new PythonNode[children.length];
        int i = 0;
        // in this case, we just want to return the roots
        for (ParsedItem e : children) {
            p[i] = new PythonNode(pythonFile, parentElement, e);
            i++;
        }
        return p;
    }
View Full Code Here

                }
            }
            return provider.getImage(actualObject);
        }
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            return node.entry.getImage();
        }
        if (element instanceof IWrappedResource) {
            IWrappedResource resource = (IWrappedResource) element;
            Object actualObject = resource.getActualObject();
View Full Code Here

    /**
     * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
     */
    public String getText(Object element) {
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            return node.entry.toString();
        }

        if (element instanceof PythonSourceFolder) {
            PythonSourceFolder sourceFolder = (PythonSourceFolder) element;
View Full Code Here

public class CommentsFilter extends AbstractFilter {

    @Override
    public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            ASTEntryWithChildren astThis = node.entry.getAstThis();
            if (astThis == null) {
                return true;
            }
            SimpleNode n = astThis.node;
View Full Code Here

        if (filesSelected.size() > 0) {
            openFiles(filesSelected);

        } else if (nodesSelected.size() > 0) {
            PythonNode node = nodesSelected.iterator().next();
            ParsedItem actualObject = node.getActualObject();
            ASTEntryWithChildren astThis = actualObject.getAstThis();
            if (astThis != null) {
                new PyOpenAction().run(new ItemPointer(node.getPythonFile().getActualObject(), NodeUtils
                        .getNameTokFromNode(astThis.node)));
            }

        } else if (pythonPathZipFilesSelected.size() > 0) {
            openFiles(pythonPathZipFilesSelected.toArray(new PythonpathZipChildTreeNode[pythonPathZipFilesSelected
View Full Code Here

public class ImportsFilter extends AbstractFilter {

    @Override
    public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            ASTEntryWithChildren astThis = node.entry.getAstThis();
            if (astThis == null) {
                return true;
            }
            SimpleNode n = astThis.node;
View Full Code Here

TOP

Related Classes of org.python.pydev.navigator.elements.PythonNode

Copyright © 2018 www.massapicom. 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.