Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IScriptFolder


      return (resource != null && Resources.isReadOnly(resource));
    case IModelElement.SCRIPT_FOLDER:
      IResource packResource = ReorgUtils.getResource(modelElement);
      if (packResource == null)
        return false;
      IScriptFolder pack = (IScriptFolder) modelElement;
      if (Resources.isReadOnly(packResource))
        return true;
      Object[] nonScript = pack.getForeignResources();
      for (int i = 0; i < nonScript.length; i++) {
        Object object = nonScript[i];
        if (object instanceof IResource
            && hasReadOnlyResourcesAndSubResources((IResource) object))
          return true;
      }
      return hasReadOnlyResourcesAndSubResources(pack.getChildren());
    case IModelElement.PROJECT_FRAGMENT:
      IProjectFragment root = (IProjectFragment) modelElement;
      if (root.isArchive())
        return false;
      IResource pfrResource = ReorgUtils.getResource(modelElement);
View Full Code Here


public class EmptyInnerPackageFilter extends ViewerFilter {

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IScriptFolder) {
      IScriptFolder pkg = (IScriptFolder) element;

      try {
        if (pkg.isRootFolder())
          return pkg.hasChildren();
        return pkg.hasSubfolders() || pkg.hasChildren()
            || (pkg.getForeignResources().length > 0);
      } catch (ModelException e) {
        PHPUiPlugin.log(e);
      }
    }
View Full Code Here

      return (resource != null && Resources.isReadOnly(resource));
    case IModelElement.SCRIPT_FOLDER:
      IResource packResource = ReorgUtils.getResource(modelElement);
      if (packResource == null)
        return false;
      IScriptFolder pack = (IScriptFolder) modelElement;
      if (Resources.isReadOnly(packResource))
        return true;
      Object[] nonScript = pack.getForeignResources();
      for (int i = 0; i < nonScript.length; i++) {
        Object object = nonScript[i];
        if (object instanceof IResource
            && hasReadOnlyResourcesAndSubResources((IResource) object))
          return true;
      }
      return hasReadOnlyResourcesAndSubResources(pack.getChildren());
    case IModelElement.PROJECT_FRAGMENT:
      IProjectFragment root = (IProjectFragment) modelElement;
      if (root.isArchive())
        return false;
      IResource pfrResource = ReorgUtils.getResource(modelElement);
View Full Code Here

   * Returns the specified source module in the given project, root, and
   * folder or <code>null</code> if it does not exist.
   */
  public ISourceModule getSourceModule(String projectName, String rootPath,
      IPath path) throws ModelException {
    IScriptFolder folder = getScriptFolder(projectName, rootPath,
        path.removeLastSegments(1));
    if (folder == null) {
      return null;
    }
    return folder.getSourceModule(path.lastSegment());
  }
View Full Code Here

    return folder.getSourceModule(path.lastSegment());
  }

  public ISourceModule getSourceModule(String projectName, String rootPath,
      String path) throws ModelException {
    IScriptFolder folder = getScriptFolder(projectName, rootPath, new Path(
        path).removeLastSegments(1));
    if (folder == null) {
      return null;
    }
    return folder.getSourceModule(new Path(path).lastSegment().toString());
  }
View Full Code Here

   * Returns the specified source module in the given project, root, and
   * folder or <code>null</code> if it does not exist.
   */
  public ISourceModule getSourceModule(String projectName, String rootPath,
      IPath path) throws ModelException {
    IScriptFolder folder = getScriptFolder(projectName, rootPath, path
        .removeLastSegments(1));
    if (folder == null) {
      return null;
    }
    return folder.getSourceModule(path.lastSegment());
  }
View Full Code Here

    return folder.getSourceModule(path.lastSegment());
  }

  public ISourceModule getSourceModule(String projectName, String rootPath,
      String path) throws ModelException {
    IScriptFolder folder = getScriptFolder(projectName, rootPath, new Path(
        path).removeLastSegments(1));
    if (folder == null) {
      return null;
    }
    return folder.getSourceModule(new Path(path).lastSegment().toString());
  }
View Full Code Here

      if (rootPath.isPrefixOf(path) && !Util.isExcluded(path, root, false)) {
        IPath localPath = path.setDevice(null).removeFirstSegments(
            rootPath.segmentCount());
        if (localPath.segmentCount() >= 1) {
          final IScriptFolder folder;
          if (localPath.segmentCount() > 1) {
            folder = root.getScriptFolder(localPath.removeLastSegments(1));
          } else {
            folder = root.getScriptFolder(Path.EMPTY);
          }
          module = folder.getSourceModule(localPath.lastSegment());
          break;
        }
      }
    }
    if (module == null || !module.exists()){
View Full Code Here

        ISelection selection = selectionService.getSelection();

        NewClassWizard wizard = new NewClassWizard();
        String serviceClass = "";
        String className = "";
        IScriptFolder folder = null;

        try {
            serviceClass = (String) marker.getAttribute(SymfonyMarker.SERVICE_CLASS);
        } catch (CoreException e) {
            Logger.logException(e);
View Full Code Here

    return null;
  }
 
  private IHyperlink getTemplateLink(ViewPath viewPath, IRegion wordRegion) {
           
    IScriptFolder folder = SymfonyModelAccess.getDefault().findBundleFolder(viewPath.getBundle(), input.getScriptProject());
   
    if (folder == null) {
      Logger.debugMSG("Unable to resolve template link: " + viewPath);
      return null;
    }
   
    String path = "Resources/views/";
   
    if (viewPath.getController() != null) {     
      path += viewPath.getController() + "/";
    }
   
    path += viewPath.getTemplate();   
    ISourceModule module = folder.getSourceModule(path);
   
    if (module != null) {     
      return new ModelElementHyperlink(wordRegion, module, new OpenAction(editor));   
    }
       
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.IScriptFolder

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.