Examples of FuelPhpModule


Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

            if (tmpPhpModule == phpModule) {
                return;
            }

            phpModule = tmpPhpModule;
            FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);

            // set version number
            FuelPhpVersion version = fuelModule.getVersion();
            fuelVersionLabel.setText(version.getVersionNumber());
            fuelVersionLabel.setIcon(icon);
        }
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

        Project[] openProjects = OpenProjects.getDefault().getOpenProjects();
        for (Project project : openProjects) {
            PhpModule phpModule = PhpModule.Factory.lookupPhpModule(project);
            if (phpModule != null) {
                if (FuelUtils.isFuelPHP(phpModule)) {
                    FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
                    fuelModule.notifyPropertyChanged(new PropertyChangeEvent(this, FuelPhpModule.PROPERTY_CHANGE_FUEL, null, null));
                }
            }
        }
    }
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

        PhpModule phpModule = PhpModule.Factory.forFileObject(targetFile);
        this.targetFile = targetFile;
        this.offset = offset;

        // get file type
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
        FILE_TYPE fileType = fuelModule.getFileType(targetFile);

        switch (fileType) {
            case CONTROLLER:
                status = FuelPhpControllerGoToStatus.getInstance();
                break;
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

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

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

    }

    @Override
    public List<GoToItem> getSmart() {
        FileObject currentFile = getCurrentFile();
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(getPhpModule());
        DIR_TYPE dirType = fuelModule.getDirType(currentFile);
        String dirName = ""; // NOI18N
        if (dirType == DIR_TYPE.MODULES) {
            dirName = fuelModule.getModuleName(currentFile);
        } else if (dirType == DIR_TYPE.PACKAGES) {
            dirName = fuelModule.getPackageName(currentFile);
        }
        String path = currentFile.getPath();
        String relativePath = ""; // NOI18N
        int index;
        List<String> dirNames = Arrays.asList("/controller/", "/model/", "/view/"); // NOI18N
        for (String name : dirNames) {
            index = path.indexOf(name); // NOI18N
            if (index > 0) {
                relativePath = "classes/" + path.substring(index); // NOI18N
                break;
            }
        }

        FileObject baseDirectory = fuelModule.getDirectory(dirType, FILE_TYPE.NONE, dirName);
        if (baseDirectory == null) {
            return Collections.emptyList();
        }
        FileObject target = baseDirectory.getFileObject(relativePath);
        if (target == null) {
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

     * Get GoToItems for test.
     *
     * @return GoToItems if it is not empty, otherwise empty list.
     */
    public List<GoToItem> getTests() {
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
        FileObject testsDirectory = getDirectory(FILE_TYPE.TESTS);
        if (testsDirectory == null) {
            return Collections.emptyList();
        }
        FILE_TYPE fileType = fuelModule.getFileType(currentFile);
        String path = currentFile.getPath();
        String relativePath = "";
        int index = 0;
        switch (fileType) {
            case CONTROLLER:
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

     *
     * @param fileType
     * @return directory for file type.
     */
    protected FileObject getDirectory(FILE_TYPE fileType) {
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
        return fuelModule.getDirectory(currentFile, fileType);
    }
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

        // get base directory
        FileObject baseDirectory = getBaseDirectory();

        // create new empty file
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
        try {
            String relativePath = targetText + element.getExtension();
            boolean isCreated = fuelModule.createNewFile(baseDirectory, relativePath);
            if (isCreated) {
                targetFile = baseDirectory.getFileObject(relativePath);
            }
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

     * Get base directory for path.
     *
     * @return
     */
    private FileObject getBaseDirectory() {
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(phpModule);
        if (!moduleName.isEmpty()) {
            return fuelModule.getDirectory(DIR_TYPE.MODULES, element.getFileType(), moduleName);
        } else {
            return element.getBaseDirectory(phpModule);
        }
    }
View Full Code Here

Examples of org.netbeans.modules.php.fuel.modules.FuelPhpModule

        return offset;
    }

    @Override
    public String toString() {
        FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(PhpModule.Factory.forFileObject(fileObject));
        String sourceDirectoryPath = fuelModule.getSourceDirectoryPath();
        String path = fileObject.getPath();
        String nameWithExt = fileObject.getNameExt();
        StringBuilder sb = new StringBuilder();
        sb.append(nameWithExt.charAt(0));
        sb.append(": "); // NOI18N
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.