Examples of GoToItemFactory


Examples of org.netbeans.modules.php.fuel.ui.actions.gotos.items.GoToItemFactory

        scan(visitor, targetFile);
    }

    private void setGoToItems(Set<String> viewPath, FILE_TYPE fileType, boolean isAll) {
        FileObject targetDirectory = getDirectory(fileType);
        GoToItemFactory itemFactory = GoToItemFactory.getInstance();
        for (String path : viewPath) {
            if (StringUtils.isEmpty(path)) {
                continue;
            }

            // check moodule
            String[] moduleSplite = FuelUtils.moduleSplit(path);
            FileObject moduleDirectory = null;
            if (moduleSplite != null && moduleSplite.length == 2) {
                String moduleName = moduleSplite[0];
                path = moduleSplite[1];
                FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(getPhpModule());
                moduleDirectory = fuelModule.getDirectory(DIR_TYPE.MODULES, fileType, moduleName);
            }

            // get file
            FileObject view;
            if (moduleDirectory != null) {
                view = moduleDirectory.getFileObject(path.concat(".php")); // NOI18N
            } else {
                view = targetDirectory.getFileObject(path.concat(".php")); // NOI18N
            }
            if (view == null) {
                continue;
            }

            // add to items
            GoToItem item = itemFactory.create(view, DEFAULT_OFFSET, ""); // NOI18N
            if (item == null) {
                continue;
            }
            switch (fileType) {
                case VIEW:
View Full Code Here

Examples of org.netbeans.modules.php.fuel.ui.actions.gotos.items.GoToItemFactory

            return Collections.emptyList();
        }

        Enumeration<? extends FileObject> children = directory.getChildren(true);
        List<GoToItem> items = new ArrayList<GoToItem>();
        GoToItemFactory factory = GoToItemFactory.getInstance();
        while (children.hasMoreElements()) {
            FileObject child = children.nextElement();
            if (FileUtils.isPhpFile(child)) {
                // use EditorCookie if offset is 0 in order to open a file
                items.add(factory.create(child, DEFAULT_OFFSET, null));
            }
        }
        sort(items);
        return items;
    }
View Full Code Here

Examples of org.netbeans.modules.php.fuel.ui.actions.gotos.items.GoToItemFactory

                }
            }
            break;
        }

        GoToItemFactory factory = GoToItemFactory.getInstance();
        List<GoToItem> items = new ArrayList<GoToItem>(2);
        items.add(factory.create(controller, DEFAULT_OFFSET, "")); // NOI18N
        if (!methodName.isEmpty()) {
            items.add(factory.create(controller, methodOffset, methodName));
        }
        return items;
    }
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.