Examples of IFolder


Examples of org.eclipse.core.resources.IFolder

      if (medium == null) {
        medium = "html";
      }
     
      WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
      IFolder mediumFolder = helper.getTmlRoot().getFolder(medium);

      // 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

      String referencePath = computeFileContainerReferencePath(null, containername);
        return lookupFolderReference(referencePath, getFileContainerRoot());
  }

  public Set<IFolder> getFileContainers() {
    final IFolder fFilesFolder = getFileContainerRoot();
    final Set<IFolder> fFileContainers = new HashSet<IFolder>();
    try {
      fFilesFolder.accept(new IResourceVisitor() {

        public boolean visit(IResource resource) throws CoreException {
          if (resource.equals(fFilesFolder)) {
            return true;
          } else if (resource instanceof IFolder) {
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    return files;

  }

  public Set<IFolder> getLabelContainers() throws CoreException {
    IFolder filesFolder = getFileContainerRoot();
    Set<IFolder> containers = new HashSet<IFolder>();
    for (IResource current : filesFolder.members()) {
      if (current instanceof IFolder) {
        IFolder currentFolder = (IFolder) current;
        if (currentFolder.getName().toLowerCase().startsWith("labels_")) {
          containers.add(currentFolder);
        }
      }
    }
    return containers;
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

      return null;
    }
  }

  public IFolder getLabelContainer(String language, boolean createIfMissing) throws CoreException {
    IFolder container = getFileContainer("labels_" + language.toLowerCase());
    if (container == null) {
      container = getFileContainerRoot().getFolder(new Path("labels_" + language.toLowerCase()));
    }
    if (!container.exists()) {
      container.create(false, true, new NullProgressMonitor());
    }
    return container;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

  public Properties loadLabel(String labelFileName) throws CoreException {
    return loadLabel(getLabelFile(labelFileName));
  }

  public IFile getLabelFile(String labelFileName) throws CoreException {
    IFolder labelContainer = getLabelContainer(getDevelopmentLanguage());
    if (labelContainer != null) {
      String completeFilename = labelFileName + ".properties";
      IFile labelFile = labelContainer.getFile(completeFilename);
      if (labelFile.exists()) {
        return labelFile;
      } else {
        // try case insensitiv search
        CaseInsensitivSearcher searcher = new CaseInsensitivSearcher(completeFilename);
        labelContainer.accept(searcher, IResource.DEPTH_ONE, IResource.FILE);
        return (IFile) searcher.getResource();
      }
    } else {
      return null;
    }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    // create new file if not exists
    if (!labelFile.exists()) {
      try {
        if (!labelFile.getParent().exists()) {
          if (labelFile.getParent() instanceof IFolder) {
            IFolder parentFolder = (IFolder) labelFile.getParent();
            parentFolder.create(false, true, new NullProgressMonitor());
          }
        }
        ByteArrayInputStream byteStream = new ByteArrayInputStream("".getBytes());
        labelFile.create(byteStream, true, new NullProgressMonitor());
       
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    }
   
  }

  public void createLabel(String labelFileName, String key, String value) throws CoreException {
    IFolder labelContainer = getLabelContainer(getDevelopmentLanguage(), true);
    IFile labelFile = labelContainer.getFile(new Path(labelFileName.toLowerCase()) + ".properties");
    createLabel(labelFile, key, value);
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

   *
   * @param tmlfile
   * @return metadata file (must not exist)
   */
  public static IFile getMetadataFile(IFile tmlfile) {
    IFolder metadataFolder = tmlfile.getParent().getFolder(new Path("metadata"));
    return metadataFolder.getFile(tmlfile.getName().substring(0, tmlfile.getName().length() - tmlfile.getFileExtension().length()) + "metadata.xml");
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

    }
  }
 
  public static void createDirklink(IContainer designRoot, IContainer folder, String name) throws CoreException, IOException {
    // create new folder in designroot with given name and add dirlink
    IFolder designFolder = FileUtils.createFolder(designRoot, name);
    createDirlink(designFolder, folder);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IFolder

      if(header==null){
          header ="";
      }
     
    IResource portletFolderResource = FileUtils.createFolder(parent, portletName);
    IFolder portletFolder = (IFolder) portletFolderResource;     
   
    String tmlInclude = header + "\n<tml:include ref=\"{'::mode-' + portlet.mode}\"/>";   
    ByteArrayInputStream input = new ByteArrayInputStream(tmlInclude.getBytes());
    IFile portletFile = portletFolder.getFile("portlet.tml");
    portletFile.create(input, true, new NullProgressMonitor());
   
    portletFolder.getFile("form.tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());   
    //TODO Form for form.tml
   
   
   
    Iterator<String> it = modes.iterator();   
    while (it.hasNext()) {
      String current = it.next();
      portletFolder.getFile("mode-"+current+".tml").create(new ByteArrayInputStream(header.getBytes()), true, new NullProgressMonitor());     
    }   
    return portletFile;
  }
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.