Examples of IVirtualFolder


Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

   * (relative to the web content folder) returned by getFilenames(), and
   * updates the set of {@link IJSFAppConfigProvider} instances accordingly.
   */
  public void locateProviders() {
    IProject project = getJSFAppConfigManager().getProject();
    IVirtualFolder webContentFolder = new DefaultVirtualComponentQuery().getWebContentFolder(project);
    if (webContentFolder != null) {
      List filenames = getFilenames();
      Iterator itFilenames = filenames.iterator();
      Set newConfigProviders = new LinkedHashSet();
      while (itFilenames.hasNext()) {
        String filename = (String)itFilenames.next();
        IVirtualResource appConfigResource = webContentFolder.findMember(filename);
        if (appConfigResource != null && appConfigResource.getType() == IVirtualResource.FILE) {
          IFile file = (IFile)appConfigResource.getUnderlyingResource();
          if (file != null && file.exists()) {
            ArtifactEditJSFAppConfigProvider configProvider = new ArtifactEditJSFAppConfigProvider(file);
            newConfigProviders.add(configProvider);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

    Path p = new Path(doc.getBaseLocation());
    IVirtualComponent projectComp = ComponentCore.createComponent(project);
   
    if (projectComp != null)
    {
        IVirtualFolder rootFolder = projectComp.getRootFolder();
       
        if (rootFolder != null)
        {
            IPath webContentPath =
                rootFolder.getUnderlyingFolder().getFullPath();
            return getURIFromPath(p.makeRelativeTo(webContentPath));
        }
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

   * folder.
   */
  public static IPath getWebContentFolderRelativePath(IFile file) {
    IPath path = null;
    if (file != null) {
      IVirtualFolder webContentFolder = getWebContentFolder(file.getProject());
      if (webContentFolder != null) {
        IPath webContentPath = webContentFolder.getProjectRelativePath();
        IPath filePath = file.getProjectRelativePath();
        int matchingFirstSegments = webContentPath.matchingFirstSegments(filePath);
        path = filePath.removeFirstSegments(matchingFirstSegments);
      }
    }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

    /**
     * @return the root folder for resources in the workspace.
     */
    public IFolder getRootResourceFolder()
    {
        final IVirtualFolder webContentFolder = _vcQuery
                .getWebContentFolder(_project);
        if (webContentFolder != null
                && webContentFolder.getUnderlyingFolder().isAccessible())
        {
            return webContentFolder.getUnderlyingFolder().getFolder(
                    new Path("resources")); //$NON-NLS-1$
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

      int index = value.indexOf('?');
      if (index != -1) {
        value = value.substring(0, index);
      }
      if (value != null && value.length() > 1) {
        IVirtualFolder webRoot = ComponentCore.createComponent(jsp.getProject()).getRootFolder();
        if (value.charAt(0) == '/') {
          IVirtualFile file = webRoot.getFile(new Path(value));
          if (file.exists()) {
            return true;
          }
        } else {
          IPath webContentPath = webRoot.getUnderlyingFolder().getFullPath();
          IPath filePath = jsp.getFullPath();
          if (filePath.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
            String extension = filePath.getFileExtension();
            filePath = filePath.removeFirstSegments(webContentPath.segmentCount());
            filePath = filePath.removeLastSegments(1);
            filePath = filePath.append(value);
            if (filePath.getFileExtension() == null && extension != null) {
              filePath = filePath.addFileExtension(extension);
            }
            IVirtualFile file = webRoot.getFile(filePath);
            if (file.exists()) {
              return true;
            }
          }
        }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

  }

  @Override
  public IVirtualFolder getRootFolder() {
    IVirtualComponent component = ComponentCore.createComponent(getProject());
    IVirtualFolder root =null;
    if (component != null) {
      root = component.getRootFolder();
    }
    return root;
  }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

                  final IWorkspace ws = ResourcesPlugin.getWorkspace();
                  final IPath pjpath = project.getFullPath();

                  final IPath contentdir = setContentPropertyIfNeeded(model, pjpath, project);
                  mkdirs(ws.getRoot().getFolder(contentdir), monitor);
                  IVirtualFolder contentRootFolder = c.getRootFolder();
                  WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(contentRootFolder, contentdir, monitor);

                  String contextRoot = model.getStringProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT);
                  setContextRootPropertyIfNeeded(c, contextRoot);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

            if(model.isProperty(IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER)){
              IPath appClientContent = new Path("/" + model.getStringProperty(IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER));//$NON-NLS-1$
              if (!WTPProjectsUtil.hasLink(project, new Path("/"), appClientContent, monitor)) {//$NON-NLS-1$
                final IVirtualComponent c = ComponentCore.createComponent(project, true);
                if (c != null) {
                  final IVirtualFolder root = c.getRootFolder();
                  root.createLink(appClientContent , 0, null);
                }
              }
              try {
                ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null);
              } catch(ExecutionException e) {
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

 
  private IContainer[] getRootFolders() {
    IVirtualComponent component = ComponentCore.createComponent(project);
    IContainer[] folders = null;
    if (component != null) {
      IVirtualFolder rootFolder = component.getRootFolder();
      folders = rootFolder.getUnderlyingFolders();
    } else {
      folders = new IContainer[0];
    }
    return folders;
  }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualFolder

    if(entries.size() < cp.length) {
      JavaCore.create(project).setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), monitor);
    }
   
    IVirtualComponent c = ComponentCore.createComponent(project);
    IVirtualFolder rootFolder = c.getRootFolder();
   
    IPath runtimePath = rootFolder.getRuntimePath();
    rootFolder.removeLink(runtimePath, IVirtualResource.FORCE, monitor);
   
    rootFolder.delete(IVirtualResource.IGNORE_UNDERLYING_RESOURCE, monitor);
  }
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.