Examples of IFolder


Examples of org.eclipse.core.resources.IFolder

      }
    }
  }

  public void registerExternalDesign(WGADesign wgaDesign) throws IOException, CoreException {
    IFolder designFolder = getDesignRoot().getFolder(new Path(wgaDesign.getName()));
    if (!designFolder.exists()) {
      designFolder.create(false, true, new NullProgressMonitor());
      createDirlink(wgaDesign, designFolder);
      getDesignRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    }
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

      getDesignRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    }
  }

  public void registerExternalPlugin(WGADesign wgaDesign) throws IOException, CoreException {
    IFolder pluginFolder = getPluginRoot().getFolder(wgaDesign.getName());
    if (!pluginFolder.exists()) {
      pluginFolder.create(false, true, new NullProgressMonitor());
      createDirlink(wgaDesign, pluginFolder);
      getPluginRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    }
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    public void apply(IDocument document) {
      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        IFolder tmlFolder = new WGADesignStructureHelper(referer).getTmlRoot();
        IFile fileToCreate = tmlFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    public void apply(IDocument document) {
      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
        IFolder scriptFolder = helper.getScriptsRoot();
        IFile fileToCreate = scriptFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

  public static IFolder createFolder(IContainer container, String name) throws CoreException {
    return createFolder(container, name, null);
  }
 
  public static IFolder createFolder(IContainer container, String name, IProgressMonitor monitor) throws CoreException {
    IFolder folder = container.getFolder(new Path(name));
    if (!folder.exists()) {
      folder.create(false, true, monitor);       
    }
    return folder;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    }
  }

  public static boolean hasDesignFolders(IContainer container) {
    if (container instanceof IFolder) {
      IFolder folder = (IFolder) container;
      try {
        for (IResource current : folder.members()) {
          if (current instanceof IContainer) {
            IContainer currentContainer = (IContainer) current;
            if (isDesignFolder(currentContainer)) {
              return true;
            }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

            throw new IllegalArgumentException("Cannot lookup file container reference relativ without referer.");
        }     
        if (referer != null) {
            WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);

            IFolder mediumFolder = helper.getTmlRoot().getFolder(WGADesignStructureHelper.determineMediaKey(referer));
           
            // cut off path up to medium
            int segments = referer.getLocation().matchingFirstSegments(mediumFolder.getLocation());
            IPath relativePathToMediumFolder = referer.getLocation().removeFirstSegments(segments).removeLastSegments(1);

            String referencePath = null;
            reference = reference.toLowerCase();
            if (reference.startsWith("::")) {
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

   */
  public static IFile findReferencedScript(IFile referer, String reference, String scriptType) {
    if (referer != null) {
      String referencePath = computeScriptReferencePath(referer, reference, scriptType);
      WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
      IFolder folder = helper.getScriptsRoot();
      return lookupFileReference(referencePath, folder);
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

  }
 
     private static IFolder lookupFolderReference(String referencePath, IFolder folder) {
          if (referencePath != null) {
              // first try - use unmodified referencePath
              IFolder referenceFolder = folder.getFolder(new Path(referencePath));
              if (referenceFolder.exists()) {
                  return referenceFolder;
              }

              // second try - lowercase referencePath
              referenceFolder = folder.getFolder(new Path(referencePath.toLowerCase()));
              if (referenceFolder.exists()) {
                  return referenceFolder;
              }

              // third try - case insensitiv match on all files in folder
              CaseInsensitivFolderReferenceSearcher searcher = new CaseInsensitivFolderReferenceSearcher(referencePath, folder);
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    if (referer != null) {
      if (medium == null || medium.trim().equals("")) {
        medium = WGADesignStructureHelper.determineMediaKey(referer);
      }
    }
    IFolder tmlFolder = getTmlRoot();
   
    if (referer != null) {
        VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(referer);   
        if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
            IPath path = referer.getFullPath().makeRelativeTo(getTmlRoot().getFullPath().append(WGADesignStructureHelper.determineMediaKey(referer)));
                if (path.toString().startsWith("overlay/") && !reference.startsWith("::")) {
                    if (reference.toLowerCase().endsWith("@base")) {
                        reference = reference.substring(0, reference.lastIndexOf("@"));       
                    } else  {
                        // this is a reference within an overlay - remove @base marker and add overlay folder to complete the path
                        reference = reference.substring(0, reference.lastIndexOf("@"));               
                        reference = "overlay:" + reference;
                    }
                }
        }
    }
   
    String referencePath = null;

    reference = reference.toLowerCase();
    if (reference.startsWith("::")) {
      int matchingSegments = referer.getLocation().matchingFirstSegments(tmlFolder.getLocation());
      String tmpPath = medium + "/";
      for (int i = matchingSegments + 1; i < referer.getLocation().segmentCount() - 1; i++) {
        tmpPath += referer.getLocation().segment(i) + "/";
      }
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.