Package org.netbeans.modules.php.api.editor

Examples of org.netbeans.modules.php.api.editor.PhpClass


    /**
     * Test of getViewName method, of class YiiUtils.
     */
    @Test
    public void testGetViewName() {
        PhpClass phpClass = new PhpClass("SiteController", "SiteController");
        phpClass.addMethod("actionIndex", "actionIndex");
        for (PhpClass.Method method : phpClass.getMethods()) {
            assertEquals("index", YiiUtils.getViewName(method));
        }
        phpClass = new PhpClass("SiteController", "SiteController");
        phpClass.addMethod("actions", "actions");
        for (PhpClass.Method method : phpClass.getMethods()) {
            assertEquals(null, YiiUtils.getViewName(method));
        }
    }
View Full Code Here


            FileObject controller = YiiUtils.getController(fo);
            if (controller != null) {
                List<PhpBaseElement> elements = new LinkedList<PhpBaseElement>();
                String controllerName = controller.getName();
                // add controller and variables
                PhpClass controllerClass = new PhpClass(controllerName, controllerName);
                PhpVariable phpVariable = new PhpVariable("$this", controllerClass, controller, 0); // NOI18N
                elements.add(phpVariable);
                elements.addAll(parseAction(fo));

                return elements;
View Full Code Here

                    varName = "$" + varName; // NOI18N
                    String fqn = instances.get(varName);

                    synchronized (fields) {
                        if (fqn != null && fqn.isEmpty()) {
                            PhpClass phpClass = new PhpClass(fqn, fqn);
                            fields.add(new PhpVariable(varName, phpClass, YiiUtils.getController(view), 0));
                        } else {
                            fields.add(new PhpVariable(varName, varName, view));
                        }
                    }
View Full Code Here

        Collection<PhpClass> phpClasses = editorSupport.getClasses(controller);
        if (phpClasses.size() != 1) {
            return false;
        }

        PhpClass phpClass = null;
        for (PhpClass pc : phpClasses) {
            phpClass = pc;
        }

        if (phpClass == null) {
            return false;
        }

        return phpClass.getName().startsWith(CONTROLLER_PREFIX);
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.api.editor.PhpClass

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.