Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IPathVariableManager


            path = project.getProject().getLocation();
        }

        // here we should resolve path variables,
        // probably existing at first place of path
        IPathVariableManager pathManager = workspace.getPathVariableManager();
        path = pathManager.resolvePath(path);

        if (path == null) {
            return dir;
        }
View Full Code Here


        }
        IPath rawLocation = underlyingResource.getRawLocation();
        // here we should resolve path variables,
        // probably existing at first place of "rawLocation" path
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IPathVariableManager pathManager = workspace.getPathVariableManager();
        rawLocation = pathManager.resolvePath(rawLocation);
        try {
            return new FileInputStream(rawLocation.toOSString());
        } catch (FileNotFoundException e) {
            BytecodeOutlinePlugin.log(e, IStatus.ERROR);
        }
View Full Code Here

            return null;
        }
        // here we should resolve path variables,
        // probably existing at first place of path
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IPathVariableManager pathManager = workspace.getPathVariableManager();
        path = pathManager.resolvePath(path);

        JarFile jar = null;
        try {
            jar = new JarFile(path.toOSString());
        } catch (IOException e) {
View Full Code Here

        if (erlProject == null) {
            return includeDirs;
        }
        final Collection<IPath> projectIncludeDirs = erlProject.getProperties()
                .getIncludeDirs();
        final IPathVariableManager pvm = ResourcesPlugin.getWorkspace()
                .getPathVariableManager();
        for (final IPath inc : projectIncludeDirs) {
            final IPath incPath = URIUtil.toPath(pvm.resolveURI(URIUtil.toURI(inc)));
            if (incPath.isAbsolute()) {
                includeDirs.add(incPath);
            } else {
                final IFolder folder = project.getFolder(incPath);
                if (folder != null) {
View Full Code Here

        deltaManager = new ErlModelDeltaManager(this);
    }

    public final void setupWorkspaceListeners() {
        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IPathVariableManager pvm = workspace.getPathVariableManager();
        pvm.addChangeListener(fPathVariableChangeListener);
        final IResourceChangeListener listener = new ResourceChangeListener();
        workspace.addResourceChangeListener(listener);
    }
View Full Code Here

        fListeners.remove(listener);
    }

    @Override
    protected void closing(final Object info) throws ErlModelException {
        final IPathVariableManager pvm = ResourcesPlugin.getWorkspace()
                .getPathVariableManager();
        pvm.removeChangeListener(fPathVariableChangeListener);
    }
View Full Code Here

    }

    @Override
    public OtpErlangList getPathVars(final IResource context) {
        // if (fCachedPathVars == null) {
        final IPathVariableManager pvm = context.getProject().getPathVariableManager();
        final List<OtpErlangObject> objects = Lists.newArrayList();
        final String[] names = pvm.getPathVariableNames();
        for (final String name : names) {
            final String value = URIUtil.toPath(pvm.getURIValue(name)).toPortableString();
            objects.add(new OtpErlangTuple(new OtpErlangObject[] {
                    new OtpErlangString(name), new OtpErlangString(value) }));
        }

        fCachedPathVars = OtpErlang.mkList(objects);
View Full Code Here

                final List<String> files = new ArrayList<String>();
                files.addAll(PreferencesUtils.unpackList(extMods));
                final String extIncs = properties.getExternalIncludes();
                files.addAll(PreferencesUtils.unpackList(extIncs));

                final IPathVariableManager pvm = ResourcesPlugin.getWorkspace()
                        .getPathVariableManager();
                for (final String file : files) {
                    IResource fres;
                    try {
                        fres = ResourceUtil.recursiveFindNamedResource(project, file,
View Full Code Here

    // OtpErlangList getPathVars();
    @Test
    public void getPathVars() throws Exception {
        final OtpErlangList pathVars = model.getPathVars(project.getWorkspaceProject());
        final IPathVariableManager pvm = project.getCorrespondingResource()
                .getPathVariableManager();
        final String[] pathVariableNames = pvm.getPathVariableNames();
        final int n = pathVariableNames.length;
        assertEquals(n, pathVars.arity());

        final URI path = getTmpURIPath("");
        pvm.setURIValue(PV, path);
        final OtpErlangList pathVars2 = model.getPathVars(project.getWorkspaceProject());
        assertEquals(n + 1, pathVars2.arity());

        final OtpErlangTuple t = (OtpErlangTuple) pathVars2.elementAt(0);
        final String name = Util.stringValue(t.elementAt(0));
        final String value = pvm.getURIValue(name).getPath();
        String value2 = Util.stringValue(t.elementAt(1));
        if (!value2.startsWith("/")) {
            value2 = "/" + value2;
        }
        assertEquals(value, value2);
View Full Code Here

@SuppressWarnings("all")
public class PathResolver {
  public Collection<IPath> resolvePaths(final Collection<IPath> paths) {
    IWorkspace _workspace = ResourcesPlugin.getWorkspace();
    final IPathVariableManager pathVariableManager = _workspace.getPathVariableManager();
    int _size = paths.size();
    final List<IPath> result = Lists.<IPath>newArrayListWithCapacity(_size);
    for (final IPath path : paths) {
      {
        URI _uRI = URIUtil.toURI(path);
        URI _resolveURI = pathVariableManager.resolveURI(_uRI);
        final IPath resolvedPath = URIUtil.toPath(_resolveURI);
        result.add(resolvedPath);
      }
    }
    return Collections.<IPath>unmodifiableCollection(result);
View Full Code Here

TOP

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

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.