Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProject


            File targetDir = dep.getTarget();
            // Does not exist... was it deleted?
            if (targetDir == null || !(targetDir.isDirectory()))
                return dep;

            IProject project = WorkspaceUtils.findOpenProject(wsroot, dep);
            if (project == null) {
                logger.logWarning(String.format("Dependency project '%s' from project '%s' is not in the Eclipse workspace.", dep.getName(), model.getName()), null);
                return null;
            }

            IFile buildFile = project.getFolder(targetDir.getName()).getFile(Workspace.BUILDFILES);
            IPath buildFilePath = buildFile.getProjectRelativePath();
            IResourceDelta delta = getDelta(project);

            if (delta == null) {
                // May have changed
View Full Code Here


    private IProject[] calculateDependsOn(Project model) throws Exception {
        Collection<Project> dependsOn = model.getDependson();
        List<IProject> result = new ArrayList<IProject>(dependsOn.size() + 1);

        IProject cnfProject = WorkspaceUtils.findCnfProject();
        if (cnfProject != null)
            result.add(cnfProject);

        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        for (Project project : dependsOn) {
            IProject targetProj = WorkspaceUtils.findOpenProject(wsroot, project);
            if (targetProj == null)
                logger.logWarning("No open project in workspace for Bnd '-dependson' dependency: " + project.getName(), null);
            else
                result.add(targetProj);
        }
View Full Code Here

                        allow = false;
                if (allow)
                    queue.addAll(Arrays.asList(container.getClasspathEntries()));
                break;
            case IClasspathEntry.CPE_PROJECT :
                IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(path.lastSegment());
                IJavaProject targetJavaProject = JavaCore.create(targetProject);
                accumulateClasspath(files, targetJavaProject, true, containerFilters);
                break;
            default :
                logger.logError("Unhandled IPath entryKind of " + entry.getEntryKind(), null);
View Full Code Here

                setPageComplete(false);
                return;
            }

            // check whether project already exists
            final IProject handle = workspace.getRoot().getProject(name);
            if (handle.exists()) {
                setErrorMessage("A project with this name already exists.");
                setPageComplete(false);
                return;
            }
View Full Code Here

    public static IProject findOpenProject(IWorkspaceRoot wsroot, Project model) {
        return findOpenProject(wsroot, model.getName());
    }

    public static IProject findOpenProject(IWorkspaceRoot wsroot, String name) {
        IProject project = wsroot.getProject(name);
        if (project == null || !project.exists() || !project.isOpen())
            return null;
        return project;
    }
View Full Code Here

    IProject getProject() {
        IAdaptable elem = getElement();
        if (elem instanceof IProject)
            return (IProject) elem;

        IProject project = (IProject) elem.getAdapter(IProject.class);
        if (project != null)
            return project;

        throw new IllegalArgumentException("Target element does not adapt to IProject");
    }
View Full Code Here

        if (element instanceof IPackageFragment) {

            IPackageFragment pkg = (IPackageFragment) element;

            IJavaProject javaProject = pkg.getJavaProject();
            IProject project = javaProject.getProject();
            boolean schedule = true;

            try {
                Collection<IResource> sourceFolders = Central.getSourceFolderModel(project);
                if (sourceFolders == null) {
View Full Code Here

        }

        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        while (!projects.isEmpty()) {
            Project project = projects.remove(0);
            IProject eclipseProject = WorkspaceUtils.findOpenProject(wsroot, project);
            if (eclipseProject != null && !eclipseProject.equals(addedProject)) {
                List<String> errors = new LinkedList<String>();
                try {
                    project.propertiesChanged();
                    BndContainerInitializer.resetClasspaths(project, eclipseProject, errors);
                    BndContainerInitializer.replaceClasspathProblemMarkers(eclipseProject, errors);
View Full Code Here

     */
    public void run(IAction action) {
        if (selection instanceof IStructuredSelection) {
            for (Iterator< ? > it = ((IStructuredSelection) selection).iterator(); it.hasNext();) {
                Object element = it.next();
                IProject project = null;
                if (element instanceof IProject) {
                    project = (IProject) element;
                } else if (element instanceof IAdaptable) {
                    project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
                }
View Full Code Here

        if (element instanceof IPackageFragment) {

            IPackageFragment pkg = (IPackageFragment) element;

            IJavaProject javaProject = pkg.getJavaProject();
            IProject project = javaProject.getProject();
            boolean schedule = true;

            try {
                Collection<IResource> sourceFolders = Central.getSourceFolderModel(project);
                if (sourceFolders == null) {
View Full Code Here

TOP

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

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.