Package org.eclipse.dltk.internal.core

Examples of org.eclipse.dltk.internal.core.ScriptFolder


    // even when they are selected,but they will not choosen by default,
    // so make the parent of these php files is ScriptProject instead of
    // ScriptFolder is ok
    if (element instanceof SourceModule && parent instanceof ScriptFolder) {
      SourceModule sourceModule = (SourceModule) element;
      ScriptFolder scriptFolder = (ScriptFolder) parent;
      if (scriptFolder.getPath().segmentCount() == 1) {
        parent = sourceModule.getScriptProject();
        // element = sourceModule.getResource();
      }
    }
    fCurrentTreeSelection = parent;
View Full Code Here


    * @return
    */
    public IType[] findBundleControllers(String bundle, IScriptProject project) {


        ScriptFolder bundleFolder = findBundleFolder(bundle, project);
        if(bundleFolder == null)
            return null;

        ISourceModule controllerSource = bundleFolder.getSourceModule("Controller");

        if (controllerSource == null)
            return null;

        IDLTKSearchScope controllerScope = SearchEngine.createSearchScope(controllerSource);
View Full Code Here

    }

    public List<IPath> findBundleViewPaths(String bundle, IScriptProject project)
    {
        ScriptFolder folder = findBundleFolder(bundle, project);
        List<IPath> viewPaths = new LinkedList<IPath>();

        if (folder == null) {
            return viewPaths;
        }

        try {

            IResource resource = folder.getUnderlyingResource();
            List<IPath> structure = new LinkedList<IPath>();
            IPath path = resource.getFullPath();
            path = path.removeFirstSegments(1).append("Resources").append("views");
            int num = path.segmentCount() + 1;
View Full Code Here

    */
    public IModelElement[] findTemplates(String bundle, String controller, IScriptProject project) {

        try {

            ScriptFolder bundleFolder = findBundleFolder(bundle, project);
            IPath relative = new Path("Resources/views/" + controller.replace("Controller", ""));
            IPath path = bundleFolder.getPath().append(relative);
            IScriptFolder sfolder = project.findScriptFolder(path);

            if (sfolder != null && sfolder.exists() && sfolder.hasChildren()) {
                return sfolder.getChildren();
            }
View Full Code Here

        if ( (controllerCache.get(key)) != null) {
            return controllerCache.get(key) == NULL_ENTRY ? null : (IType) controllerCache.get(key);
        }

        ScriptFolder bundleFolder = findBundleFolder(bundle, scriptProject);
        if(bundleFolder == null)
            return null;

        ISourceModule controllerSource = bundleFolder.getSourceModule("Controller");

        if (controllerSource == null)
            return null;

        IDLTKSearchScope controllerScope = SearchEngine.createSearchScope(controllerSource);
View Full Code Here

    public IModelElement[] findBundleRootTemplates(String bundle,
            IScriptProject project) {

        try {

            ScriptFolder bundleFolder = findBundleFolder(bundle, project);
            IPath path = new Path("Resources/views/");
            IPath viewPath = bundleFolder.getPath().append(path);
            IScriptFolder sfolder = project.findScriptFolder(viewPath);

            if (sfolder != null && sfolder.exists() && sfolder.hasChildren()) {
                return sfolder.getChildren();
            }
View Full Code Here

                if (sfolder != null) {
                    return sfolder.getSourceModule(template);
                }
            } else if (viewPath.isBundleBasePath()) {

                ScriptFolder bundleFolder = findBundleFolder(bundle, project);

                if (bundleFolder == null)
                    return null;

                IScriptFolder viewFolder = project.findScriptFolder(bundleFolder.getPath().append(new Path("Resources/views")));

                if (viewFolder != null) {
                    return viewFolder.getSourceModule(template);
                }

            } else {

                if (bundle == null || controller == null)
                    return null;

                ScriptFolder bundleFolder = findBundleFolder(bundle, project);
                IPath path = new Path("Resources/views/" + controller.replace("Controller", ""));
                IPath iPath = bundleFolder.getPath().append(path);
                IScriptFolder sfolder = project.findScriptFolder(iPath);

                if (sfolder != null) {
                    return sfolder.getSourceModule(template);
                }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.core.ScriptFolder

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.