Package org.python.pydev.refactoring.ast.adapters

Examples of org.python.pydev.refactoring.ast.adapters.ClassDefAdapter


        while (iter.hasNext()) {
            ITreeNode node = iter.next();
            if (node instanceof TreeNodeClassField) {
                List<INodeAdapter> fields = getFields(iter);
                if (!fields.isEmpty()) {
                    ClassDefAdapter clazz = (ClassDefAdapter) node.getAdapter();
                    ConstructorFieldRequest request = new ConstructorFieldRequest(clazz, fields, offsetStrategy,
                            adapterPrefs);
                    requests.add(request);
                }
            }
View Full Code Here


                new PythonNatureStub(), createVersionProvider());
        ClassDefVisitor classVisitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, module.getASTNode(),
                module, module);

        assertTrue(classVisitor.getAll().size() > 0);
        ClassDefAdapter classDefAdapter = (ClassDefAdapter) classVisitor.getAll().get(0);
        PropertyVisitor propertyVisitor = VisitorFactory.createContextVisitor(PropertyVisitor.class,
                classDefAdapter.getASTNode(), module, classDefAdapter);

        printProperties(buffer, propertyVisitor);

        assertEquals(getExpected(), getGenerated());
    }
View Full Code Here

                module.getASTNode(), module, module);
        ClassDefVisitor classVisitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, module.getASTNode(),
                module, module);
        assertTrue(classVisitor.getAll().size() > 0);

        ClassDefAdapter classDefAdapter = (ClassDefAdapter) classVisitor.getAll().get(0);
        LocalAttributeVisitor localVisitor = VisitorFactory.createContextVisitor(LocalAttributeVisitor.class,
                classDefAdapter.getASTNode(), module, classDefAdapter);
        printAttributes(buffer, globalVisitor);
        printAttributes(buffer, localVisitor);

        assertEquals(getExpected(), getGenerated());
    }
View Full Code Here

        this(module, config.getClassSelection(), config.getMethodSelection(), config.getOffsetStrategy(), config
                .getEditClass());
    }

    public List<OverrideMethodsRequest> getRefactoringRequests() throws MisconfigurationException {
        ClassDefAdapter clazz = (ClassDefAdapter) module.getClasses().get(editClass);

        IClassDefAdapter clazzSelection;

        int parsedInt = -1;
        try {
View Full Code Here

                    func.getASTNode(), module, func);

            printAttributes(buffer, visitor, func.getName());
        }
        for (IClassDefAdapter clazz : module.getClasses()) {
            ClassDefAdapter c = (ClassDefAdapter) clazz;
            ScopeVariablesVisitor visitor = VisitorFactory.createContextVisitor(ScopeVariablesVisitor.class,
                    c.getASTNode(), module, c);

            printAttributes(buffer, visitor, clazz.getName());
        }

        this.setTestGenerated(buffer.toString().trim());
View Full Code Here

        super(module, parent);
    }

    @Override
    protected IClassDefAdapter createAdapter(AbstractScopeNode<?> parent, SimpleNode node) {
        return new ClassDefAdapter(moduleAdapter, parent, (ClassDef) node, moduleAdapter.getAdapterPrefs());
    }
View Full Code Here

    private AbstractNodeAdapter<? extends SimpleNode> create(SimpleNode node) {

        AbstractScopeNode<?> parent = parents.peek();

        if (nodeHelper.isClassDef(node)) {
            return new ClassDefAdapter(moduleAdapter, parent, (ClassDef) node, moduleAdapter.getAdapterPrefs());
        } else if (nodeHelper.isFunctionDef(node)) {
            return new FunctionDefAdapter(moduleAdapter, parent, (FunctionDef) node, moduleAdapter.getAdapterPrefs());
        } else {
            return new SimpleAdapter(moduleAdapter, parent, node, moduleAdapter.getAdapterPrefs());
        }
View Full Code Here

TOP

Related Classes of org.python.pydev.refactoring.ast.adapters.ClassDefAdapter

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.