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

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


    public final void setControllerExtendsComboBox() {
        Object currentItem = controllerExtendsComboBox.getSelectedItem();
        controllerExtendsComboBox.removeAllItems();
        controllerExtendsComboBox.addItem(""); // NOI18N
        controllerExtendsComboBox.setEditable(true);
        EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
        FileObject controllerDirectory = FuelUtils.getControllerDirectory(phpModule);
        FileObject coreDirectory = FuelUtils.getCoreDirectory(phpModule);
        FileObject coreControllerDirectory = null;
        if (coreDirectory != null) {
            coreControllerDirectory = coreDirectory.getFileObject("classes/controller"); // NOI18N
        }

        List<FileObject> controllers = new LinkedList<FileObject>();

        // core
        if (coreControllerDirectory != null) {
            Enumeration<? extends FileObject> children = coreControllerDirectory.getChildren(true);
            controllers.addAll(Collections.list(children));
        }

        // app
        if (controllerDirectory != null) {
            Enumeration<? extends FileObject> children = controllerDirectory.getChildren(true);
            controllers.addAll(Collections.list(children));
        }

        // add items
        controllerExtendsComboBox.addItem("Controller"); // NOI18N
        FuelUtils.sortFileObject(controllers);
        for (FileObject controller : controllers) {
            for (PhpClass phpClass : editorSupport.getClasses(controller)) {
                String className = phpClass.getName();
                if (className.startsWith(FuelUtils.CONTROLLER_PREFIX)) {
                    controllerExtendsComboBox.addItem(className);
                }
            }
View Full Code Here


                    commandList.add(new FuelPhpFrameworkCommand(phpModule, new String[]{command, subCommand}, fullCommand, fullCommand));
                }
            } else if (command.equals(REFINE_COMMAND)) {
                List<FileObject> tasks = new LinkedList<FileObject>();
                getTasks(phpModule, tasks);
                EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
                for (FileObject task : tasks) {
                    String taskName = task.getName();
                    fullCommand = command + " " + taskName; // NOI18N
                    for (PhpClass phpClass : editorSupport.getClasses(task)) {
                        Collection<PhpClass.Method> methods = phpClass.getMethods();
                        boolean existsHelp = false;
                        for (PhpClass.Method method : methods) {
                            if (method.getName().equals("help")) { // NOI18N
                                existsHelp = true;
View Full Code Here

            return;
        }
        if (targetFile.isFolder()) {
            return;
        }
        EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
        Collection<PhpClass> classes = editorSupport.getClasses(targetFile);
        for (PhpClass phpClass : classes) {
            className = phpClass.getName();
            methods = phpClass.getMethods();
            break;
        }
View Full Code Here

        if (controller == null) {
            return Collections.emptyList();
        }

        // infer method
        EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
        Collection<PhpClass> classes = editorSupport.getClasses(controller);
        int methodOffset = 0;
        String methodName = ""; // NOI18N
        for (PhpClass phpClass : classes) {
            for (PhpClass.Method method : phpClass.getMethods()) {
                if (method.getName().equals("action_" + view.getName())) { // NOI18N
View Full Code Here

TOP

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

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.