Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFolder


      return null;
    }
  }

  private Object[] projectGetChildren(IProject parentElement) {
    IFolder syncDir = getSyncDir(parentElement);
    if (syncDir!=null && syncDir.exists()) {
      return new Object[] {new SyncDir(syncDir)};
    }
    return null;
  }
View Full Code Here


    }
    return false;
  }

  private boolean projectHasChildren(IProject project) {
    IFolder syncDir = getSyncDir(project);
    if (syncDir!=null && syncDir.exists()) {
      return true;
    }
    return false;
  }
View Full Code Here

            .hasNext();) {
          Object aChild = (Object) it.next();
          if (aChild instanceof IPackageFragmentRoot) {
            IPackageFragmentRoot ipfr = (IPackageFragmentRoot)aChild;
            IResource res = ipfr.getResource();
            IFolder syncDir = getSyncDir(project);
            if (res!=null && syncDir!=null && res.equals(syncDir)) {
              // then remove this one folder provided via j2ee content provider
              // reason: we are showing it too via the sling content provider
              it.remove();
              // and we can break here since there's only one syncdir currently
View Full Code Here

                link.addHyperlinkListener(new FileOpenLinkListener(buildFile.getFullPath()));
            } else {
                IResource[] extFiles;

                IContainer cnfDir = buildFile.getParent();
                IFolder extDir = cnfDir.getFolder(new Path("ext"));
                if (extDir.exists())
                    extFiles = extDir.members();
                else
                    extFiles = new IResource[0];

                if (extFiles.length > 0) {
                    for (IResource extFile : extFiles) {
                        if (extFile.getType() == IResource.FILE && "bnd".equalsIgnoreCase(extFile.getFileExtension())) {
                            ImageHyperlink link = form.getToolkit().createImageHyperlink(container, SWT.CENTER);
                            link.setText("Open " + extFile.getName());
                            link.setImage(extFileImg);
                            link.addHyperlinkListener(new FileOpenLinkListener(extFile.getFullPath()));
                        }
                    }
                } else {
                    createMissingExtsWarningPanel(container, form.getToolkit(), extDir.getFullPath());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        }
        return super.getNextPage(page);
    }

    private void setupMainPageLocation() {
        IFolder folder = null;
        Object selected = selection.getFirstElement();

        if (selected instanceof IFile) {
            selected = ((IFile) selected).getParent();
        }

        if (selected instanceof IProject) {
            IProject project = (IProject) selected;
            folder = project.getFolder("OSGI-INF/blueprint");
            if (!folder.exists()) {
                try {
                    if (!folder.getParent().exists()) {
                        IFolder parent = (IFolder) folder.getParent();
                        parent.create(false, true, null);
                        speculativelyCreatedFolders.push(parent);
                    }
                    folder.create(false, true, null);
                    speculativelyCreatedFolders.push(folder);
                } catch (CoreException e) {
View Full Code Here

        return super.performCancel();
    }

    private void deleteSpeculativelyCreatedFolders() {
        while (!speculativelyCreatedFolders.isEmpty()) {
            IFolder speculativelyCreatedFolder = speculativelyCreatedFolders.pop();
            try {
                speculativelyCreatedFolder.delete(false, null);
            } catch (CoreException e) {
                // Oh well - we're stuck with the folder...
                logger.logError(String.format("Unable to delete folder: %s", speculativelyCreatedFolder.getFullPath().toString()), e);
            }
        }
    }
View Full Code Here

        Collection<IPath> paths = classPathPage.getPaths();
        if (paths != null && !paths.isEmpty()) {
            int workRemaining = 1 + paths.size();
            progress.setWorkRemaining(workRemaining);

            IFolder libFolder = project.getProject().getFolder("lib");
            libFolder.create(false, true, progress.newChild(1));

            // Copy JARs into project lib folder.
            IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
            for (IPath path : paths) {
                File file = FileUtils.toFile(wsroot, path);
                if (file != null && file.isFile()) {
                    IFile copy = libFolder.getFile(file.getName());
                    try {
                        FileInputStream input = new FileInputStream(file);
                        try {
                            copy.create(input, false, progress.newChild(1));
                        } finally {
View Full Code Here

    }

    @Override
    public void doCreate(IProgressMonitor monitor) throws CoreException {
        final IProject project = createProject(projectName, monitor);
        final IFolder link = createLink(monitor, project, root);

        final IClasspathEntry[] srcFolders = getSourceFolders(project, link, monitor);
        final IClasspathEntry[] pkgLibs = getPackageDependencies();
        final IClasspathEntry platform = getPlatformDependenceis(repoPath);
View Full Code Here

        javaProject.setOutputLocation(javaProject.getPath().append("out"), monitor);
    }

    private IFolder createLink(IProgressMonitor monitor, IProject project, IPath repoPath)
            throws CoreException {
        final IFolder repoLink = project.getFolder(repoPath.lastSegment());
        if (repoLink.exists()) {
            // Our work here is already done.
            return repoLink;
        }
        // Let's filter out some content we don't need.
        repoLink.createFilter(IResourceFilterDescription.EXCLUDE_ALL
                | IResourceFilterDescription.FOLDERS | IResourceFilterDescription.INHERITABLE,
                new FileInfoMatcherDescription(FILE_FILTER_ID, ".git"), 0, monitor);

        repoLink.createLink(repoPath, 0, monitor);

        return repoLink;
    }
View Full Code Here

    private void addJavaNature(IProject project, IProgressMonitor monitor) throws CoreException {
        if (project == null) {
            throw new IllegalStateException(
                    "Project must be created before giving it a Java nature");
        }
        final IFolder repoLink = createRepoLink(monitor, project, repoPath);
        IFile classpath = repoLink.getFile("development/ide/eclipse/.classpath");
        IFile classpathDestination = project.getFile(".classpath");
        if (classpathDestination.exists()) {
            classpathDestination.delete(true, monitor);
        }
        classpath.copy(classpathDestination.getFullPath(), true, monitor);
View Full Code Here

TOP

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

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.