Package org.eclipse.core.resources

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


  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

   *
   * @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

    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

      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

    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

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

        }
      return mediaKeys;
  }
 
  public static IContainer retrieveDesignContainerFromSelection(IStructuredSelection selection) {
      IContainer container = null;
      if (selection.getFirstElement() instanceof IContainer) {
          container = (IContainer) selection.getFirstElement();
      } else if (selection.getFirstElement() instanceof IFile) {
          container = ((IFile)selection.getFirstElement()).getParent();
      } else if (selection.getFirstElement() instanceof IJavaProject) {
          container = ((IJavaProject)selection.getFirstElement()).getProject();
      }
     
      if (container != null) {
            if (WGADesignStructureHelper.isDesignFolder(container)) {
                return container;
            }
            container = container.getParent();
            while (container != null) {               
                if (WGADesignStructureHelper.isDesignFolder(container)) {
                    return container;
                }
                container = container.getParent();
            }
        }
      return null;
  }
View Full Code Here

    List<IStatus> list = new ArrayList<IStatus>();

    if (!(getTreeViewer().getTree().getSelectionCount() > 0)) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
    } else {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();

      if (!WGADesignStructureHelper.isValidTMLLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a TML module here. Please select a folder below the tml folder."));
      }
    }
View Full Code Here

    } else if (!WGADesignStructureHelper.isValidModuleName(innerLayoutName)) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "The name for the innerlayout contains invalid characters. Only alphanumeric ascii characters and '.', '_', '-' and '$' are allowed."));
    }
   
    // check if the resources already exist
    IContainer designRoot = null;
    if (getPreviousPage() instanceof DesignFolderSelectionPage) {
      designRoot = (IContainer)((DesignFolderSelectionPage)getPreviousPage()).getSelectedResource();
    }
    if (designRoot == null) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "No design folder selected."));
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IContainer

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.