Examples of IWorkspaceRoot


Examples of org.eclipse.core.resources.IWorkspaceRoot

    public static IPath toPath(File file) throws Exception {
        IPath result = null;

        File absolute = file.getCanonicalFile();

        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        IFile[] candidates = wsroot.findFilesForLocationURI(absolute.toURI());
        if (candidates != null && candidates.length > 0) {
            result = candidates[0].getFullPath();
        } else {
            String workspacePath = getWorkspace().getBase().getAbsolutePath();
            String absolutePath = absolute.getPath();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        logAdapter = new LogServiceAdapter(logger);
    }

    @Override
    public void builtBundles(final IProject project, IPath[] paths) {
        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        final URI workspaceRootUri = wsroot.getLocationURI();

        Set<File> files = new HashSet<File>();
        for (IPath path : paths) {
            try {
                IFile ifile = wsroot.getFile(path);
                IPath location = ifile.getLocation();
                if (location != null)
                    files.add(location.toFile());
            } catch (IllegalArgumentException e) {
                System.err.println("### Error processing path: " + path);
                e.printStackTrace();
            }
        }

        // Generate the index file
        File indexFile;
        OutputStream output = null;
        try {
            Project model = Central.getProject(project.getLocation().toFile());
            File target = model.getTarget();
            indexFile = new File(target, INDEX_FILENAME);

            IFile indexPath = wsroot.getFile(Central.toPath(indexFile));

            // Create the indexer and add ResourceAnalyzers from plugins
            RepoIndex indexer = new RepoIndex(logAdapter);
            List<ResourceAnalyzer> analyzers = Central.getWorkspace().getPlugins(ResourceAnalyzer.class);
            for (ResourceAnalyzer analyzer : analyzers) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

            return null;
        }

        IPath bundlePath = path;
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot root = workspace.getRoot();
        IResource resource = root.findMember(path);
        if (resource != null) {
            bundlePath = resource.getLocation();
        }

        JarInputStream jarStream = null;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

            progress = SubMonitor.convert(monitor, projects.size());
        } catch (Exception e) {
            return Status.CANCEL_STATUS;
        }

        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>();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        logAdapter = new LogServiceAdapter(logger);
    }

    @Override
    public void builtBundles(final IProject project, IPath[] paths) {
        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        final URI workspaceRootUri = wsroot.getLocationURI();

        Set<File> files = new HashSet<File>();
        for (IPath path : paths) {
            try {
                IFile ifile = wsroot.getFile(path);
                IPath location = ifile.getLocation();
                if (location != null)
                    files.add(location.toFile());
            } catch (IllegalArgumentException e) {
                System.err.println("### Error processing path: " + path);
                e.printStackTrace();
            }
        }

        // Generate the index file
        File indexFile;
        OutputStream output = null;
        try {
            Project model = Central.getProject(project.getLocation().toFile());
            File target = model.getTarget();
            indexFile = new File(target, INDEX_FILENAME);

            IFile indexPath = wsroot.getFile(Central.toPath(indexFile));

            // Create the indexer and add ResourceAnalyzers from plugins
            RepoIndex indexer = new RepoIndex(logAdapter);
            List<ResourceAnalyzer> analyzers = Central.getWorkspace().getPlugins(ResourceAnalyzer.class);
            for (ResourceAnalyzer analyzer : analyzers) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        return result.get();
    }

    private Project getDependencyTargetChange() throws Exception {
        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        Collection<Project> dependson = model.getDependson();
        log(LOG_FULL, "project depends on: %s", dependson);

        for (Project dep : dependson) {
            File targetDir = dep.getTarget();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        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
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        return result.get();
    }

    private Project getDependencyTargetChange() throws Exception {
        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        Collection<Project> dependson = model.getDependson();
        log(LOG_FULL, "project depends on: %s", dependson);

        for (Project dep : dependson) {
            File targetDir = dep.getTarget();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        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
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

    public static IResource toWorkspaceResource(File file) {
        IPath path = new Path(file.toString());

        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IWorkspaceRoot workspaceRoot = workspace.getRoot();
        IPath workspacePath = workspaceRoot.getLocation();

        if (workspacePath.isPrefixOf(path)) {
            final IPath relativePath = path.removeFirstSegments(workspacePath.segmentCount());
            IResource resource;
            if (file.isDirectory()) {
                resource = workspaceRoot.getFolder(relativePath);
            } else {
                resource = workspaceRoot.getFile(relativePath);
            }
            return resource;
        }
        return null;
    }
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.