Examples of IContainer


Examples of org.eclipse.core.resources.IContainer

        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>();
            while (!parent.exists()) {
              if (parent instanceof IFolder) {
                foldersToCreate.add((IFolder)parent);
              }
              parent = parent.getParent();
            }
            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {   
    _resourceOk = false;
    if (element instanceof IContainer) {
      IContainer container = (IContainer) element;
      try {
        container.accept(new IResourceVisitor() {
          public boolean visit(IResource resource) throws CoreException {
            if (!_resourceOk && resource instanceof IContainer) {
              IContainer container = (IContainer) resource;
              if (isValidLocation(container)) {
                _resourceOk = true;
                return false;
              }
              return true;
            }
            return false;
          }
        });
      } catch (CoreException e) {
        Activator.getDefault().logWarning("Error while searching for valid children in resource " + container.getLocation().toString(), e);
      }   
      return _resourceOk;
    } else {
      return false;
    }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

 
 
 
 
  public static IFile determineSyncInfo(IContainer container) {   
    IContainer parent = container;
    while (parent instanceof IFolder) {
      parent = parent.getParent();
      IFile syncInfo = parent.getFile(new Path(DesignDirectory.DESIGN_DEFINITION_FILE));
      if (syncInfo.exists()) {
        return syncInfo;
      }
      syncInfo = parent.getFile(new Path(DesignDirectory.SYNCINFO_FILE));
      if (syncInfo.exists()) {
        return syncInfo;
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    if (file.getName().equals(DesignDirectory.DESIGN_DEFINITION_FILE)) {
      return file;
    } else if (file.getName().equals(DesignDirectory.SYNCINFO_FILE) && !file.getParent().getFile(new Path(DesignDirectory.DESIGN_DEFINITION_FILE)).exists()) {
      return file;
    }
    IContainer parent = file.getParent();
    return determineSyncInfo(parent);
  }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  public static IContainer dirLinkFolderToContainer(IFolder folder){
    File linkedFile = WGUtils.resolveDirLink(folder.getLocation().toFile());
    IContainer[] containers = folder.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI());

    if (containers != null && containers.length > 0) {
      IContainer container = containers[0];
      if (container instanceof IFolder) {
        return container;
      }
    }
   
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

   *
   * @param container
   * @return true/false
   */
  public static boolean isMediaKeyContainer(IContainer container) {
    IContainer parent = container.getParent();
    IContainer grandParent = null;
    if (parent != null && parent.isAccessible()) {
      grandParent = parent.getParent();
      if (grandParent != null && isDesignFolder(grandParent)) {
        WGADesignStructureHelper helper = new WGADesignStructureHelper(grandParent);
        return helper.getTmlRoot().equals(parent);
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    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.IContainer

      ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
       
        public boolean visit(IResource resource) throws CoreException {   
         
          if (resource instanceof IContainer) {
            IContainer container = (IContainer) resource;       
              if (filter.accept(resource)) {
                designResources.add(container);             
                return false;
              }
              return true;           
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    if (resource == null || !resource.exists()) {
      return false;
    } else if (resource.getType() == IResource.FILE) {
      return isWGADesignResource((IFile)resource);
    } else if (resource instanceof IContainer) {
      IContainer parent = (IContainer)resource;
      while (parent instanceof IFolder) {
        parent = parent.getParent();
        IFile syncInfo = parent.getFile(new Path(DesignDirectory.DESIGN_DEFINITION_FILE));
        if (syncInfo.exists()) {
          return true;
        }
        syncInfo = parent.getFile(new Path(DesignDirectory.SYNCINFO_FILE));
        if (syncInfo.exists()) {
          return true;
        }
      }
      return false;
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

      }
  }
 
  public String computeTMLReference(IFile tmlFile) {
      String mediaKey = determineMediaKey(tmlFile);     
      IContainer base = getTmlRoot().getFolder(mediaKey);
     
      IPath basePath = base.getFullPath();
      IPath path = tmlFile.getFullPath();     
      if(basePath.isPrefixOf(path)){
          path = path.removeFirstSegments(basePath.segmentCount());            
          path = path.removeFileExtension();
            return path.toString().replace('/', ':');
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.